summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewConfiguration.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-01-22 18:05:38 -0800
committerDianne Hackborn <hackbod@google.com>2011-01-22 18:13:13 -0800
commitff801ec71399f7e8aa95bcbb9937c53144fe17c5 (patch)
treeaf9e1ee21e7edbb363b83d8fb0e19b142275d9e0 /core/java/android/view/ViewConfiguration.java
parentf36af16479e252bec168ed181885ec21d9df46f5 (diff)
Fix issue #3302006: Cannot see the dialog lunched from a transparent activity.
The activity manager was not performing the layout pass on the new window, because its app token was still hidden, because the activity manager / window manager were still waiting for it to be ready to show. Just ignore whether the app token is hidden for this case. Also fixes some problems with animations, and tweaks the ViewConfiguration values for xlarge screens. Change-Id: Icbe9c77ba8127d1e02df2d6f27b8e86ec842e50a
Diffstat (limited to 'core/java/android/view/ViewConfiguration.java')
-rw-r--r--core/java/android/view/ViewConfiguration.java24
1 files changed, 16 insertions, 8 deletions
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 6b41ce5cf057..edad4943fcf5 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -17,6 +17,7 @@
package android.view;
import android.content.Context;
+import android.content.res.Configuration;
import android.util.DisplayMetrics;
import android.util.SparseArray;
@@ -217,22 +218,29 @@ public class ViewConfiguration {
private ViewConfiguration(Context context) {
final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
final float density = metrics.density;
+ final float sizeAndDensity;
+ if (context.getResources().getConfiguration().isLayoutSizeAtLeast(
+ Configuration.SCREENLAYOUT_SIZE_XLARGE)) {
+ sizeAndDensity = density * 1.5f;
+ } else {
+ sizeAndDensity = density;
+ }
- mEdgeSlop = (int) (density * EDGE_SLOP + 0.5f);
- mFadingEdgeLength = (int) (density * FADING_EDGE_LENGTH + 0.5f);
+ mEdgeSlop = (int) (sizeAndDensity * EDGE_SLOP + 0.5f);
+ mFadingEdgeLength = (int) (sizeAndDensity * FADING_EDGE_LENGTH + 0.5f);
mMinimumFlingVelocity = (int) (density * MINIMUM_FLING_VELOCITY + 0.5f);
mMaximumFlingVelocity = (int) (density * MAXIMUM_FLING_VELOCITY + 0.5f);
mScrollbarSize = (int) (density * SCROLL_BAR_SIZE + 0.5f);
- mTouchSlop = (int) (density * TOUCH_SLOP + 0.5f);
- mPagingTouchSlop = (int) (density * PAGING_TOUCH_SLOP + 0.5f);
- mDoubleTapSlop = (int) (density * DOUBLE_TAP_SLOP + 0.5f);
- mWindowTouchSlop = (int) (density * WINDOW_TOUCH_SLOP + 0.5f);
+ mTouchSlop = (int) (sizeAndDensity * TOUCH_SLOP + 0.5f);
+ mPagingTouchSlop = (int) (sizeAndDensity * PAGING_TOUCH_SLOP + 0.5f);
+ mDoubleTapSlop = (int) (sizeAndDensity * DOUBLE_TAP_SLOP + 0.5f);
+ mWindowTouchSlop = (int) (sizeAndDensity * WINDOW_TOUCH_SLOP + 0.5f);
// Size of the screen in bytes, in ARGB_8888 format
mMaximumDrawingCacheSize = 4 * metrics.widthPixels * metrics.heightPixels;
- mOverscrollDistance = (int) (density * OVERSCROLL_DISTANCE + 0.5f);
- mOverflingDistance = (int) (density * OVERFLING_DISTANCE + 0.5f);
+ mOverscrollDistance = (int) (sizeAndDensity * OVERSCROLL_DISTANCE + 0.5f);
+ mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f);
}
/**