diff --git a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/base/AbsFabActivity.java b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/base/AbsFabActivity.java index 1c4cfa41..5a67824a 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/base/AbsFabActivity.java +++ b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/base/AbsFabActivity.java @@ -17,8 +17,8 @@ import com.kabouzeid.gramophone.dialogs.ColorChooserDialog; import com.kabouzeid.gramophone.helper.MusicPlayerRemote; import com.kabouzeid.gramophone.misc.SmallOnGestureListener; import com.kabouzeid.gramophone.model.MusicRemoteEvent; -import com.kabouzeid.gramophone.ui.widget.PlayPauseDrawable; import com.kabouzeid.gramophone.util.NavigationUtil; +import com.kabouzeid.gramophone.views.PlayPauseDrawable; import com.melnykov.fab.FloatingActionButton; import com.squareup.otto.Subscribe; diff --git a/app/src/main/java/com/kabouzeid/gramophone/views/CircleView.java b/app/src/main/java/com/kabouzeid/gramophone/views/CircleView.java index 4b800038..cb57978d 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/views/CircleView.java +++ b/app/src/main/java/com/kabouzeid/gramophone/views/CircleView.java @@ -15,38 +15,38 @@ import android.widget.FrameLayout; import com.kabouzeid.gramophone.R; public class CircleView extends FrameLayout { - + private final Bitmap mCheck; private final Paint paint; private final Paint paintBorder; private Paint paintCheck; private final int borderWidth; - + public CircleView(Context context) { this(context, null, 0); } - + public CircleView(Context context, AttributeSet attrs) { this(context, attrs, 0); } - + public CircleView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); final int checkSize = (int) context.getResources().getDimension(R.dimen.circle_view_check); mCheck = getResizedBitmap(BitmapFactory.decodeResource(context.getResources(), - R.drawable.ic_check), checkSize, checkSize); + R.drawable.ic_check_white_24dp), checkSize, checkSize); borderWidth = (int) getResources().getDimension(R.dimen.circle_view_border); - + paint = new Paint(); paint.setAntiAlias(true); - + paintBorder = new Paint(); paintBorder.setAntiAlias(true); paintBorder.setColor(Color.BLACK); - + setWillNotDraw(false); } - + private static Bitmap getResizedBitmap(Bitmap bm, int newHeight, int newWidth) { int width = bm.getWidth(); int height = bm.getHeight(); @@ -55,29 +55,32 @@ public class CircleView extends FrameLayout { Matrix matrix = new Matrix(); matrix.postScale(scaleWidth, scaleHeight); Bitmap resizedBitmap = Bitmap.createBitmap(bm, 0, 0, width, height, matrix, false); - bm.recycle(); + if (bm != resizedBitmap) { + bm.recycle(); + } return resizedBitmap; } - + @Override public void setBackgroundColor(int color) { paint.setColor(color); requestLayout(); invalidate(); } - + public void setBorderColor(int color) { paintBorder.setColor(color); requestLayout(); invalidate(); } - + @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int widthMode = MeasureSpec.getMode(widthMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec); if (widthMode == MeasureSpec.EXACTLY && heightMode != MeasureSpec.EXACTLY) { int width = MeasureSpec.getSize(widthMeasureSpec); + //noinspection SuspiciousNameCombination int height = width; if (heightMode == MeasureSpec.AT_MOST) { height = Math.min(height, MeasureSpec.getSize(heightMeasureSpec)); @@ -87,25 +90,28 @@ public class CircleView extends FrameLayout { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } - + + @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); - + int canvasSize = canvas.getWidth(); if (canvas.getHeight() < canvasSize) canvasSize = canvas.getHeight(); - + int circleCenter = (canvasSize - (borderWidth * 2)) / 2; canvas.drawCircle(circleCenter + borderWidth, circleCenter + borderWidth, ((canvasSize - (borderWidth * 2)) / 2) + borderWidth - 4.0f, paintBorder); canvas.drawCircle(circleCenter + borderWidth, circleCenter + borderWidth, ((canvasSize - (borderWidth * 2)) / 2) - 4.0f, paint); - + if (isActivated()) { final int offset = (canvasSize / 2) - (mCheck.getWidth() / 2); - if (paint.getColor() == Color.WHITE && paintCheck == null) { - paintCheck = new Paint(); - paintCheck.setAntiAlias(true); - paintCheck.setColorFilter(new PorterDuffColorFilter(Color.BLACK, PorterDuff.Mode.SRC_IN)); + if (paint.getColor() == Color.WHITE) { + if (paintCheck == null) { + paintCheck = new Paint(); + paintCheck.setAntiAlias(true); + paintCheck.setColorFilter(new PorterDuffColorFilter(Color.BLACK, PorterDuff.Mode.SRC_IN)); + } } else { paintCheck = null; } diff --git a/app/src/main/java/com/kabouzeid/gramophone/ui/widget/PlayPauseDrawable.java b/app/src/main/java/com/kabouzeid/gramophone/views/PlayPauseDrawable.java similarity index 99% rename from app/src/main/java/com/kabouzeid/gramophone/ui/widget/PlayPauseDrawable.java rename to app/src/main/java/com/kabouzeid/gramophone/views/PlayPauseDrawable.java index 4c305b1b..ca507e4c 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/ui/widget/PlayPauseDrawable.java +++ b/app/src/main/java/com/kabouzeid/gramophone/views/PlayPauseDrawable.java @@ -1,4 +1,4 @@ -package com.kabouzeid.gramophone.ui.widget; +package com.kabouzeid.gramophone.views; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; diff --git a/app/src/main/java/com/kabouzeid/gramophone/ui/widget/SquareImageView.java b/app/src/main/java/com/kabouzeid/gramophone/views/SquareImageView.java similarity index 94% rename from app/src/main/java/com/kabouzeid/gramophone/ui/widget/SquareImageView.java rename to app/src/main/java/com/kabouzeid/gramophone/views/SquareImageView.java index 88f2b896..816cb3ef 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/ui/widget/SquareImageView.java +++ b/app/src/main/java/com/kabouzeid/gramophone/views/SquareImageView.java @@ -1,4 +1,4 @@ -package com.kabouzeid.gramophone.ui.widget; +package com.kabouzeid.gramophone.views; import android.content.Context; import android.util.AttributeSet; diff --git a/app/src/main/res/drawable-hdpi/ic_check.png b/app/src/main/res/drawable-hdpi/ic_check.png deleted file mode 100755 index e8ff6cbc..00000000 Binary files a/app/src/main/res/drawable-hdpi/ic_check.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_check_white_24dp.png b/app/src/main/res/drawable-hdpi/ic_check_white_24dp.png new file mode 100644 index 00000000..c26640d3 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_check_white_24dp.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_check.png b/app/src/main/res/drawable-mdpi/ic_check.png deleted file mode 100755 index b609b9c7..00000000 Binary files a/app/src/main/res/drawable-mdpi/ic_check.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_check_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_check_white_24dp.png new file mode 100644 index 00000000..ba9cf063 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_check_white_24dp.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_check.png b/app/src/main/res/drawable-xhdpi/ic_check.png deleted file mode 100755 index bd66325c..00000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_check.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_check_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_check_white_24dp.png new file mode 100644 index 00000000..1f4846cb Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_check_white_24dp.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_check.png b/app/src/main/res/drawable-xxhdpi/ic_check.png deleted file mode 100755 index b40210f1..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_check.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_check_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_check_white_24dp.png new file mode 100644 index 00000000..a263412a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_check_white_24dp.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_check_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_check_white_24dp.png new file mode 100644 index 00000000..bf5bc7e0 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_check_white_24dp.png differ diff --git a/app/src/main/res/layout/activity_album_tag_editor.xml b/app/src/main/res/layout/activity_album_tag_editor.xml index 610d3f88..6947a576 100644 --- a/app/src/main/res/layout/activity_album_tag_editor.xml +++ b/app/src/main/res/layout/activity_album_tag_editor.xml @@ -15,7 +15,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - -