diff options
author | Martijn Coenen <maco@google.com> | 2011-11-03 17:04:41 -0700 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2011-11-03 17:05:48 -0700 |
commit | e3cfbec7045220294c172d55122daf55ab6cb058 (patch) | |
tree | d7b523de0db85c39dd34dab69b6596b4bd53e7a0 /src/com | |
parent | b8e9f01096fa579486b23ceb5341bf977ebb0080 (diff) | |
download | packages_apps_nfc-e3cfbec7045220294c172d55122daf55ab6cb058.zip packages_apps_nfc-e3cfbec7045220294c172d55122daf55ab6cb058.tar.gz packages_apps_nfc-e3cfbec7045220294c172d55122daf55ab6cb058.tar.bz2 |
Check for navigation bar when cropping Beam screenshot.
This fixes the Beam animation on crespo.
Change-Id: I1bc374dc532a4e83622c62b31ee5b4de2b5fa3ba
Diffstat (limited to 'src/com')
-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 37c8cfc..f755c8c 100644 --- a/src/com/android/nfc/SendUi.java +++ b/src/com/android/nfc/SendUi.java @@ -394,16 +394,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) { |