diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2014-02-08 16:29:52 +0100 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-11-07 13:57:46 -0800 |
commit | 68b2f3c035f52ea0cca023d43a735cf0bef86d84 (patch) | |
tree | 34d5c64ecdf1ccf280bd9ab588b10779e2d1bed0 | |
parent | 79ccfd29d2256689af577ecb2cc162958ec9e024 (diff) | |
download | packages_apps_browser-68b2f3c035f52ea0cca023d43a735cf0bef86d84.zip packages_apps_browser-68b2f3c035f52ea0cca023d43a735cf0bef86d84.tar.gz packages_apps_browser-68b2f3c035f52ea0cca023d43a735cf0bef86d84.tar.bz2 |
browser: properly handle get center tab
Change-Id: Ibec6a7b80e399b99fe2e6df64a7c4b1cc6c38728
JIRA: CYAN-3235
Issue: https://jira.cyanogenmod.org/browse/CYAN-3235
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
-rw-r--r-- | src/com/android/browser/NavScreen.java | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java index 277df18..f7b73df 100644 --- a/src/com/android/browser/NavScreen.java +++ b/src/com/android/browser/NavScreen.java @@ -72,7 +72,6 @@ public class NavScreen extends RelativeLayout NavTabScroller mScroller; TabAdapter mAdapter; int mOrientation; - Point mSize; HashMap<Tab, View> mTabViews; public NavScreen(Activity activity, UiController ctl, PhoneUi ui) { @@ -81,9 +80,6 @@ public class NavScreen extends RelativeLayout mUiController = ctl; mUi = ui; mOrientation = activity.getResources().getConfiguration().orientation; - WindowManager wm = (WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE); - mSize = new Point(); - wm.getDefaultDisplay().getSize(mSize); init(); } @@ -228,9 +224,7 @@ public class NavScreen extends RelativeLayout } private Tab findCenteredTab(){ - View v = mOrientation == Configuration.ORIENTATION_LANDSCAPE ? - mScroller.findViewAt(mSize.y/2, mSize.x/2): - mScroller.findViewAt(mSize.x/2, mSize.y/2); + View v = mScroller.findViewAt(mScroller.getWidth() / 2, mScroller.getHeight() / 2); if( v != null && v instanceof NavTabView ){ Long tabId = ((NavTabView)v).getWebViewId(); if( tabId != null ){ |