Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavbarEditor.java +17 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ import android.content.res.Configuration; import android.database.DataSetObserver; import android.graphics.Color; import android.provider.Settings; import android.util.DisplayMetrics; import android.view.HapticFeedbackConstants; import android.view.KeyEvent; import android.view.LayoutInflater; Loading Loading @@ -56,6 +57,7 @@ public class NavbarEditor implements OnTouchListener { new LinkedHashMap<String,ButtonInfo>(); protected static int visibleCount = 4; private static Boolean mIsDeviceHybrid = null; /** * Holds reference to the parent/root of the inflated view Loading Loading @@ -165,6 +167,21 @@ public class NavbarEditor implements OnTouchListener { } }; protected static boolean isDeviceHybrid(Context con) { if (mIsDeviceHybrid == null) { WindowManager wm = (WindowManager)con.getSystemService(Context.WINDOW_SERVICE); android.view.Display display = wm.getDefaultDisplay(); int shortSize = Math.min(display.getRawHeight(), display.getRawWidth()); int shortSizeDp = shortSize * DisplayMetrics.DENSITY_DEFAULT / DisplayMetrics.DENSITY_DEVICE; if (shortSizeDp < 720 && shortSizeDp >= 600) { mIsDeviceHybrid = true; } else { mIsDeviceHybrid = false; } } return mIsDeviceHybrid; } @Override public boolean onTouch(final View view, MotionEvent event) { if (!NavigationBarView.getEditMode() || (mDialog != null && mDialog.isShowing())) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +1 −5 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ public class NavigationBarView extends LinearLayout { private OnClickListener mRecentsClickListener; private RecentsPanelView mRecentsPanel; private OnTouchListener mHomeSearchActionListener; private boolean mIs600dp; protected IStatusBarService mBarService; final Display mDisplay; Loading Loading @@ -181,9 +180,6 @@ public class NavigationBarView extends LinearLayout { mBarSize = res.getDimensionPixelSize(R.dimen.navigation_bar_size); mVertical = false; mShowMenu = false; //Silly way to identify 600dp //TODO come up with a better way mIs600dp = res.getInteger(R.integer.notification_panel_layout_gravity) == 49; mDelegateHelper = new DelegateViewHelper(this); updateResources(); Loading Loading @@ -415,7 +411,7 @@ public class NavigationBarView extends LinearLayout { } mCurrentView = mRotatedViews[rot]; mCurrentView.setVisibility(View.VISIBLE); if (!mIs600dp) { if (!NavbarEditor.isDeviceHybrid(mContext)) { mVertical = (rot == Surface.ROTATION_90 || rot == Surface.ROTATION_270); } else { mVertical = getWidth() > 0 && getHeight() > getWidth(); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavbarEditor.java +17 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ import android.content.res.Configuration; import android.database.DataSetObserver; import android.graphics.Color; import android.provider.Settings; import android.util.DisplayMetrics; import android.view.HapticFeedbackConstants; import android.view.KeyEvent; import android.view.LayoutInflater; Loading Loading @@ -56,6 +57,7 @@ public class NavbarEditor implements OnTouchListener { new LinkedHashMap<String,ButtonInfo>(); protected static int visibleCount = 4; private static Boolean mIsDeviceHybrid = null; /** * Holds reference to the parent/root of the inflated view Loading Loading @@ -165,6 +167,21 @@ public class NavbarEditor implements OnTouchListener { } }; protected static boolean isDeviceHybrid(Context con) { if (mIsDeviceHybrid == null) { WindowManager wm = (WindowManager)con.getSystemService(Context.WINDOW_SERVICE); android.view.Display display = wm.getDefaultDisplay(); int shortSize = Math.min(display.getRawHeight(), display.getRawWidth()); int shortSizeDp = shortSize * DisplayMetrics.DENSITY_DEFAULT / DisplayMetrics.DENSITY_DEVICE; if (shortSizeDp < 720 && shortSizeDp >= 600) { mIsDeviceHybrid = true; } else { mIsDeviceHybrid = false; } } return mIsDeviceHybrid; } @Override public boolean onTouch(final View view, MotionEvent event) { if (!NavigationBarView.getEditMode() || (mDialog != null && mDialog.isShowing())) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +1 −5 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ public class NavigationBarView extends LinearLayout { private OnClickListener mRecentsClickListener; private RecentsPanelView mRecentsPanel; private OnTouchListener mHomeSearchActionListener; private boolean mIs600dp; protected IStatusBarService mBarService; final Display mDisplay; Loading Loading @@ -181,9 +180,6 @@ public class NavigationBarView extends LinearLayout { mBarSize = res.getDimensionPixelSize(R.dimen.navigation_bar_size); mVertical = false; mShowMenu = false; //Silly way to identify 600dp //TODO come up with a better way mIs600dp = res.getInteger(R.integer.notification_panel_layout_gravity) == 49; mDelegateHelper = new DelegateViewHelper(this); updateResources(); Loading Loading @@ -415,7 +411,7 @@ public class NavigationBarView extends LinearLayout { } mCurrentView = mRotatedViews[rot]; mCurrentView.setVisibility(View.VISIBLE); if (!mIs600dp) { if (!NavbarEditor.isDeviceHybrid(mContext)) { mVertical = (rot == Surface.ROTATION_90 || rot == Surface.ROTATION_270); } else { mVertical = getWidth() > 0 && getHeight() > getWidth(); Loading