Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 14130628 authored by Georg Veichtlbauer's avatar Georg Veichtlbauer Committed by Michael Bestas
Browse files

LatinIME: Kill right alphabet key, replace it with delete in Emoji view

Change-Id: I86093314ca486c51c903ef3ff8590f7766cfadcf
parent 7031f633
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -59,17 +59,6 @@
            </FrameLayout>
        </TabHost>
        <include layout="@layout/suggestion_divider" />
        <!-- TODO: Implement KeyView and replace this. -->
        <!-- Provide audio and haptic feedback by ourselves based on the keyboard settings.
             We just need to ignore the system's audio and haptic feedback settings. -->
        <ImageButton
            android:id="@+id/emoji_keyboard_delete"
            android:layout_width="0dip"
            android:layout_weight="12.5"
            android:layout_height="match_parent"
            android:hapticFeedbackEnabled="false"
            android:soundEffectsEnabled="false"
            android:contentDescription="@string/spoken_description_delete" />
    </LinearLayout>
    <androidx.viewpager.widget.ViewPager
        android:id="@+id/emoji_keyboard_pager"
@@ -120,13 +109,14 @@
        <!-- TODO: Implement KeyView and replace this. -->
        <!-- Provide audio and haptic feedback by ourselves based on the keyboard settings.
             We just need to ignore the system's audio and haptic feedback settings. -->
        <TextView
            android:id="@+id/emoji_keyboard_alphabet_right"
        <ImageButton
            android:id="@+id/emoji_keyboard_delete"
            android:layout_width="0dip"
            android:layout_weight="0.15"
            android:gravity="center"
            android:layout_height="match_parent"
            android:hapticFeedbackEnabled="false"
            android:soundEffectsEnabled="false" />
            android:soundEffectsEnabled="false"
            android:contentDescription="@string/spoken_description_delete" />
    </LinearLayout>
</com.android.inputmethod.keyboard.emoji.EmojiPalettesView>
+7 −13
Original line number Diff line number Diff line
@@ -78,7 +78,6 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange

    private ImageButton mDeleteKey;
    private TextView mAlphabetKeyLeft;
    private TextView mAlphabetKeyRight;
    private View mSpacebar;
    // TODO: Remove this workaround.
    private View mSpacebarIcon;
@@ -199,12 +198,6 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
        final LinearLayout actionBar = (LinearLayout)findViewById(R.id.emoji_action_bar);
        mEmojiLayoutParams.setActionBarProperties(actionBar);

        // deleteKey depends only on OnTouchListener.
        mDeleteKey = (ImageButton)findViewById(R.id.emoji_keyboard_delete);
        mDeleteKey.setBackgroundResource(mFunctionalKeyBackgroundId);
        mDeleteKey.setTag(Constants.CODE_DELETE);
        mDeleteKey.setOnTouchListener(mDeleteKeyOnTouchListener);

        // {@link #mAlphabetKeyLeft}, {@link #mAlphabetKeyRight, and spaceKey depend on
        // {@link View.OnClickListener} as well as {@link View.OnTouchListener}.
        // {@link View.OnTouchListener} is used as the trigger of key-press, while
@@ -217,16 +210,18 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
        mAlphabetKeyLeft.setTag(Constants.CODE_ALPHA_FROM_EMOJI);
        mAlphabetKeyLeft.setOnTouchListener(this);
        mAlphabetKeyLeft.setOnClickListener(this);
        mAlphabetKeyRight = (TextView)findViewById(R.id.emoji_keyboard_alphabet_right);
        mAlphabetKeyRight.setBackgroundResource(mFunctionalKeyBackgroundId);
        mAlphabetKeyRight.setTag(Constants.CODE_ALPHA_FROM_EMOJI);
        mAlphabetKeyRight.setOnTouchListener(this);
        mAlphabetKeyRight.setOnClickListener(this);
        mSpacebar = findViewById(R.id.emoji_keyboard_space);
        mSpacebar.setBackgroundResource(mSpacebarBackgroundId);
        mSpacebar.setTag(Constants.CODE_SPACE);
        mSpacebar.setOnTouchListener(this);
        mSpacebar.setOnClickListener(this);

        // deleteKey depends only on OnTouchListener.
        mDeleteKey = (ImageButton)findViewById(R.id.emoji_keyboard_delete);
        mDeleteKey.setBackgroundResource(mFunctionalKeyBackgroundId);
        mDeleteKey.setTag(Constants.CODE_DELETE);
        mDeleteKey.setOnTouchListener(mDeleteKeyOnTouchListener);

        mEmojiLayoutParams.setKeyProperties(mSpacebar);
        mSpacebarIcon = findViewById(R.id.emoji_keyboard_space_icon);
    }
@@ -386,7 +381,6 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
        final KeyDrawParams params = new KeyDrawParams();
        params.updateParams(mEmojiLayoutParams.getActionBarHeight(), keyVisualAttr);
        setupAlphabetKey(mAlphabetKeyLeft, switchToAlphaLabel, params);
        setupAlphabetKey(mAlphabetKeyRight, switchToAlphaLabel, params);
        mEmojiPager.setAdapter(mEmojiPalettesAdapter);
        mEmojiPager.setCurrentItem(mCurrentPagerPosition);
    }