summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2011-11-05 16:39:59 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-05 16:39:59 +0000
commit5c5ecd9d29a8598df2deaee1862e5f0eb23971f1 (patch)
treee9c9f3057405cbc61c7a1ef612ed9f39066b2290 /src/com
parent9390cc0d7838d585f23b1d701a594394600495dd (diff)
parenta21816821f6e1ff024cf93662150f8819bc5e3c9 (diff)
downloadpackages_apps_nfc-5c5ecd9d29a8598df2deaee1862e5f0eb23971f1.zip
packages_apps_nfc-5c5ecd9d29a8598df2deaee1862e5f0eb23971f1.tar.gz
packages_apps_nfc-5c5ecd9d29a8598df2deaee1862e5f0eb23971f1.tar.bz2
am a2181682: Merge "Check for navigation bar when cropping Beam screenshot." into ics-mr1
* commit 'a21816821f6e1ff024cf93662150f8819bc5e3c9': Check for navigation bar when cropping Beam screenshot.
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/nfc/SendUi.java11
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) {