mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-28 11:49:56 +00:00
Disable emoji view animation according to system setting (#1696)
This commit is contained in:
parent
9cec401e1e
commit
f8d3795302
1 changed files with 7 additions and 2 deletions
|
@ -71,7 +71,7 @@ public final class EmojiPalettesView extends LinearLayout
|
|||
|
||||
private final class PagerAdapter extends RecyclerView.Adapter<PagerViewHolder> {
|
||||
private boolean mInitialized;
|
||||
private Map<Integer, RecyclerView> mViews = new HashMap<>(mEmojiCategory.getShownCategories().size());
|
||||
private final Map<Integer, RecyclerView> mViews = new HashMap<>(mEmojiCategory.getShownCategories().size());
|
||||
|
||||
private PagerAdapter(ViewPager2 pager) {
|
||||
setHasStableIds(true);
|
||||
|
@ -403,7 +403,7 @@ public final class EmojiPalettesView extends LinearLayout
|
|||
if (mPager.getScrollState() != ViewPager2.SCROLL_STATE_DRAGGING) {
|
||||
// Not swiping
|
||||
mPager.setCurrentItem(mEmojiCategory.getTabIdFromCategoryId(
|
||||
mEmojiCategory.getCurrentCategoryId()), ! initial);
|
||||
mEmojiCategory.getCurrentCategoryId()), ! initial && ! isAnimationsDisabled());
|
||||
}
|
||||
|
||||
if (Settings.getValues().mSecondaryStripVisible) {
|
||||
|
@ -418,6 +418,11 @@ public final class EmojiPalettesView extends LinearLayout
|
|||
}
|
||||
}
|
||||
|
||||
private boolean isAnimationsDisabled() {
|
||||
return android.provider.Settings.Global.getFloat(getContext().getContentResolver(),
|
||||
android.provider.Settings.Global.ANIMATOR_DURATION_SCALE, 1.0f) == 0.0f;
|
||||
}
|
||||
|
||||
public void clearKeyboardCache() {
|
||||
if (!initialized) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue