Fix color of the three dots in suggestion strip (#78)

This commit is contained in:
BlackyHawky 2023-08-13 22:17:43 +02:00 committed by GitHub
parent 0940ac0f15
commit 84040a2593
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -147,8 +147,7 @@ final class SuggestionStripLayoutHelper {
a.recycle(); a.recycle();
mMoreSuggestionsHint = getMoreSuggestionsHint(res, mMoreSuggestionsHint = getMoreSuggestionsHint(res,
res.getDimension(R.dimen.config_more_suggestions_hint_text_size), res.getDimension(R.dimen.config_more_suggestions_hint_text_size));
mColorAutoCorrect);
mCenterPositionInStrip = mSuggestionsCountInStrip / 2; mCenterPositionInStrip = mSuggestionsCountInStrip / 2;
// Assuming there are at least three suggestions. Also, note that the suggestions are // Assuming there are at least three suggestions. Also, note that the suggestions are
// laid out according to script direction, so this is left of the center for LTR scripts // laid out according to script direction, so this is left of the center for LTR scripts
@ -178,13 +177,14 @@ final class SuggestionStripLayoutHelper {
/ mMoreSuggestionsRowHeight; / mMoreSuggestionsRowHeight;
} }
private static Drawable getMoreSuggestionsHint(final Resources res, final float textSize, private static Drawable getMoreSuggestionsHint(final Resources res, final float textSize) {
final int color) {
final Paint paint = new Paint(); final Paint paint = new Paint();
paint.setAntiAlias(true); paint.setAntiAlias(true);
paint.setTextAlign(Align.CENTER); paint.setTextAlign(Align.CENTER);
paint.setTextSize(textSize); paint.setTextSize(textSize);
paint.setColor(color); final Colors colors = Settings.getInstance().getCurrent().mColors;
if (colors.isCustom)
paint.setColor(colors.keyText);
final Rect bounds = new Rect(); final Rect bounds = new Rect();
paint.getTextBounds(MORE_SUGGESTIONS_HINT, 0, MORE_SUGGESTIONS_HINT.length(), bounds); paint.getTextBounds(MORE_SUGGESTIONS_HINT, 0, MORE_SUGGESTIONS_HINT.length(), bounds);
final int width = Math.round(bounds.width() + 0.5f); final int width = Math.round(bounds.width() + 0.5f);