diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripView.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripView.java index 2f2400de8..3d1112fcf 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripView.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripView.java @@ -66,6 +66,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick private final ViewGroup mSuggestionsStrip; private final ImageButton mVoiceKey; + private final ImageButton mPasteKey; private final ImageButton mOtherKey; MainKeyboardView mMainKeyboardView; @@ -126,6 +127,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick mSuggestionsStrip = findViewById(R.id.suggestions_strip); mVoiceKey = findViewById(R.id.suggestions_strip_voice_key); + mPasteKey = findViewById(R.id.suggestions_strip_paste_key); mOtherKey = findViewById(R.id.suggestions_strip_other_key); mStripVisibilityGroup = new StripVisibilityGroup(this, mSuggestionsStrip); @@ -161,9 +163,13 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick R.styleable.Keyboard, defStyle, R.style.SuggestionStripView); final Drawable iconVoice = keyboardAttr.getDrawable(R.styleable.Keyboard_iconShortcutKey); final Drawable iconIncognito = keyboardAttr.getDrawable(R.styleable.Keyboard_iconIncognitoKey); + //TODO: create and set a different icon for this + final Drawable iconPaste = keyboardAttr.getDrawable(R.styleable.Keyboard_iconShortcutKey); keyboardAttr.recycle(); mVoiceKey.setImageDrawable(iconVoice); mVoiceKey.setOnClickListener(this); + mPasteKey.setImageDrawable(iconPaste); + mPasteKey.setOnClickListener(this); mOtherKey.setImageDrawable(iconIncognito); } @@ -181,7 +187,10 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick final int visibility = shouldBeVisible ? VISIBLE : (isFullscreenMode ? GONE : INVISIBLE); setVisibility(visibility); final SettingsValues currentSettingsValues = Settings.getInstance().getCurrent(); - mVoiceKey.setVisibility(currentSettingsValues.mShowsVoiceInputKey ? VISIBLE : INVISIBLE); + //TODO: set either mVoiceKey or mPasteKey to INVISIBLE if the other is GONE + mVoiceKey.setVisibility(currentSettingsValues.mShowsVoiceInputKey ? VISIBLE : GONE); + //TODO: read visibility from settings + mPasteKey.setVisibility(VISIBLE); mOtherKey.setVisibility(currentSettingsValues.mIncognitoModeEnabled ? VISIBLE : INVISIBLE); } @@ -413,6 +422,10 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick false /* isKeyRepeat */); return; } + if (view == mPasteKey) { + //TODO: fill in + return; + } final Object tag = view.getTag(); // {@link Integer} tag is set at diff --git a/app/src/main/res/layout/suggestions_strip.xml b/app/src/main/res/layout/suggestions_strip.xml index c6a412e39..722975571 100644 --- a/app/src/main/res/layout/suggestions_strip.xml +++ b/app/src/main/res/layout/suggestions_strip.xml @@ -20,34 +20,43 @@ - - - - + android:soundEffectsEnabled="false"> + + + + + + +