1.7.100
This commit is contained in:
parent
3d2adc1ca2
commit
c648dcb378
84 changed files with 6018 additions and 5405 deletions
|
@ -92,7 +92,7 @@ public class MetalRecyclerViewPager extends RecyclerView {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(VH holder, int position) {
|
||||
public void onBindViewHolder(@NonNull VH holder, int position) {
|
||||
int currentItemWidth = itemWidth;
|
||||
|
||||
if (position == 0) {
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
package code.name.monkey.retromusic.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.Region;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.FrameLayout;
|
||||
import code.name.monkey.retromusic.R;
|
||||
|
||||
/**
|
||||
* Frame layout that has rounded corners (it clips content too).
|
||||
*
|
||||
* @author Anton Chekulaev
|
||||
*/
|
||||
public class RoundCornerFrameLayout extends FrameLayout {
|
||||
|
||||
private final Path stencilPath = new Path();
|
||||
private float cornerRadius = 0;
|
||||
|
||||
public RoundCornerFrameLayout(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public RoundCornerFrameLayout(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public RoundCornerFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
|
||||
TypedArray attrArray = context
|
||||
.obtainStyledAttributes(attrs, R.styleable.RoundCornerFrameLayout, 0, 0);
|
||||
try {
|
||||
cornerRadius = attrArray.getDimension(R.styleable.RoundCornerFrameLayout_corner_radius, 0f);
|
||||
} finally {
|
||||
attrArray.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
/*@Override
|
||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||
super.onSizeChanged(w, h, oldw, oldh);
|
||||
|
||||
// compute the path
|
||||
stencilPath.reset();
|
||||
stencilPath.addRoundRect(0, 0, w, h, cornerRadius, cornerRadius, Path.Direction.CW);
|
||||
stencilPath.close();
|
||||
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
protected void dispatchDraw(Canvas canvas) {
|
||||
final int count = canvas.save();
|
||||
final Path path = new Path();
|
||||
final RectF rect = new RectF(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
final float[] arrayRadius = {cornerRadius, cornerRadius, cornerRadius, cornerRadius,
|
||||
cornerRadius, cornerRadius, cornerRadius, cornerRadius};
|
||||
|
||||
path.addRoundRect(rect, arrayRadius, Path.Direction.CW);
|
||||
canvas.clipPath(path, Region.Op.REPLACE);
|
||||
canvas.clipPath(path);
|
||||
|
||||
super.dispatchDraw(canvas);
|
||||
|
||||
canvas.restoreToCount(count);
|
||||
}
|
||||
}
|
|
@ -6,6 +6,9 @@ import android.os.Bundle;
|
|||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.BottomSheetDialog;
|
||||
import android.support.design.widget.BottomSheetDialogFragment;
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil;
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.ui.activities.base.AbsThemeActivity;
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||
|
@ -16,24 +19,31 @@ import code.name.monkey.retromusic.util.PreferenceUtil;
|
|||
@SuppressLint("RestrictedApi")
|
||||
public class RoundedBottomSheetDialogFragment extends BottomSheetDialogFragment {
|
||||
|
||||
@Override
|
||||
public int getTheme() {
|
||||
//noinspection ConstantConditions
|
||||
return
|
||||
PreferenceUtil.getInstance(getContext()).getGeneralTheme() == R.style.Theme_RetroMusic_Light
|
||||
? R.style.BottomSheetDialogTheme : R.style.BottomSheetDialogThemeDark;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
AbsThemeActivity absThemeActivity = (AbsThemeActivity) getActivity();
|
||||
if (absThemeActivity != null) {
|
||||
absThemeActivity.setLightNavigationBar(true);
|
||||
Dialog dialog = new BottomSheetDialog(getContext(), getTheme());
|
||||
|
||||
@Override
|
||||
public int getTheme() {
|
||||
//noinspection ConstantConditions
|
||||
if (PreferenceUtil.getInstance(getContext()).getGeneralTheme() == R.style.Theme_RetroMusic_Light) {
|
||||
return R.style.BottomSheetDialogTheme;
|
||||
} else if (PreferenceUtil.getInstance(getContext()).getGeneralTheme() == R.style.Theme_RetroMusic_Color) {
|
||||
int color = ThemeStore.primaryColor(getContext());
|
||||
if (ColorUtil.isColorLight(color)) {
|
||||
return R.style.BottomSheetDialogTheme;
|
||||
} else {
|
||||
return R.style.BottomSheetDialogThemeDark;
|
||||
}
|
||||
} else {
|
||||
return R.style.BottomSheetDialogTheme;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
AbsThemeActivity absThemeActivity = (AbsThemeActivity) getActivity();
|
||||
if (absThemeActivity != null) {
|
||||
absThemeActivity.setLightNavigationBar(true);
|
||||
}
|
||||
//noinspection ConstantConditions
|
||||
return new BottomSheetDialog(getContext(), getTheme());
|
||||
}
|
||||
//noinspection ConstantConditions
|
||||
return new BottomSheetDialog(getContext(), getTheme());
|
||||
}
|
||||
}
|
|
@ -29,7 +29,7 @@ public class SansFontCollapsingToolbarLayout extends CollapsingToolbarLayout {
|
|||
}
|
||||
|
||||
private void init(Context context) {
|
||||
Typeface typefaceBold = TypefaceHelper.get(context, getResources().getString(R.string.sans_bold));
|
||||
Typeface typefaceBold = TypefaceHelper.get(context, getResources().getString(R.string.circular_std_black));
|
||||
setExpandedTitleTypeface(typefaceBold);
|
||||
setCollapsedTitleTypeface(typefaceBold);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue