From 0e86978df3ae2a4378a2fb384038803e264ffa67 Mon Sep 17 00:00:00 2001 From: Helium314 Date: Sat, 31 May 2025 09:35:33 +0200 Subject: [PATCH] different way of implementing larger toolbar key see GH-1556, fixes GH-1621 --- .../latin/suggestions/SuggestionStripView.java | 6 +----- .../res/drawable/toolbar_expand_key_background.xml | 14 ++++++++++++++ app/src/main/res/layout/suggestions_strip.xml | 5 ++--- 3 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 app/src/main/res/drawable/toolbar_expand_key_background.xml diff --git a/app/src/main/java/helium314/keyboard/latin/suggestions/SuggestionStripView.java b/app/src/main/java/helium314/keyboard/latin/suggestions/SuggestionStripView.java index 17a6eca71..9a8e49f36 100644 --- a/app/src/main/java/helium314/keyboard/latin/suggestions/SuggestionStripView.java +++ b/app/src/main/java/helium314/keyboard/latin/suggestions/SuggestionStripView.java @@ -14,12 +14,9 @@ import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources; import android.graphics.Color; -import android.graphics.PorterDuff; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; -import android.graphics.drawable.ShapeDrawable; -import android.graphics.drawable.shapes.OvalShape; import android.os.Build; import android.text.TextUtils; import android.util.AttributeSet; @@ -214,8 +211,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick mToolbarExpandKey.setOnClickListener(this); mToolbarExpandKey.setImageDrawable(Settings.getValues().mIncognitoModeEnabled ? mIncognitoIcon : mToolbarArrowIcon); colors.setColor(mToolbarExpandKey, ColorType.TOOL_BAR_EXPAND_KEY); - mToolbarExpandKey.setBackground(new ShapeDrawable(new OvalShape())); // ShapeDrawable color is black, need src_atop filter - mToolbarExpandKey.getBackground().setColorFilter(colors.get(ColorType.TOOL_BAR_EXPAND_KEY_BACKGROUND), PorterDuff.Mode.SRC_ATOP); + colors.setColor(mToolbarExpandKey.getBackground(), ColorType.TOOL_BAR_EXPAND_KEY_BACKGROUND); for (final ToolbarKey pinnedKey : ToolbarUtilsKt.getPinnedToolbarKeys(prefs)) { final ImageButton button = createToolbarKey(context, iconsSet, pinnedKey); diff --git a/app/src/main/res/drawable/toolbar_expand_key_background.xml b/app/src/main/res/drawable/toolbar_expand_key_background.xml new file mode 100644 index 000000000..105d1a42a --- /dev/null +++ b/app/src/main/res/drawable/toolbar_expand_key_background.xml @@ -0,0 +1,14 @@ + + + + diff --git a/app/src/main/res/layout/suggestions_strip.xml b/app/src/main/res/layout/suggestions_strip.xml index 0995072aa..123b211e9 100644 --- a/app/src/main/res/layout/suggestions_strip.xml +++ b/app/src/main/res/layout/suggestions_strip.xml @@ -23,9 +23,8 @@ android:layout_height="@dimen/config_suggestions_strip_edge_key_width" android:layout_gravity="center_vertical" android:layout_weight="0" - android:layout_marginStart="4dp" - android:scaleType="centerCrop" - android:padding="2dp" + android:layout_marginStart="1dp" + android:background="@drawable/toolbar_expand_key_background" style="?attr/suggestionWordStyle" android:contentDescription="@string/more_keys_strip_description" />