mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-02 12:52:15 +00:00
different way of implementing larger toolbar key
see GH-1556, fixes GH-1621
This commit is contained in:
parent
82bea7facf
commit
0e86978df3
3 changed files with 17 additions and 8 deletions
|
@ -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);
|
||||
|
|
14
app/src/main/res/drawable/toolbar_expand_key_background.xml
Normal file
14
app/src/main/res/drawable/toolbar_expand_key_background.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<!--
|
||||
SPDX-License-Identifier: GPL-3.0-only
|
||||
not a shape because that fills all the way to the edge
|
||||
width and height are irrelevant for background
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.8"
|
||||
android:viewportHeight="24.8">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M12.4,12.4m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"/>
|
||||
</vector>
|
|
@ -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" />
|
||||
<HorizontalScrollView
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue