* commit '0b20a8d2bb35a07c0b91b09ce91f7a36fc1d6df2': Do not start in recents tab if we do not have recent emojis
This commit is contained in:
commit
54c66d4f55
1 changed files with 14 additions and 7 deletions
|
@ -120,22 +120,29 @@ final class EmojiCategory {
|
||||||
mCategoryTabIconId[i] = emojiPaletteViewAttr.getResourceId(
|
mCategoryTabIconId[i] = emojiPaletteViewAttr.getResourceId(
|
||||||
sCategoryTabIconAttr[i], 0);
|
sCategoryTabIconAttr[i], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int defaultCategoryId = EmojiCategory.ID_SYMBOLS;
|
||||||
addShownCategoryId(EmojiCategory.ID_RECENTS);
|
addShownCategoryId(EmojiCategory.ID_RECENTS);
|
||||||
if (BuildCompatUtils.EFFECTIVE_SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
if (BuildCompatUtils.EFFECTIVE_SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
defaultCategoryId = EmojiCategory.ID_PEOPLE;
|
||||||
addShownCategoryId(EmojiCategory.ID_PEOPLE);
|
addShownCategoryId(EmojiCategory.ID_PEOPLE);
|
||||||
addShownCategoryId(EmojiCategory.ID_OBJECTS);
|
addShownCategoryId(EmojiCategory.ID_OBJECTS);
|
||||||
addShownCategoryId(EmojiCategory.ID_NATURE);
|
addShownCategoryId(EmojiCategory.ID_NATURE);
|
||||||
addShownCategoryId(EmojiCategory.ID_PLACES);
|
addShownCategoryId(EmojiCategory.ID_PLACES);
|
||||||
mCurrentCategoryId =
|
|
||||||
Settings.readLastShownEmojiCategoryId(mPrefs, EmojiCategory.ID_PEOPLE);
|
|
||||||
} else {
|
|
||||||
mCurrentCategoryId =
|
|
||||||
Settings.readLastShownEmojiCategoryId(mPrefs, EmojiCategory.ID_SYMBOLS);
|
|
||||||
}
|
}
|
||||||
addShownCategoryId(EmojiCategory.ID_SYMBOLS);
|
addShownCategoryId(EmojiCategory.ID_SYMBOLS);
|
||||||
addShownCategoryId(EmojiCategory.ID_EMOTICONS);
|
addShownCategoryId(EmojiCategory.ID_EMOTICONS);
|
||||||
getKeyboard(EmojiCategory.ID_RECENTS, 0 /* cagetoryPageId */)
|
|
||||||
.loadRecentKeys(mCategoryKeyboardMap.values());
|
DynamicGridKeyboard recentsKbd =
|
||||||
|
getKeyboard(EmojiCategory.ID_RECENTS, 0 /* cagetoryPageId */);
|
||||||
|
recentsKbd.loadRecentKeys(mCategoryKeyboardMap.values());
|
||||||
|
|
||||||
|
mCurrentCategoryId = Settings.readLastShownEmojiCategoryId(mPrefs, defaultCategoryId);
|
||||||
|
if (mCurrentCategoryId == EmojiCategory.ID_RECENTS &&
|
||||||
|
recentsKbd.getSortedKeys().isEmpty()) {
|
||||||
|
Log.i(TAG, "No recent emojis found, starting in category " + mCurrentCategoryId);
|
||||||
|
mCurrentCategoryId = defaultCategoryId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addShownCategoryId(final int categoryId) {
|
private void addShownCategoryId(final int categoryId) {
|
||||||
|
|
Loading…
Reference in a new issue