Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1713)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java

Issue 469583003: Android Disable menu animations for low end devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java
index 947d5787d6ba8217e58759c93d6c40a40162b0fd..29f8ae910397a402204a54faa58a308244762809 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java
@@ -24,6 +24,7 @@ import android.widget.ListPopupWindow;
import android.widget.PopupWindow;
import android.widget.PopupWindow.OnDismissListener;
+import org.chromium.base.SysUtils;
import org.chromium.chrome.R;
import java.util.ArrayList;
@@ -112,6 +113,9 @@ public class AppMenu implements OnItemClickListener, OnKeyListener {
mPopup.setAnimationStyle(R.style.OverflowMenuAnim);
}
+ // Turn off window animations for low end devices.
+ if (SysUtils.isLowEndDevice()) mPopup.setAnimationStyle(0);
+
Rect bgPadding = new Rect();
mPopup.getBackground().getPadding(bgPadding);
@@ -155,14 +159,17 @@ public class AppMenu implements OnItemClickListener, OnKeyListener {
mPopup.getListView().setFadingEdgeLength(mVerticalFadeDistance);
}
- mPopup.getListView().addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
- @Override
- public void onLayoutChange(View v, int left, int top, int right, int bottom,
- int oldLeft, int oldTop, int oldRight, int oldBottom) {
- mPopup.getListView().removeOnLayoutChangeListener(this);
- runMenuItemEnterAnimations();
- }
- });
+ // Don't animate the menu items for low end devices.
+ if (!SysUtils.isLowEndDevice()) {
+ mPopup.getListView().addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
+ @Override
+ public void onLayoutChange(View v, int left, int top, int right, int bottom,
+ int oldLeft, int oldTop, int oldRight, int oldBottom) {
+ mPopup.getListView().removeOnLayoutChangeListener(this);
+ runMenuItemEnterAnimations();
+ }
+ });
+ }
}
private void setPopupOffset(ListPopupWindow popup, int screenRotation, Rect appRect) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698