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

Commit be819dbe authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Revert "Add keyboard margin options to place the keyboard dynamically."

This reverts commit 8584db14.

Bug: 18675223
Bug: 18675476
Change-Id: I4e25d87ac261c44b1943df832115f8cca690103a
parent 45bbdc20
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -23,18 +23,10 @@
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    style="?attr/inputViewStyle">
    <LinearLayout
        android:id="@+id/horizontal_keyboard_frame"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:gravity="bottom"
        android:orientation="horizontal">
    <include
        android:id="@+id/main_keyboard_frame"
        layout="@layout/main_keyboard_frame" />
    <include
        android:id="@+id/emoji_palettes_view"
        layout="@layout/emoji_palettes_view" />
    </LinearLayout>
</com.android.inputmethod.latin.InputView>
+0 −6
Original line number Diff line number Diff line
@@ -47,12 +47,6 @@
    <string name="prefs_resize_keyboard">Enable keyboard resizing</string>
    <!-- Title of the settings for setting keyboard height -->
    <string name="prefs_keyboard_height_scale">Keyboard height scale</string>
    <!-- Title of the settings for setting keyboard width -->
    <string name="prefs_keyboard_bottom_margin">Keyboard bottom margin</string>
    <!-- Title of the settings for setting keyboard width -->
    <string name="prefs_keyboard_left_margin">Keyboard left margin</string>
    <!-- Title of the settings for setting keyboard width -->
    <string name="prefs_keyboard_right_margin">Keyboard right margin</string>
    <!-- Message to show when there are no files to install as an external dictionary [CHAR LIMIT=100] -->
    <string name="read_external_dictionary_no_files_message">No dictionary files in the Downloads folder</string>
    <!-- Title of the dialog that selects a file to install as an external dictionary [CHAR LIMIT=50] -->
+0 −18
Original line number Diff line number Diff line
@@ -87,24 +87,6 @@
        android:title="@string/prefs_keyboard_height_scale"
        latin:minValue="50"
        latin:maxValue="120" /> <!-- percentage -->
    <com.android.inputmethod.latin.settings.SeekBarDialogPreference
        android:dependency="pref_resize_keyboard"
        android:key="pref_keyboard_bottom_margin"
        android:title="@string/prefs_keyboard_bottom_margin"
        latin:minValue="0"
        latin:maxValue="50" /> <!-- percentage -->
    <com.android.inputmethod.latin.settings.SeekBarDialogPreference
        android:dependency="pref_resize_keyboard"
        android:key="pref_keyboard_left_margin"
        android:title="@string/prefs_keyboard_left_margin"
        latin:minValue="0"
        latin:maxValue="50" /> <!-- percentage -->
    <com.android.inputmethod.latin.settings.SeekBarDialogPreference
        android:dependency="pref_resize_keyboard"
        android:key="pref_keyboard_right_margin"
        android:title="@string/prefs_keyboard_right_margin"
        latin:minValue="0"
        latin:maxValue="50" /> <!-- percentage -->
    <PreferenceScreen
        android:key="read_external_dictionary"
        android:title="@string/prefs_read_external_dictionary" />
+2 −12
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.util.Log;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;

import com.android.inputmethod.compat.InputMethodServiceCompatUtils;
@@ -65,7 +64,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {

    private KeyboardTheme mKeyboardTheme;
    private Context mThemeContext;
    private View mHorizontalKeyboardFrame;

    private static final KeyboardSwitcher sInstance = new KeyboardSwitcher();

    public static KeyboardSwitcher getInstance() {
@@ -112,16 +111,8 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
        final KeyboardLayoutSet.Builder builder = new KeyboardLayoutSet.Builder(
                mThemeContext, editorInfo);
        final Resources res = mThemeContext.getResources();
        final ViewGroup.MarginLayoutParams p =
                (ViewGroup.MarginLayoutParams) mHorizontalKeyboardFrame.getLayoutParams();

        final int keyboardLeftMargin = ResourceUtils.getKeyboardLeftMargin(res, settingsValues);
        final int keyboardRightMargin = ResourceUtils.getKeyboardRightMargin(res, settingsValues);
        final int keyboardBottomMargin = ResourceUtils.getKeyboardBottomMargin(res, settingsValues);
        p.setMargins(keyboardLeftMargin, 0, keyboardRightMargin, keyboardBottomMargin);

        final int keyboardWidth = ResourceUtils.getDefaultKeyboardWidth(res);
        final int keyboardHeight = ResourceUtils.getKeyboardHeight(res, settingsValues);
        final int keyboardWidth = ResourceUtils.getKeyboardWidth(res, settingsValues);
        builder.setKeyboardGeometry(keyboardWidth, keyboardHeight);
        builder.setSubtype(RichInputMethodManager.getInstance().getCurrentSubtype());
        builder.setVoiceInputKeyEnabled(settingsValues.mShowsVoiceInputKey);
@@ -420,7 +411,6 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
        mEmojiPalettesView.setHardwareAcceleratedDrawingEnabled(
                isHardwareAcceleratedDrawingEnabled);
        mEmojiPalettesView.setKeyboardActionListener(mLatinIME);
        mHorizontalKeyboardFrame = mCurrentInputView.findViewById(R.id.horizontal_keyboard_frame);
        return mCurrentInputView;
    }

+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ final class EmojiLayoutParams {

    public EmojiLayoutParams(final Resources res) {
        final int defaultKeyboardHeight = ResourceUtils.getDefaultKeyboardHeight(res);
        final int defaultKeyboardWidth = ResourceUtils.getKeyboardFrameWidth(res);
        final int defaultKeyboardWidth = ResourceUtils.getDefaultKeyboardWidth(res);
        mKeyVerticalGap = (int) res.getFraction(R.fraction.config_key_vertical_gap_holo,
                defaultKeyboardHeight, defaultKeyboardHeight);
        mBottomPadding = (int) res.getFraction(R.fraction.config_keyboard_bottom_padding_holo,
Loading