From fda70c96b814218a34923ee7692ab789807f109e Mon Sep 17 00:00:00 2001 From: Mohit Mali Date: Tue, 22 Dec 2020 17:17:05 +0530 Subject: [PATCH 01/22] Available icon changes and Implement selection color of bottom navigation_items,album,albumset,colors --- res/drawable/bottom_nav_color.xml | 5 +++++ res/menu/album.xml | 6 +++--- res/menu/albumset.xml | 4 ++-- res/menu/navigation_items.xml | 21 ++++++++++++--------- res/values/colors.xml | 2 ++ 5 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 res/drawable/bottom_nav_color.xml diff --git a/res/drawable/bottom_nav_color.xml b/res/drawable/bottom_nav_color.xml new file mode 100644 index 000000000..b277457c5 --- /dev/null +++ b/res/drawable/bottom_nav_color.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/res/menu/album.xml b/res/menu/album.xml index 4b76b6981..c68ed20c0 100644 --- a/res/menu/album.xml +++ b/res/menu/album.xml @@ -15,15 +15,15 @@ --> diff --git a/res/menu/albumset.xml b/res/menu/albumset.xml index b21bf3d38..0b91e27a4 100644 --- a/res/menu/albumset.xml +++ b/res/menu/albumset.xml @@ -18,11 +18,11 @@ --> - - - + + + diff --git a/res/values/colors.xml b/res/values/colors.xml index b00001ace..feed343ca 100755 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -16,6 +16,8 @@ @lineageos.platform:color/color_default_primary_text + @lineageos.platform:color/color_default_blue1 + @lineageos.platform:color/color_default_primary @color/default_background -- GitLab From 34316f5d1c0df5bcdfec32fe9a304fd96fade67c Mon Sep 17 00:00:00 2001 From: Mohit Mali Date: Wed, 23 Dec 2020 12:57:13 +0530 Subject: [PATCH 02/22] Change icon tint and selected item color in bottom navigation bar --- res/color/bottom_nav_color.xml | 5 +++++ res/drawable/bottom_nav_color.xml | 5 ----- res/layout/gallery_main.xml | 4 ++-- res/menu/album.xml | 12 ++++++++---- res/menu/albumset.xml | 10 +++++++--- res/values/colors.xml | 4 ++-- 6 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 res/color/bottom_nav_color.xml delete mode 100644 res/drawable/bottom_nav_color.xml diff --git a/res/color/bottom_nav_color.xml b/res/color/bottom_nav_color.xml new file mode 100644 index 000000000..f6aec0b9a --- /dev/null +++ b/res/color/bottom_nav_color.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/res/drawable/bottom_nav_color.xml b/res/drawable/bottom_nav_color.xml deleted file mode 100644 index b277457c5..000000000 --- a/res/drawable/bottom_nav_color.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/res/layout/gallery_main.xml b/res/layout/gallery_main.xml index 3a5e54447..7411fe9ca 100755 --- a/res/layout/gallery_main.xml +++ b/res/layout/gallery_main.xml @@ -65,8 +65,8 @@ android:layout_alignParentBottom="true" app:menu="@menu/navigation_items" app:itemBackground="@color/primary" - app:itemIconTint="@drawable/item_bg" - app:itemTextColor="@drawable/item_bg" /> + app:itemIconTint="@color/bottom_nav_color" + app:itemTextColor="@color/bottom_nav_color" /> diff --git a/res/menu/album.xml b/res/menu/album.xml index c68ed20c0..10ae9085e 100644 --- a/res/menu/album.xml +++ b/res/menu/album.xml @@ -13,19 +13,23 @@ See the License for the specific language governing permissions and limitations under the License. --> - + + android:showAsAction="ifRoom" + app:iconTint="@color/color_default_primary"/> + android:showAsAction="ifRoom" + app:iconTint="@color/color_default_primary"/> + android:showAsAction="ifRoom" + app:iconTint="@color/color_default_primary"/> diff --git a/res/menu/albumset.xml b/res/menu/albumset.xml index 0b91e27a4..2db11eab5 100644 --- a/res/menu/albumset.xml +++ b/res/menu/albumset.xml @@ -16,15 +16,19 @@ See the License for the specific language governing permissions and limitations under the License. --> - + + android:showAsAction="ifRoom" + app:iconTint="@color/color_default_primary"/> + android:showAsAction="ifRoom" + app:iconTint="@color/color_default_primary"/> + @color/white @color/default_background - @lineageos.platform:color/color_default_gray2 - @lineageos.platform:color/color_default_primary + @lineageos.platform:color/color_default_primary + @lineageos.platform:color/color_default_blue1 -- GitLab From 41e67864bf227840c8fd1b339e8b0331131d8da0 Mon Sep 17 00:00:00 2001 From: Mohit Mali Date: Wed, 23 Dec 2020 17:12:38 +0530 Subject: [PATCH 03/22] Change image shape to rounded corner. --- .../filtershow/imageshow/ImageCrop.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java b/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java index baabbadb9..b9f6a545f 100644 --- a/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java +++ b/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java @@ -22,6 +22,9 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.util.AttributeSet; @@ -324,7 +327,7 @@ public class ImageCrop extends ImageShow { mPaint.reset(); mPaint.setAntiAlias(true); mPaint.setFilterBitmap(true); - canvas.drawBitmap(bitmap, mDisplayMatrix, mPaint); + canvas.drawBitmap(getRoundedCornerBitmap(bitmap,8), mDisplayMatrix, mPaint); mCropObj.getInnerBounds(mScreenCropBounds); RectF outer = mCropObj.getOuterBounds(); FilterCropRepresentation.findNormalizedCrop(mScreenCropBounds, (int) outer.width(), @@ -338,6 +341,28 @@ public class ImageCrop extends ImageShow { CropDrawingUtils.drawRuleOfThird(canvas, mScreenCropBounds, getContext()); } + public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int pixels) { + Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap + .getHeight(), Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(output); + + final int color = 0xff424242; + final Paint paint = new Paint(); + final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); + final RectF rectF = new RectF(rect); + final float roundPx = pixels; + + paint.setAntiAlias(true); + canvas.drawARGB(0, 0, 0, 0); + paint.setColor(color); + canvas.drawRoundRect(rectF, roundPx, roundPx, paint); + + paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); + canvas.drawBitmap(bitmap, rect, rect, paint); + + return output; + } + private void updateMatrix(int w, int h) { Bitmap bitmap = MasterImage.getImage().getFiltersOnlyImage(); if (bitmap == null) { -- GitLab From 775002c41ea1c6881d29402c864e6a9794f917e6 Mon Sep 17 00:00:00 2001 From: Mohit Mali Date: Thu, 24 Dec 2020 09:59:12 +0530 Subject: [PATCH 04/22] Change image shape to rounded corner and applying theme change in toolbar --- res/drawable/bg_gallery_image.xml | 7 ++++++ res/layout/photo_set_item.xml | 1 + res/values/styles.xml | 4 +++- .../filtershow/imageshow/ImageCrop.java | 24 +------------------ 4 files changed, 12 insertions(+), 24 deletions(-) create mode 100644 res/drawable/bg_gallery_image.xml diff --git a/res/drawable/bg_gallery_image.xml b/res/drawable/bg_gallery_image.xml new file mode 100644 index 000000000..5ffa21624 --- /dev/null +++ b/res/drawable/bg_gallery_image.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/res/layout/photo_set_item.xml b/res/layout/photo_set_item.xml index 0f740fad9..ccf781e57 100644 --- a/res/layout/photo_set_item.xml +++ b/res/layout/photo_set_item.xml @@ -9,6 +9,7 @@ \ No newline at end of file diff --git a/res/values/styles.xml b/res/values/styles.xml index 673bdb9f7..8cfff0e60 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -347,7 +347,9 @@ @dimen/toolbar_title_text_size - @@ -348,7 +349,7 @@ -- GitLab From 20574e9722f17b6a18c0723d3f304821a1c33540 Mon Sep 17 00:00:00 2001 From: Mohit Mali Date: Mon, 28 Dec 2020 15:45:39 +0530 Subject: [PATCH 06/22] Change menu icon color in gallery --- src/com/android/gallery3d/app/TimeLinePage.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/gallery3d/app/TimeLinePage.java b/src/com/android/gallery3d/app/TimeLinePage.java index 17224374b..a75e20544 100755 --- a/src/com/android/gallery3d/app/TimeLinePage.java +++ b/src/com/android/gallery3d/app/TimeLinePage.java @@ -22,6 +22,7 @@ package com.android.gallery3d.app; import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.content.res.ColorStateList; import android.content.res.Configuration; import android.graphics.Color; import android.graphics.Rect; @@ -585,6 +586,9 @@ public class TimeLinePage extends ActivityState implements DataManager.INCLUDE_IMAGE); actionBar.setTitle(GalleryUtils.getSelectionModePrompt(typeBits)); } else { + menu.findItem(R.id.action_camera).setIconTintList(ColorStateList.valueOf(R.color.white)); + menu.findItem(R.id.action_slideshow).setIconTintList(ColorStateList.valueOf(R.color.white)); + menu.findItem(R.id.action_select).setIconTintList(ColorStateList.valueOf(R.color.white)); inflator.inflate(R.menu.album, menu); actionBar.setTitle(R.string.timeline_title); -- GitLab From 909756efd535f0a07d5079bfadaa504c259a2171 Mon Sep 17 00:00:00 2001 From: Mohit Mali Date: Tue, 29 Dec 2020 10:31:54 +0530 Subject: [PATCH 07/22] Change menu icon color adding style to toolbar --- res/layout/toolbar.xml | 1 + res/values/styles.xml | 10 ++++++---- src/com/android/gallery3d/app/TimeLinePage.java | 3 --- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/res/layout/toolbar.xml b/res/layout/toolbar.xml index 00270e3a1..5ad56aae1 100755 --- a/res/layout/toolbar.xml +++ b/res/layout/toolbar.xml @@ -39,6 +39,7 @@ android:layout_height="?android:attr/actionBarSize" android:background="@color/primary" android:elevation="8dp" + android:theme="@style/MytoolbarStyle" android:titleTextAppearance="@style/ToolbarTitleStyle" android:popupTheme="@style/ToolbarPopUpTheme" /> diff --git a/res/values/styles.xml b/res/values/styles.xml index cb5e4ccba..e846a7779 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -339,18 +339,20 @@ + + - +