diff options
author | Martijn Coenen <maco@google.com> | 2011-11-04 08:53:33 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-04 08:53:33 -0700 |
commit | a21816821f6e1ff024cf93662150f8819bc5e3c9 (patch) | |
tree | ce7f5bcc52375df946c1c7ada2341b40e50f7611 | |
parent | 304a7304fe4aeab2b915024a531238f1c3f246a8 (diff) | |
parent | e3cfbec7045220294c172d55122daf55ab6cb058 (diff) | |
download | packages_apps_nfc-a21816821f6e1ff024cf93662150f8819bc5e3c9.zip packages_apps_nfc-a21816821f6e1ff024cf93662150f8819bc5e3c9.tar.gz packages_apps_nfc-a21816821f6e1ff024cf93662150f8819bc5e3c9.tar.bz2 |
Merge "Check for navigation bar when cropping Beam screenshot." into ics-mr1
-rw-r--r-- | src/com/android/nfc/SendUi.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/nfc/SendUi.java b/src/com/android/nfc/SendUi.java index 1d2230a..a198811 100644 --- a/src/com/android/nfc/SendUi.java +++ b/src/com/android/nfc/SendUi.java @@ -396,16 +396,19 @@ public class SendUi implements Animator.AnimatorListener, View.OnTouchListener, // take screenshots only in the natural orientation of the device :!) mDisplay.getRealMetrics(mDisplayMetrics); + boolean hasNavBar = mContext.getResources().getBoolean( + com.android.internal.R.bool.config_showNavigationBar); float[] dims = {mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels}; float degrees = getDegreesForRotation(mDisplay.getRotation()); final int statusBarHeight = mContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.status_bar_height); + // Navbar has different sizes, depending on orientation - final int navBarHeight = mContext.getResources().getDimensionPixelSize( - com.android.internal.R.dimen.navigation_bar_height); - final int navBarWidth = mContext.getResources().getDimensionPixelSize( - com.android.internal.R.dimen.navigation_bar_width); + final int navBarHeight = hasNavBar ? mContext.getResources().getDimensionPixelSize( + com.android.internal.R.dimen.navigation_bar_height) : 0; + final int navBarWidth = hasNavBar ? mContext.getResources().getDimensionPixelSize( + com.android.internal.R.dimen.navigation_bar_width) : 0; boolean requiresRotation = (degrees > 0); if (requiresRotation) { |