mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-17 23:42:55 +00:00
fix bad workaround for suggestion strip word background
This commit is contained in:
parent
d9d1204647
commit
a757b00922
2 changed files with 4 additions and 13 deletions
|
@ -131,6 +131,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
public SuggestionStripView(final Context context, final AttributeSet attrs,
|
||||
final int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
final Colors colors = Settings.getInstance().getCurrent().mColors;
|
||||
|
||||
final LayoutInflater inflater = LayoutInflater.from(context);
|
||||
inflater.inflate(R.layout.suggestions_strip, this);
|
||||
|
@ -146,6 +147,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
word.setContentDescription(getResources().getString(R.string.spoken_empty_suggestion));
|
||||
word.setOnClickListener(this);
|
||||
word.setOnLongClickListener(this);
|
||||
colors.setBackgroundColor(word.getBackground(), Colors.TYPE_BACKGROUND);
|
||||
mWordViews.add(word);
|
||||
final View divider = inflater.inflate(R.layout.suggestion_divider, null);
|
||||
mDividerViews.add(divider);
|
||||
|
@ -183,16 +185,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
|
||||
mOtherKey.setImageDrawable(iconIncognito);
|
||||
|
||||
final Colors colors = Settings.getInstance().getCurrent().mColors;
|
||||
// this only works when backgrounds of SuggestionStripView.LXX_Base and SuggestionWord.LXX_Base
|
||||
// are set to keyboard_background_lxx_base (just white drawable), but NOT when set to
|
||||
// btn_suggestion_lxx_base (state drawable with selector) or keyboard_suggest_strip_lxx_base_border (layer-list)
|
||||
// why is this? then it's necessary to set tint list for voice/clipboard/other keys and all word views separately
|
||||
// it seems to work in other places, e.g. for btn_keyboard_spacebar_lxx_base... though maybe that's the weirdly nested layer list?
|
||||
// todo (later): when fixing this, revert changes in themes-lxx-base[-border] (in todo)
|
||||
// this would allow having a different background shape in pressed state
|
||||
colors.setBackgroundColor(getBackground(), Colors.TYPE_BACKGROUND);
|
||||
|
||||
mClipboardKey.setColorFilter(colors.keyText);
|
||||
mVoiceKey.setColorFilter(colors.keyText);
|
||||
mOtherKey.setColorFilter(colors.keyText);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue