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

Commit f812d4b8 authored by George Zacharia's avatar George Zacharia Committed by Michael Bestas
Browse files

LatinIME: Remove hardcoded emoji row logic

The hardcoded value was not allowing adjusting the actionbar height, make this follow the overalyable row height

The value is incremented by one as the actionbar is considered one row.

Change-Id: Ia3135bf5a3ef38224ce4e7dadc812faf9efeb69d
parent 0aae9ae0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -25,8 +25,6 @@ import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.utils.ResourceUtils;

final class EmojiLayoutParams {
    private static final int DEFAULT_KEYBOARD_ROWS = 4;

    public final int mEmojiPagerHeight;
    private final int mEmojiPagerBottomMargin;
    public final int mEmojiKeyboardHeight;
@@ -52,7 +50,9 @@ final class EmojiLayoutParams {
                (int) (res.getDimension(R.dimen.config_emoji_category_page_id_height));
        final int baseheight = defaultKeyboardHeight - mBottomPadding - mTopPadding
                + mKeyVerticalGap;
        mEmojiActionBarHeight = baseheight / DEFAULT_KEYBOARD_ROWS
        final int mNumberOfRows = (int) (1.0f / res.getFraction(
                R.fraction.config_emoji_keyboard_row_height, 1, 1)) + 1;
        mEmojiActionBarHeight = baseheight / mNumberOfRows
                - (mKeyVerticalGap - mBottomPadding) / 2;
        mEmojiPagerHeight = defaultKeyboardHeight - mEmojiActionBarHeight
                - mEmojiCategoryPageIdViewHeight;