remove some unused colors and attrs

This commit is contained in:
Helium314 2023-12-19 09:40:38 +01:00
parent 0c231b18ed
commit a70c927d75
13 changed files with 23 additions and 76 deletions

View file

@ -29,9 +29,7 @@ import org.dslul.openboard.inputmethod.latin.settings.Settings;
* derived from it.
*
* @attr ref R.styleable#KeyboardView_gestureFloatingPreviewTextSize
* @attr ref R.styleable#KeyboardView_gestureFloatingPreviewTextColor
* @attr ref R.styleable#KeyboardView_gestureFloatingPreviewTextOffset
* @attr ref R.styleable#KeyboardView_gestureFloatingPreviewColor
* @attr ref R.styleable#KeyboardView_gestureFloatingPreviewHorizontalPadding
* @attr ref R.styleable#KeyboardView_gestureFloatingPreviewVerticalPadding
* @attr ref R.styleable#KeyboardView_gestureFloatingPreviewRoundRadius
@ -56,10 +54,10 @@ public class GestureFloatingTextDrawingPreview extends AbstractDrawingPreview {
final Colors colors = Settings.getInstance().getCurrent().mColors;
mGesturePreviewTextSize = mainKeyboardViewAttr.getDimensionPixelSize(
R.styleable.MainKeyboardView_gestureFloatingPreviewTextSize, 0);
mGesturePreviewTextColor = colors.get(ColorType.KEY_TEXT); //mainKeyboardViewAttr.getColor(R.styleable.MainKeyboardView_gestureFloatingPreviewTextColor, 0);
mGesturePreviewTextColor = colors.get(ColorType.KEY_TEXT);
mGesturePreviewTextOffset = mainKeyboardViewAttr.getDimensionPixelOffset(
R.styleable.MainKeyboardView_gestureFloatingPreviewTextOffset, 0);
mGesturePreviewColor = colors.get(ColorType.GESTURE_PREVIEW); //mainKeyboardViewAttr.getColor(R.styleable.MainKeyboardView_gestureFloatingPreviewColor, 0);
mGesturePreviewColor = colors.get(ColorType.GESTURE_PREVIEW);
mGesturePreviewHorizontalPadding = mainKeyboardViewAttr.getDimension(
R.styleable.MainKeyboardView_gestureFloatingPreviewHorizontalPadding, 0.0f);
mGesturePreviewVerticalPadding = mainKeyboardViewAttr.getDimension(

View file

@ -22,7 +22,6 @@ import org.dslul.openboard.inputmethod.latin.settings.Settings;
* @attr ref R.styleable#MainKeyboardView_gestureTrailFadeoutStartDelay
* @attr ref R.styleable#MainKeyboardView_gestureTrailFadeoutDuration
* @attr ref R.styleable#MainKeyboardView_gestureTrailUpdateInterval
* @attr ref R.styleable#MainKeyboardView_gestureTrailColor
* @attr ref R.styleable#MainKeyboardView_gestureTrailWidth
*/
final class GestureTrailDrawingParams {
@ -42,7 +41,7 @@ final class GestureTrailDrawingParams {
public final int mTrailLingerDuration;
public GestureTrailDrawingParams(final TypedArray mainKeyboardViewAttr) {
mTrailColor = Settings.getInstance().getCurrent().mColors.get(ColorType.GESTURE_TRAIL); //mainKeyboardViewAttr.getColor(R.styleable.MainKeyboardView_gestureTrailColor, 0);
mTrailColor = Settings.getInstance().getCurrent().mColors.get(ColorType.GESTURE_TRAIL);
mTrailStartWidth = mainKeyboardViewAttr.getDimension(
R.styleable.MainKeyboardView_gestureTrailStartWidth, 0.0f);
mTrailEndWidth = mainKeyboardViewAttr.getDimension(

View file

@ -56,15 +56,15 @@ public final class KeyVisualAttributes {
R.styleable.Keyboard_Key_keyShiftedLetterHintRatio,
R.styleable.Keyboard_Key_keyHintLabelRatio,
R.styleable.Keyboard_Key_keyPreviewTextRatio,
R.styleable.Keyboard_Key_keyTextColor,
R.styleable.Keyboard_Key_keyTextColor, // todo: is this used anywhere
R.styleable.Keyboard_Key_keyTextInactivatedColor,
R.styleable.Keyboard_Key_keyTextShadowColor,
R.styleable.Keyboard_Key_functionalTextColor,
R.styleable.Keyboard_Key_keyHintLetterColor,
R.styleable.Keyboard_Key_keyHintLabelColor,
R.styleable.Keyboard_Key_functionalTextColor, // todo: is this used anywhere
R.styleable.Keyboard_Key_keyHintLetterColor, // todo: is this used anywhere
R.styleable.Keyboard_Key_keyHintLabelColor, // todo: is this used anywhere
R.styleable.Keyboard_Key_keyShiftedLetterHintInactivatedColor,
R.styleable.Keyboard_Key_keyShiftedLetterHintActivatedColor,
R.styleable.Keyboard_Key_keyPreviewTextColor,
R.styleable.Keyboard_Key_keyPreviewTextColor, // todo: is this used anywhere
R.styleable.Keyboard_Key_keyHintLabelVerticalAdjustment,
R.styleable.Keyboard_Key_keyLabelOffCenterRatio,
R.styleable.Keyboard_Key_keyHintLabelOffCenterRatio
@ -119,19 +119,17 @@ public final class KeyVisualAttributes {
R.styleable.Keyboard_Key_keyPreviewTextRatio);
final Colors colors = Settings.getInstance().getCurrent().mColors;
mTextColor = colors.get(ColorType.KEY_TEXT); //keyAttr.getColor(R.styleable.Keyboard_Key_keyTextColor, 0);
mTextColor = colors.get(ColorType.KEY_TEXT);
mTextInactivatedColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyTextInactivatedColor, 0);
mTextShadowColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyTextShadowColor, 0);
// todo: maybe a separate color?
mFunctionalTextColor = colors.get(ColorType.KEY_TEXT); //keyAttr.getColor(R.styleable.Keyboard_Key_functionalTextColor, 0);
mHintLetterColor = colors.get(ColorType.KEY_HINT_TEXT); //keyAttr.getColor(R.styleable.Keyboard_Key_keyHintLetterColor, 0);
mHintLabelColor = colors.get(ColorType.KEY_TEXT); //keyAttr.getColor(R.styleable.Keyboard_Key_keyHintLabelColor, 0);
mFunctionalTextColor = colors.get(ColorType.FUNCTIONAL_KEY_TEXT);
mHintLetterColor = colors.get(ColorType.KEY_HINT_TEXT);
mHintLabelColor = colors.get(ColorType.KEY_TEXT);
mShiftedLetterHintInactivatedColor = keyAttr.getColor(
R.styleable.Keyboard_Key_keyShiftedLetterHintInactivatedColor, 0);
mShiftedLetterHintActivatedColor = keyAttr.getColor(
R.styleable.Keyboard_Key_keyShiftedLetterHintActivatedColor, 0);
// todo: maybe a separate color?
mPreviewTextColor = colors.get(ColorType.KEY_TEXT); //keyAttr.getColor(R.styleable.Keyboard_Key_keyPreviewTextColor, 0);
mPreviewTextColor = colors.get(ColorType.KEY_TEXT);
mHintLabelVerticalAdjustment = ResourceUtils.getFraction(keyAttr,
R.styleable.Keyboard_Key_keyHintLabelVerticalAdjustment, 0.0f);

View file

@ -22,7 +22,6 @@ import org.dslul.openboard.inputmethod.latin.settings.Settings;
/**
* Draw rubber band preview graphics during sliding key input.
*
* @attr ref R.styleable#MainKeyboardView_slidingKeyInputPreviewColor
* @attr ref R.styleable#MainKeyboardView_slidingKeyInputPreviewWidth
* @attr ref R.styleable#MainKeyboardView_slidingKeyInputPreviewBodyRatio
* @attr ref R.styleable#MainKeyboardView_slidingKeyInputPreviewShadowRatio
@ -39,7 +38,7 @@ public final class SlidingKeyInputDrawingPreview extends AbstractDrawingPreview
private final Paint mPaint = new Paint();
public SlidingKeyInputDrawingPreview(final TypedArray mainKeyboardViewAttr) {
final int previewColor = Settings.getInstance().getCurrent().mColors.get(ColorType.GESTURE_TRAIL); //mainKeyboardViewAttr.getColor(R.styleable.MainKeyboardView_slidingKeyInputPreviewColor, 0);
final int previewColor = Settings.getInstance().getCurrent().mColors.get(ColorType.GESTURE_TRAIL);
final float previewRadius = mainKeyboardViewAttr.getDimension(
R.styleable.MainKeyboardView_slidingKeyInputPreviewWidth, 0) / 2.0f;
final int PERCENTAGE_INT = 100;

View file

@ -248,7 +248,7 @@ class DynamicColors(context: Context, override val themeStyle: String, override
TOOL_BAR_EXPAND_KEY_BACKGROUND -> if (!isNight) accent else doubleAdjustedBackground
GESTURE_TRAIL -> gesture
KEY_TEXT, SUGGESTION_AUTO_CORRECT, REMOVE_SUGGESTION_ICON, CLEAR_CLIPBOARD_HISTORY_KEY,
KEY_ICON, ONE_HANDED_MODE_BUTTON, EMOJI_CATEGORY, TOOL_BAR_KEY -> keyText
KEY_ICON, ONE_HANDED_MODE_BUTTON, EMOJI_CATEGORY, TOOL_BAR_KEY, FUNCTIONAL_KEY_TEXT -> keyText
KEY_HINT_TEXT -> keyHintText
SPACE_BAR_TEXT -> spaceBarText
FUNCTIONAL_KEY_BACKGROUND -> functionalKey
@ -445,7 +445,7 @@ class DefaultColors (
EMOJI_CATEGORY_BACKGROUND, GESTURE_PREVIEW, MORE_KEYS_BACKGROUND, MORE_SUGGESTIONS_BACKGROUND, KEY_PREVIEW -> adjustedBackground
TOOL_BAR_EXPAND_KEY_BACKGROUND -> doubleAdjustedBackground
GESTURE_TRAIL -> gesture
KEY_TEXT, SUGGESTION_AUTO_CORRECT, REMOVE_SUGGESTION_ICON, CLEAR_CLIPBOARD_HISTORY_KEY,
KEY_TEXT, SUGGESTION_AUTO_CORRECT, REMOVE_SUGGESTION_ICON, CLEAR_CLIPBOARD_HISTORY_KEY, FUNCTIONAL_KEY_TEXT,
KEY_ICON, ONE_HANDED_MODE_BUTTON, EMOJI_CATEGORY, TOOL_BAR_KEY, TOOL_BAR_EXPAND_KEY -> keyText
KEY_HINT_TEXT -> keyHintText
SPACE_BAR_TEXT -> spaceBarText
@ -558,6 +558,7 @@ enum class ColorType {
EMOJI_CATEGORY,
EMOJI_CATEGORY_BACKGROUND,
EMOJI_CATEGORY_SELECTED,
FUNCTIONAL_KEY_TEXT,
FUNCTIONAL_KEY_BACKGROUND,
GESTURE_TRAIL,
GESTURE_PREVIEW,

View file

@ -196,8 +196,8 @@ public final class Constants {
public static final int CODE_CLOSING_SQUARE_BRACKET = ']';
public static final int CODE_CLOSING_CURLY_BRACKET = '}';
public static final int CODE_CLOSING_ANGLE_BRACKET = '>';
public static final int CODE_INVERTED_QUESTION_MARK = 0xBF; // ¿
public static final int CODE_INVERTED_EXCLAMATION_MARK = 0xA1; // ¡
public static final int CODE_INVERTED_QUESTION_MARK = '¿';
public static final int CODE_INVERTED_EXCLAMATION_MARK = '¡';
public static final int CODE_GRAVE_ACCENT = '`';
public static final int CODE_CIRCUMFLEX_ACCENT = '^';
public static final int CODE_TILDE = '~';

View file

@ -122,10 +122,10 @@ final class SuggestionStripLayoutHelper {
R.styleable.SuggestionStripView_alphaObsoleted, 1.0f);
final Colors colors = Settings.getInstance().getCurrent().mColors;
mColorValidTypedWord = colors.get(ColorType.SUGGESTION_VALID_WORD); //a.getColor(R.styleable.SuggestionStripView_colorValidTypedWord, 0);
mColorTypedWord = colors.get(ColorType.SUGGESTION_TYPED_WORD); //a.getColor(R.styleable.SuggestionStripView_colorTypedWord, 0);
mColorAutoCorrect = colors.get(ColorType.SUGGESTION_AUTO_CORRECT); //a.getColor(R.styleable.SuggestionStripView_colorAutoCorrect, 0);
mColorSuggested = colors.get(ColorType.SUGGESTED_WORD); //a.getColor(R.styleable.SuggestionStripView_colorSuggested, 0);
mColorValidTypedWord = colors.get(ColorType.SUGGESTION_VALID_WORD);
mColorTypedWord = colors.get(ColorType.SUGGESTION_TYPED_WORD);
mColorAutoCorrect = colors.get(ColorType.SUGGESTION_AUTO_CORRECT);
mColorSuggested = colors.get(ColorType.SUGGESTED_WORD);
final int colorMoreSuggestionsHint = colors.get(ColorType.MORE_SUGGESTIONS_HINT);
mSuggestionsCountInStrip = a.getInt(