Loading core/java/com/android/internal/widget/SwipeDismissLayout.java +10 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.internal.widget; import android.animation.TimeInterpolator; import android.app.Activity; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; Loading @@ -38,6 +39,7 @@ public class SwipeDismissLayout extends FrameLayout { private static final String TAG = "SwipeDismissLayout"; private static final float DISMISS_MIN_DRAG_WIDTH_RATIO = .33f; private boolean mUseDynamicTranslucency = true; public interface OnDismissedListener { void onDismissed(SwipeDismissLayout layout); Loading Loading @@ -85,7 +87,7 @@ public class SwipeDismissLayout extends FrameLayout { // and temporarily disables translucency when it is fully visible. // As soon as the user starts swiping, we will re-enable // translucency. if (getContext() instanceof Activity) { if (mUseDynamicTranslucency && getContext() instanceof Activity) { ((Activity) getContext()).convertFromTranslucent(); } } Loading Loading @@ -117,6 +119,11 @@ public class SwipeDismissLayout extends FrameLayout { android.R.integer.config_shortAnimTime); mCancelInterpolator = new DecelerateInterpolator(1.5f); mDismissInterpolator = new AccelerateInterpolator(1.5f); TypedArray a = context.getTheme().obtainStyledAttributes( com.android.internal.R.styleable.Theme); mUseDynamicTranslucency = !a.hasValue( com.android.internal.R.styleable.Window_windowIsTranslucent); a.recycle(); } public void setOnDismissedListener(OnDismissedListener listener) { Loading Loading @@ -230,7 +237,7 @@ public class SwipeDismissLayout extends FrameLayout { mLastX = ev.getRawX(); updateSwiping(ev); if (mSwiping) { if (getContext() instanceof Activity) { if (mUseDynamicTranslucency && getContext() instanceof Activity) { ((Activity) getContext()).convertToTranslucent(null, null); } setProgress(ev.getRawX() - mDownX); Loading @@ -254,7 +261,7 @@ public class SwipeDismissLayout extends FrameLayout { } protected void cancel() { if (getContext() instanceof Activity) { if (mUseDynamicTranslucency && getContext() instanceof Activity) { ((Activity) getContext()).convertFromTranslucent(); } if (mProgressListener != null) { Loading core/res/res/values/attrs.xml +6 −2 Original line number Diff line number Diff line Loading @@ -329,7 +329,9 @@ <attr name="windowOverscan" format="boolean" /> <!-- Flag indicating whether this is a floating window. --> <attr name="windowIsFloating" format="boolean" /> <!-- Flag indicating whether this is a translucent window. --> <!-- Flag indicating whether this is a translucent window. If this attribute is unset (but not if set to false), the window might still be considered translucent, if windowSwipeToDismiss is set to true. --> <attr name="windowIsTranslucent" format="boolean" /> <!-- Flag indicating that this window's background should be the user's current wallpaper. Corresponds Loading Loading @@ -455,7 +457,9 @@ <attr name="windowTranslucentNavigation" format="boolean" /> <!-- Flag to indicate that a window can be swiped away to be dismissed. Corresponds to {@link android.view.Window#FEATURE_SWIPE_TO_DISMISS} --> Corresponds to {@link android.view.Window#FEATURE_SWIPE_TO_DISMISS}. It will also dynamically change translucency of the window, if the windowIsTranslucent is not set. If windowIsTranslucent is set (to either true or false) it will obey that setting. --> <attr name="windowSwipeToDismiss" format="boolean" /> <!-- Flag indicating whether this window requests that content changes be performed Loading core/res/res/values/themes_micro.xml +0 −6 Original line number Diff line number Diff line Loading @@ -24,9 +24,6 @@ <item name="windowBackground">@color/black</item> <item name="windowContentOverlay">@null</item> <item name="windowIsFloating">false</item> <!-- We need the windows to be translucent for SwipeToDismiss layout to work properly. --> <item name="windowIsTranslucent">true</item> <item name="windowSwipeToDismiss">true</item> <!-- Required to force windowInsets dispatch through application UI. --> <item name="windowOverscan">true</item> Loading @@ -42,9 +39,6 @@ <item name="windowBackground">@color/white</item> <item name="windowContentOverlay">@null</item> <item name="windowIsFloating">false</item> <!-- We need the windows to be translucent for SwipeToDismiss layout to work properly. --> <item name="windowIsTranslucent">true</item> <item name="windowSwipeToDismiss">true</item> <!-- Required to force windowInsets dispatch through application UI. --> <item name="windowOverscan">true</item> Loading policy/src/com/android/internal/policy/impl/PhoneWindow.java +0 −6 Original line number Diff line number Diff line Loading @@ -4159,12 +4159,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { return mMediaController; } private boolean isTranslucent() { TypedArray a = getWindowStyle(); return a.getBoolean(a.getResourceId( R.styleable.Window_windowIsTranslucent, 0), false); } @Override public void setEnterTransition(Transition enterTransition) { mEnterTransition = enterTransition; Loading services/core/java/com/android/server/am/ActivityRecord.java +8 −2 Original line number Diff line number Diff line Loading @@ -474,10 +474,16 @@ final class ActivityRecord { AttributeCache.Entry ent = AttributeCache.instance().get(packageName, realTheme, com.android.internal.R.styleable.Window, userId); final boolean translucent = ent.array.getBoolean( com.android.internal.R.styleable.Window_windowIsTranslucent, false) || (!ent.array.hasValue( com.android.internal.R.styleable.Window_windowIsTranslucent) && ent.array.getBoolean( com.android.internal.R.styleable.Window_windowSwipeToDismiss, false)); fullscreen = ent != null && !ent.array.getBoolean( com.android.internal.R.styleable.Window_windowIsFloating, false) && !ent.array.getBoolean( com.android.internal.R.styleable.Window_windowIsTranslucent, false); && !translucent; noDisplay = ent != null && ent.array.getBoolean( com.android.internal.R.styleable.Window_windowNoDisplay, false); Loading Loading
core/java/com/android/internal/widget/SwipeDismissLayout.java +10 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.internal.widget; import android.animation.TimeInterpolator; import android.app.Activity; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; Loading @@ -38,6 +39,7 @@ public class SwipeDismissLayout extends FrameLayout { private static final String TAG = "SwipeDismissLayout"; private static final float DISMISS_MIN_DRAG_WIDTH_RATIO = .33f; private boolean mUseDynamicTranslucency = true; public interface OnDismissedListener { void onDismissed(SwipeDismissLayout layout); Loading Loading @@ -85,7 +87,7 @@ public class SwipeDismissLayout extends FrameLayout { // and temporarily disables translucency when it is fully visible. // As soon as the user starts swiping, we will re-enable // translucency. if (getContext() instanceof Activity) { if (mUseDynamicTranslucency && getContext() instanceof Activity) { ((Activity) getContext()).convertFromTranslucent(); } } Loading Loading @@ -117,6 +119,11 @@ public class SwipeDismissLayout extends FrameLayout { android.R.integer.config_shortAnimTime); mCancelInterpolator = new DecelerateInterpolator(1.5f); mDismissInterpolator = new AccelerateInterpolator(1.5f); TypedArray a = context.getTheme().obtainStyledAttributes( com.android.internal.R.styleable.Theme); mUseDynamicTranslucency = !a.hasValue( com.android.internal.R.styleable.Window_windowIsTranslucent); a.recycle(); } public void setOnDismissedListener(OnDismissedListener listener) { Loading Loading @@ -230,7 +237,7 @@ public class SwipeDismissLayout extends FrameLayout { mLastX = ev.getRawX(); updateSwiping(ev); if (mSwiping) { if (getContext() instanceof Activity) { if (mUseDynamicTranslucency && getContext() instanceof Activity) { ((Activity) getContext()).convertToTranslucent(null, null); } setProgress(ev.getRawX() - mDownX); Loading @@ -254,7 +261,7 @@ public class SwipeDismissLayout extends FrameLayout { } protected void cancel() { if (getContext() instanceof Activity) { if (mUseDynamicTranslucency && getContext() instanceof Activity) { ((Activity) getContext()).convertFromTranslucent(); } if (mProgressListener != null) { Loading
core/res/res/values/attrs.xml +6 −2 Original line number Diff line number Diff line Loading @@ -329,7 +329,9 @@ <attr name="windowOverscan" format="boolean" /> <!-- Flag indicating whether this is a floating window. --> <attr name="windowIsFloating" format="boolean" /> <!-- Flag indicating whether this is a translucent window. --> <!-- Flag indicating whether this is a translucent window. If this attribute is unset (but not if set to false), the window might still be considered translucent, if windowSwipeToDismiss is set to true. --> <attr name="windowIsTranslucent" format="boolean" /> <!-- Flag indicating that this window's background should be the user's current wallpaper. Corresponds Loading Loading @@ -455,7 +457,9 @@ <attr name="windowTranslucentNavigation" format="boolean" /> <!-- Flag to indicate that a window can be swiped away to be dismissed. Corresponds to {@link android.view.Window#FEATURE_SWIPE_TO_DISMISS} --> Corresponds to {@link android.view.Window#FEATURE_SWIPE_TO_DISMISS}. It will also dynamically change translucency of the window, if the windowIsTranslucent is not set. If windowIsTranslucent is set (to either true or false) it will obey that setting. --> <attr name="windowSwipeToDismiss" format="boolean" /> <!-- Flag indicating whether this window requests that content changes be performed Loading
core/res/res/values/themes_micro.xml +0 −6 Original line number Diff line number Diff line Loading @@ -24,9 +24,6 @@ <item name="windowBackground">@color/black</item> <item name="windowContentOverlay">@null</item> <item name="windowIsFloating">false</item> <!-- We need the windows to be translucent for SwipeToDismiss layout to work properly. --> <item name="windowIsTranslucent">true</item> <item name="windowSwipeToDismiss">true</item> <!-- Required to force windowInsets dispatch through application UI. --> <item name="windowOverscan">true</item> Loading @@ -42,9 +39,6 @@ <item name="windowBackground">@color/white</item> <item name="windowContentOverlay">@null</item> <item name="windowIsFloating">false</item> <!-- We need the windows to be translucent for SwipeToDismiss layout to work properly. --> <item name="windowIsTranslucent">true</item> <item name="windowSwipeToDismiss">true</item> <!-- Required to force windowInsets dispatch through application UI. --> <item name="windowOverscan">true</item> Loading
policy/src/com/android/internal/policy/impl/PhoneWindow.java +0 −6 Original line number Diff line number Diff line Loading @@ -4159,12 +4159,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { return mMediaController; } private boolean isTranslucent() { TypedArray a = getWindowStyle(); return a.getBoolean(a.getResourceId( R.styleable.Window_windowIsTranslucent, 0), false); } @Override public void setEnterTransition(Transition enterTransition) { mEnterTransition = enterTransition; Loading
services/core/java/com/android/server/am/ActivityRecord.java +8 −2 Original line number Diff line number Diff line Loading @@ -474,10 +474,16 @@ final class ActivityRecord { AttributeCache.Entry ent = AttributeCache.instance().get(packageName, realTheme, com.android.internal.R.styleable.Window, userId); final boolean translucent = ent.array.getBoolean( com.android.internal.R.styleable.Window_windowIsTranslucent, false) || (!ent.array.hasValue( com.android.internal.R.styleable.Window_windowIsTranslucent) && ent.array.getBoolean( com.android.internal.R.styleable.Window_windowSwipeToDismiss, false)); fullscreen = ent != null && !ent.array.getBoolean( com.android.internal.R.styleable.Window_windowIsFloating, false) && !ent.array.getBoolean( com.android.internal.R.styleable.Window_windowIsTranslucent, false); && !translucent; noDisplay = ent != null && ent.array.getBoolean( com.android.internal.R.styleable.Window_windowNoDisplay, false); Loading