mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-29 04:09:55 +00:00
Use ANIMATOR_DURATION_SCALE
only.
Make local to `EmojiPalettesView`.
This commit is contained in:
parent
adb6eb4952
commit
a9044b710f
2 changed files with 6 additions and 17 deletions
|
@ -403,7 +403,7 @@ public final class EmojiPalettesView extends LinearLayout
|
||||||
if (mPager.getScrollState() != ViewPager2.SCROLL_STATE_DRAGGING) {
|
if (mPager.getScrollState() != ViewPager2.SCROLL_STATE_DRAGGING) {
|
||||||
// Not swiping
|
// Not swiping
|
||||||
mPager.setCurrentItem(mEmojiCategory.getTabIdFromCategoryId(
|
mPager.setCurrentItem(mEmojiCategory.getTabIdFromCategoryId(
|
||||||
mEmojiCategory.getCurrentCategoryId()), ! initial && ! Settings.getValues().mAnimationDisabled);
|
mEmojiCategory.getCurrentCategoryId()), ! initial && ! isAnimationsDisabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.getValues().mSecondaryStripVisible) {
|
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() {
|
public void clearKeyboardCache() {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -49,10 +49,6 @@ public class SettingsValues {
|
||||||
public final Locale mLocale;
|
public final Locale mLocale;
|
||||||
public final boolean mHasHardwareKeyboard;
|
public final boolean mHasHardwareKeyboard;
|
||||||
public final int mDisplayOrientation;
|
public final int mDisplayOrientation;
|
||||||
|
|
||||||
// From system
|
|
||||||
public final boolean mAnimationDisabled;
|
|
||||||
|
|
||||||
// From preferences
|
// From preferences
|
||||||
public final boolean mAutoCap;
|
public final boolean mAutoCap;
|
||||||
public final boolean mVibrateOn;
|
public final boolean mVibrateOn;
|
||||||
|
@ -163,8 +159,6 @@ public class SettingsValues {
|
||||||
mDisplayOrientation = res.getConfiguration().orientation;
|
mDisplayOrientation = res.getConfiguration().orientation;
|
||||||
final InputMethodSubtype selectedSubtype = SubtypeSettings.INSTANCE.getSelectedSubtype(prefs);
|
final InputMethodSubtype selectedSubtype = SubtypeSettings.INSTANCE.getSelectedSubtype(prefs);
|
||||||
|
|
||||||
mAnimationDisabled = isAnimationDisabled(context);
|
|
||||||
|
|
||||||
// Store the input attributes
|
// Store the input attributes
|
||||||
mInputAttributes = inputAttributes;
|
mInputAttributes = inputAttributes;
|
||||||
|
|
||||||
|
@ -430,14 +424,4 @@ public class SettingsValues {
|
||||||
sb.append("\n mAppWorkarounds = ");
|
sb.append("\n mAppWorkarounds = ");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isAnimationDisabled(Context context) {
|
|
||||||
return isZeroSetting(android.provider.Settings.Global.ANIMATOR_DURATION_SCALE, context)
|
|
||||||
&& isZeroSetting(android.provider.Settings.Global.TRANSITION_ANIMATION_SCALE, context)
|
|
||||||
&& isZeroSetting(android.provider.Settings.Global.WINDOW_ANIMATION_SCALE, context);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isZeroSetting(String name, Context context) {
|
|
||||||
return android.provider.Settings.Global.getFloat(context.getContentResolver(), name, 1.0f) == 0.0f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue