Merge "Reorder brightness slider mirror in front of album art" into lmp-dev
diff --git a/api/current.txt b/api/current.txt
index dca7481..77dc6f8 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -3544,8 +3544,8 @@
method public void setContentView(android.view.View);
method public void setContentView(android.view.View, android.view.ViewGroup.LayoutParams);
method public final void setDefaultKeyMode(int);
- method public void setEnterSharedElementListener(android.app.SharedElementListener);
- method public void setExitSharedElementListener(android.app.SharedElementListener);
+ method public void setEnterSharedElementCallback(android.app.SharedElementCallback);
+ method public void setExitSharedElementCallback(android.app.SharedElementCallback);
method public final void setFeatureDrawable(int, android.graphics.drawable.Drawable);
method public final void setFeatureDrawableAlpha(int, int);
method public final void setFeatureDrawableResource(int, int);
@@ -4319,9 +4319,9 @@
method public void setAllowEnterTransitionOverlap(boolean);
method public void setAllowReturnTransitionOverlap(boolean);
method public void setArguments(android.os.Bundle);
- method public void setEnterSharedElementTransitionListener(android.app.SharedElementListener);
+ method public void setEnterSharedElementTransitionCallback(android.app.SharedElementCallback);
method public void setEnterTransition(android.transition.Transition);
- method public void setExitSharedElementTransitionListener(android.app.SharedElementListener);
+ method public void setExitSharedElementTransitionCallback(android.app.SharedElementCallback);
method public void setExitTransition(android.transition.Transition);
method public void setHasOptionsMenu(boolean);
method public void setInitialSavedState(android.app.Fragment.SavedState);
@@ -5192,14 +5192,14 @@
field public static final int START_STICKY_COMPATIBILITY = 0; // 0x0
}
- public abstract class SharedElementListener {
- ctor public SharedElementListener();
- method public android.os.Parcelable captureSharedElementSnapshot(android.view.View, android.graphics.Matrix, android.graphics.RectF);
- method public android.view.View createSnapshotView(android.content.Context, android.os.Parcelable);
- method public void handleRejectedSharedElements(java.util.List<android.view.View>);
- method public void remapSharedElements(java.util.List<java.lang.String>, java.util.Map<java.lang.String, android.view.View>);
- method public void setSharedElementEnd(java.util.List<java.lang.String>, java.util.List<android.view.View>, java.util.List<android.view.View>);
- method public void setSharedElementStart(java.util.List<java.lang.String>, java.util.List<android.view.View>, java.util.List<android.view.View>);
+ public abstract class SharedElementCallback {
+ ctor public SharedElementCallback();
+ method public android.os.Parcelable onCaptureSharedElementSnapshot(android.view.View, android.graphics.Matrix, android.graphics.RectF);
+ method public android.view.View onCreateSnapshotView(android.content.Context, android.os.Parcelable);
+ method public void onMapSharedElements(java.util.List<java.lang.String>, java.util.Map<java.lang.String, android.view.View>);
+ method public void onRejectSharedElements(java.util.List<android.view.View>);
+ method public void onSharedElementEnd(java.util.List<java.lang.String>, java.util.List<android.view.View>, java.util.List<android.view.View>);
+ method public void onSharedElementStart(java.util.List<java.lang.String>, java.util.List<android.view.View>, java.util.List<android.view.View>);
}
public deprecated class TabActivity extends android.app.ActivityGroup {
@@ -5875,7 +5875,7 @@
field public static final int RESIZE_VERTICAL = 2; // 0x2
field public static final int WIDGET_CATEGORY_HOME_SCREEN = 1; // 0x1
field public static final int WIDGET_CATEGORY_KEYGUARD = 2; // 0x2
- field public static final int WIDGET_CATEGORY_RECENTS = 4; // 0x4
+ field public static final int WIDGET_CATEGORY_SEARCHBOX = 4; // 0x4
field public int autoAdvanceViewId;
field public android.content.ComponentName configure;
field public int icon;
@@ -36827,7 +36827,7 @@
method public void setWebViewClient(android.webkit.WebViewClient);
method public deprecated boolean showFindDialog(java.lang.String, boolean);
method public void stopLoading();
- method public boolean zoomBy(float);
+ method public void zoomBy(float);
method public boolean zoomIn();
method public boolean zoomOut();
field public static final java.lang.String SCHEME_GEO = "geo:0,0?q=";
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 8f0266c..89a9692 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -788,8 +788,8 @@
final Handler mHandler = new Handler();
ActivityTransitionState mActivityTransitionState = new ActivityTransitionState();
- SharedElementListener mEnterTransitionListener = SharedElementListener.NULL_LISTENER;
- SharedElementListener mExitTransitionListener = SharedElementListener.NULL_LISTENER;
+ SharedElementCallback mEnterTransitionListener = SharedElementCallback.NULL_CALLBACK;
+ SharedElementCallback mExitTransitionListener = SharedElementCallback.NULL_CALLBACK;
/** Return the intent that started this activity. */
public Intent getIntent() {
@@ -5779,33 +5779,33 @@
/**
* When {@link android.app.ActivityOptions#makeSceneTransitionAnimation(Activity,
- * android.view.View, String)} was used to start an Activity, <var>listener</var>
+ * android.view.View, String)} was used to start an Activity, <var>callback</var>
* will be called to handle shared elements on the <i>launched</i> Activity. This requires
* {@link Window#FEATURE_CONTENT_TRANSITIONS}.
*
- * @param listener Used to manipulate shared element transitions on the launched Activity.
+ * @param callback Used to manipulate shared element transitions on the launched Activity.
*/
- public void setEnterSharedElementListener(SharedElementListener listener) {
- if (listener == null) {
- listener = SharedElementListener.NULL_LISTENER;
+ public void setEnterSharedElementCallback(SharedElementCallback callback) {
+ if (callback == null) {
+ callback = SharedElementCallback.NULL_CALLBACK;
}
- mEnterTransitionListener = listener;
+ mEnterTransitionListener = callback;
}
/**
* When {@link android.app.ActivityOptions#makeSceneTransitionAnimation(Activity,
- * android.view.View, String)} was used to start an Activity, <var>listener</var>
+ * android.view.View, String)} was used to start an Activity, <var>callback</var>
* will be called to handle shared elements on the <i>launching</i> Activity. Most
* calls will only come when returning from the started Activity.
* This requires {@link Window#FEATURE_CONTENT_TRANSITIONS}.
*
- * @param listener Used to manipulate shared element transitions on the launching Activity.
+ * @param callback Used to manipulate shared element transitions on the launching Activity.
*/
- public void setExitSharedElementListener(SharedElementListener listener) {
- if (listener == null) {
- listener = SharedElementListener.NULL_LISTENER;
+ public void setExitSharedElementCallback(SharedElementCallback callback) {
+ if (callback == null) {
+ callback = SharedElementCallback.NULL_CALLBACK;
}
- mExitTransitionListener = listener;
+ mExitTransitionListener = callback;
}
/**
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java
index a09a2e7..0cac6a5 100644
--- a/core/java/android/app/ActivityTransitionCoordinator.java
+++ b/core/java/android/app/ActivityTransitionCoordinator.java
@@ -197,7 +197,7 @@
final protected ArrayList<View> mSharedElements = new ArrayList<View>();
final protected ArrayList<String> mSharedElementNames = new ArrayList<String>();
final protected ArrayList<View> mTransitioningViews = new ArrayList<View>();
- protected SharedElementListener mListener;
+ protected SharedElementCallback mListener;
protected ResultReceiver mResultReceiver;
final private FixedEpicenterCallback mEpicenterCallback = new FixedEpicenterCallback();
final protected boolean mIsReturning;
@@ -208,7 +208,7 @@
public ActivityTransitionCoordinator(Window window,
ArrayList<String> allSharedElementNames,
- SharedElementListener listener, boolean isReturning) {
+ SharedElementCallback listener, boolean isReturning) {
super(new Handler());
mWindow = window;
mListener = listener;
@@ -218,7 +218,7 @@
protected void viewsReady(ArrayMap<String, View> sharedElements) {
sharedElements.retainAll(mAllSharedElementNames);
- mListener.remapSharedElements(mAllSharedElementNames, sharedElements);
+ mListener.onMapSharedElements(mAllSharedElementNames, sharedElements);
mSharedElementNames.addAll(sharedElements.keySet());
mSharedElements.addAll(sharedElements.values());
if (getViewsTransition() != null) {
@@ -458,12 +458,12 @@
tempMatrix, tempRect, null);
}
}
- mListener.setSharedElementStart(mSharedElementNames, mSharedElements, snapshots);
+ mListener.onSharedElementStart(mSharedElementNames, mSharedElements, snapshots);
return originalImageState;
}
protected void notifySharedElementEnd(ArrayList<View> snapshots) {
- mListener.setSharedElementEnd(mSharedElementNames, mSharedElements, snapshots);
+ mListener.onSharedElementEnd(mSharedElementNames, mSharedElements, snapshots);
}
protected void scheduleSetSharedElementEnd(final ArrayList<View> snapshots) {
@@ -526,7 +526,7 @@
Parcelable parcelable = sharedElementBundle.getParcelable(KEY_SNAPSHOT);
View snapshot = null;
if (parcelable != null) {
- snapshot = mListener.createSnapshotView(context, parcelable);
+ snapshot = mListener.onCreateSnapshotView(context, parcelable);
}
if (snapshot != null) {
setSharedElementState(snapshot, name, state, null, null, decorLoc);
@@ -618,7 +618,7 @@
sharedElementBundle.putFloat(KEY_TRANSLATION_Z, view.getTranslationZ());
sharedElementBundle.putFloat(KEY_ELEVATION, view.getElevation());
- Parcelable bitmap = mListener.captureSharedElementSnapshot(view, tempMatrix, tempBounds);
+ Parcelable bitmap = mListener.onCaptureSharedElementSnapshot(view, tempMatrix, tempBounds);
if (bitmap != null) {
sharedElementBundle.putParcelable(KEY_SNAPSHOT, bitmap);
}
diff --git a/core/java/android/app/BackStackRecord.java b/core/java/android/app/BackStackRecord.java
index 59f010c..8227915 100644
--- a/core/java/android/app/BackStackRecord.java
+++ b/core/java/android/app/BackStackRecord.java
@@ -1128,11 +1128,11 @@
}
if (isBack) {
- outFragment.mEnterTransitionListener.remapSharedElements(
+ outFragment.mEnterTransitionCallback.onMapSharedElements(
mSharedElementTargetNames, namedViews);
setBackNameOverrides(state, namedViews, false);
} else {
- outFragment.mExitTransitionListener.remapSharedElements(
+ outFragment.mExitTransitionCallback.onMapSharedElements(
mSharedElementTargetNames, namedViews);
setNameOverrides(state, namedViews, false);
}
@@ -1248,14 +1248,14 @@
}
// Notify the start of the transition.
- SharedElementListener listener = isBack ?
- outFragment.mEnterTransitionListener :
- inFragment.mEnterTransitionListener;
+ SharedElementCallback callback = isBack ?
+ outFragment.mEnterTransitionCallback :
+ inFragment.mEnterTransitionCallback;
tempNames.clear();
tempNames.addAll(namedViews.keySet());
tempViewList.clear();
tempViewList.addAll(namedViews.values());
- listener.setSharedElementStart(tempNames, tempViewList, null);
+ callback.onSharedElementStart(tempNames, tempViewList, null);
// Set the epicenter of the exit transition
if (mSharedElementTargetNames != null && exitTransition != null) {
@@ -1337,11 +1337,11 @@
tempViews2, isBack);
// remap shared elements and set the name mapping used in the shared element transition.
if (isBack) {
- inFragment.mExitTransitionListener.remapSharedElements(
+ inFragment.mExitTransitionCallback.onMapSharedElements(
mSharedElementTargetNames, namedViews);
setBackNameOverrides(state, namedViews, true);
} else {
- inFragment.mEnterTransitionListener.remapSharedElements(
+ inFragment.mEnterTransitionCallback.onMapSharedElements(
mSharedElementTargetNames, namedViews);
setNameOverrides(state, namedViews, true);
}
@@ -1355,14 +1355,14 @@
}
int containerId = inFragments.keyAt(i);
- SharedElementListener sharedElementListener = isBack ?
- outFragments.get(containerId).mEnterTransitionListener :
- inFragment.mEnterTransitionListener;
+ SharedElementCallback sharedElementCallback = isBack ?
+ outFragments.get(containerId).mEnterTransitionCallback :
+ inFragment.mEnterTransitionCallback;
tempNames.clear();
tempNames.addAll(namedViews.keySet());
tempViews.clear();
tempViews.addAll(namedViews.values());
- sharedElementListener.setSharedElementEnd(tempNames, tempViews, null);
+ sharedElementCallback.onSharedElementEnd(tempNames, tempViews, null);
}
// Don't include any newly-hidden fragments in the transition.
diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java
index 4126647..2bc4166 100644
--- a/core/java/android/app/EnterTransitionCoordinator.java
+++ b/core/java/android/app/EnterTransitionCoordinator.java
@@ -21,8 +21,6 @@
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
import android.os.ResultReceiver;
import android.text.TextUtils;
import android.transition.Transition;
@@ -209,7 +207,7 @@
}
}
- private static SharedElementListener getListener(Activity activity, boolean isReturning) {
+ private static SharedElementCallback getListener(Activity activity, boolean isReturning) {
return isReturning ? activity.mExitTransitionListener : activity.mEnterTransitionListener;
}
@@ -294,7 +292,7 @@
ArrayList<String> rejectedNames = new ArrayList<String>(mAllSharedElementNames);
rejectedNames.removeAll(mSharedElementNames);
ArrayList<View> rejectedSnapshots = createSnapshots(sharedElementState, rejectedNames);
- mListener.handleRejectedSharedElements(rejectedSnapshots);
+ mListener.onRejectSharedElements(rejectedSnapshots);
startRejectedAnimations(rejectedSnapshots);
// Now start shared element transition
diff --git a/core/java/android/app/ExitTransitionCoordinator.java b/core/java/android/app/ExitTransitionCoordinator.java
index 231c93f..9d5557f 100644
--- a/core/java/android/app/ExitTransitionCoordinator.java
+++ b/core/java/android/app/ExitTransitionCoordinator.java
@@ -79,7 +79,7 @@
mActivity = activity;
}
- private static SharedElementListener getListener(Activity activity, boolean isReturning) {
+ private static SharedElementCallback getListener(Activity activity, boolean isReturning) {
return isReturning ? activity.mEnterTransitionListener : activity.mExitTransitionListener;
}
@@ -176,7 +176,7 @@
});
setGhostVisibility(View.INVISIBLE);
scheduleGhostVisibilityChange(View.INVISIBLE);
- mListener.setSharedElementEnd(mSharedElementNames, mSharedElements, sharedElementSnapshots);
+ mListener.onSharedElementEnd(mSharedElementNames, mSharedElements, sharedElementSnapshots);
TransitionManager.beginDelayedTransition(getDecor(), transition);
scheduleGhostVisibilityChange(View.VISIBLE);
setGhostVisibility(View.VISIBLE);
diff --git a/core/java/android/app/Fragment.java b/core/java/android/app/Fragment.java
index dbee81e..672ef7b 100644
--- a/core/java/android/app/Fragment.java
+++ b/core/java/android/app/Fragment.java
@@ -495,8 +495,8 @@
private Boolean mAllowReturnTransitionOverlap;
private Boolean mAllowEnterTransitionOverlap;
- SharedElementListener mEnterTransitionListener = SharedElementListener.NULL_LISTENER;
- SharedElementListener mExitTransitionListener = SharedElementListener.NULL_LISTENER;
+ SharedElementCallback mEnterTransitionCallback = SharedElementCallback.NULL_CALLBACK;
+ SharedElementCallback mExitTransitionCallback = SharedElementCallback.NULL_CALLBACK;
/**
* State information that has been retrieved from a fragment instance
@@ -1621,31 +1621,31 @@
}
/**
- * When custom transitions are used with Fragments, the enter transition listener
+ * When custom transitions are used with Fragments, the enter transition callback
* is called when this Fragment is attached or detached when not popping the back stack.
*
- * @param listener Used to manipulate the shared element transitions on this Fragment
+ * @param callback Used to manipulate the shared element transitions on this Fragment
* when added not as a pop from the back stack.
*/
- public void setEnterSharedElementTransitionListener(SharedElementListener listener) {
- if (listener == null) {
- listener = SharedElementListener.NULL_LISTENER;
+ public void setEnterSharedElementTransitionCallback(SharedElementCallback callback) {
+ if (callback == null) {
+ callback = SharedElementCallback.NULL_CALLBACK;
}
- mEnterTransitionListener = listener;
+ mEnterTransitionCallback = callback;
}
/**
- * When custom transitions are used with Fragments, the exit transition listener
+ * When custom transitions are used with Fragments, the exit transition callback
* is called when this Fragment is attached or detached when popping the back stack.
*
- * @param listener Used to manipulate the shared element transitions on this Fragment
+ * @param callback Used to manipulate the shared element transitions on this Fragment
* when added as a pop from the back stack.
*/
- public void setExitSharedElementTransitionListener(SharedElementListener listener) {
- if (listener == null) {
- listener = SharedElementListener.NULL_LISTENER;
+ public void setExitSharedElementTransitionCallback(SharedElementCallback callback) {
+ if (callback == null) {
+ callback = SharedElementCallback.NULL_CALLBACK;
}
- mExitTransitionListener = listener;
+ mExitTransitionCallback = callback;
}
/**
diff --git a/core/java/android/app/SharedElementListener.java b/core/java/android/app/SharedElementCallback.java
similarity index 64%
rename from core/java/android/app/SharedElementListener.java
rename to core/java/android/app/SharedElementCallback.java
index f36d05f..82d8e5b 100644
--- a/core/java/android/app/SharedElementListener.java
+++ b/core/java/android/app/SharedElementCallback.java
@@ -22,7 +22,6 @@
import android.graphics.Matrix;
import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
-import android.graphics.drawable.ColorDrawable;
import android.os.Parcelable;
import android.view.View;
@@ -31,28 +30,23 @@
/**
* Listener provided in
- * {@link Activity#setEnterSharedElementListener(SharedElementListener)} and
- * {@link Activity#setExitSharedElementListener(SharedElementListener)}
- * to monitor the Activity transitions. The events can be used to customize Activity
- * Transition behavior.
+ * {@link Activity#setEnterSharedElementCallback(SharedElementCallback)} and
+ * {@link Activity#setExitSharedElementCallback(SharedElementCallback)} as well as
+ * {@link Fragment#setEnterSharedElementTransitionCallback(SharedElementCallback)} and
+ * {@link Fragment#setExitSharedElementTransitionCallback(SharedElementCallback)}
+ * to monitor the Shared element transitions. The events can be used to customize Activity
+ * and Fragment Transition behavior.
*/
-public abstract class SharedElementListener {
+public abstract class SharedElementCallback {
private Matrix mTempMatrix;
- static final SharedElementListener NULL_LISTENER = new SharedElementListener() {
+ static final SharedElementCallback NULL_CALLBACK = new SharedElementCallback() {
};
/**
- * Called to allow the listener to customize the start state of the shared element when
- * transferring in shared element state.
- * <p>
- * The shared element will start at the size and position of the shared element
- * in the launching Activity or Fragment. It will also transfer ImageView scaleType
- * and imageMatrix if the shared elements in the calling and called Activities are
- * ImageViews. Some applications may want to make additional changes, such as
- * changing the clip bounds, scaling, or rotation if the shared element end state
- * does not map well to the start state.
- * </p>
+ * Called immediately after the start state is set for the shared element.
+ * The shared element will start at the size and position of the shared element
+ * in the launching Activity or Fragment.
*
* @param sharedElementNames The names of the shared elements that were accepted into
* the View hierarchy.
@@ -60,20 +54,21 @@
* @param sharedElementSnapshots The Views containing snap shots of the shared element
* from the launching Window. These elements will not
* be part of the scene, but will be positioned relative
- * to the Window decor View.
+ * to the Window decor View. This list is null for Fragment
+ * Transitions.
*/
- public void setSharedElementStart(List<String> sharedElementNames,
+ public void onSharedElementStart(List<String> sharedElementNames,
List<View> sharedElements, List<View> sharedElementSnapshots) {}
/**
- * Called to allow the listener to customize the end state of the shared element when
- * transferring in shared element state.
+ * Called after the end state is set for the shared element, but before the end state
+ * is captured by the shared element transition.
* <p>
* Any customization done in
- * {@link #setSharedElementStart(java.util.List, java.util.List, java.util.List)}
+ * {@link #onSharedElementStart(java.util.List, java.util.List, java.util.List)}
* may need to be modified to the final state of the shared element if it is not
* automatically corrected by layout. For example, rotation or scale will not
- * be affected by layout and if changed in {@link #setSharedElementStart(java.util.List,
+ * be affected by layout and if changed in {@link #onSharedElementStart(java.util.List,
* java.util.List, java.util.List)}, it will also have to be set here again to correct
* the end state.
* </p>
@@ -84,24 +79,27 @@
* @param sharedElementSnapshots The Views containing snap shots of the shared element
* from the launching Window. These elements will not
* be part of the scene, but will be positioned relative
- * to the Window decor View.
+ * to the Window decor View. This list will be null for
+ * Fragment Transitions.
*/
- public void setSharedElementEnd(List<String> sharedElementNames,
+ public void onSharedElementEnd(List<String> sharedElementNames,
List<View> sharedElements, List<View> sharedElementSnapshots) {}
/**
- * Called after {@link #remapSharedElements(java.util.List, java.util.Map)} when
+ * Called after {@link #onMapSharedElements(java.util.List, java.util.Map)} when
* transferring shared elements in. Any shared elements that have no mapping will be in
* <var>rejectedSharedElements</var>. The elements remaining in
* <var>rejectedSharedElements</var> will be transitioned out of the Scene. If a
* View is removed from <var>rejectedSharedElements</var>, it must be handled by the
- * <code>SharedElementListener</code>.
+ * <code>SharedElementCallback</code>.
* <p>
* Views in rejectedSharedElements will have their position and size set to the
* position of the calling shared element, relative to the Window decor View and contain
* snapshots of the View from the calling Activity or Fragment. This
* view may be safely added to the decor View's overlay to remain in position.
* </p>
+ * <p>This method is not called for Fragment Transitions. All rejected shared elements
+ * will be handled by the exit transition.</p>
*
* @param rejectedSharedElements Views containing visual information of shared elements
* that are not part of the entering scene. These Views
@@ -109,25 +107,27 @@
* View removed from this list will not be transitioned
* automatically.
*/
- public void handleRejectedSharedElements(List<View> rejectedSharedElements) {}
+ public void onRejectSharedElements(List<View> rejectedSharedElements) {}
/**
- * Lets the ActivityTransitionListener adjust the mapping of shared element names to
+ * Lets the SharedElementCallback adjust the mapping of shared element names to
* Views.
*
* @param names The names of all shared elements transferred from the calling Activity
- * to the started Activity.
+ * or Fragment in the order they were provided.
* @param sharedElements The mapping of shared element names to Views. The best guess
* will be filled into sharedElements based on the transitionNames.
*/
- public void remapSharedElements(List<String> names, Map<String, View> sharedElements) {}
+ public void onMapSharedElements(List<String> names, Map<String, View> sharedElements) {}
/**
* Creates a snapshot of a shared element to be used by the remote Activity and reconstituted
- * with {@link #createSnapshotView(android.content.Context, android.os.Parcelable)}. A
+ * with {@link #onCreateSnapshotView(android.content.Context, android.os.Parcelable)}. A
* null return value will mean that the remote Activity will have a null snapshot View in
- * {@link #setSharedElementStart(java.util.List, java.util.List, java.util.List)} and
- * {@link #setSharedElementEnd(java.util.List, java.util.List, java.util.List)}.
+ * {@link #onSharedElementStart(java.util.List, java.util.List, java.util.List)} and
+ * {@link #onSharedElementEnd(java.util.List, java.util.List, java.util.List)}.
+ *
+ * <p>This is not called for Fragment Transitions.</p>
*
* @param sharedElement The shared element View to create a snapshot for.
* @param viewToGlobalMatrix A matrix containing a transform from the view to the screen
@@ -135,11 +135,11 @@
* @param screenBounds The bounds of shared element in screen coordinate space. This is
* the bounds of the view with the viewToGlobalMatrix applied.
* @return A snapshot to send to the remote Activity to be reconstituted with
- * {@link #createSnapshotView(android.content.Context, android.os.Parcelable)} and passed
- * into {@link #setSharedElementStart(java.util.List, java.util.List, java.util.List)} and
- * {@link #setSharedElementEnd(java.util.List, java.util.List, java.util.List)}.
+ * {@link #onCreateSnapshotView(android.content.Context, android.os.Parcelable)} and passed
+ * into {@link #onSharedElementStart(java.util.List, java.util.List, java.util.List)} and
+ * {@link #onSharedElementEnd(java.util.List, java.util.List, java.util.List)}.
*/
- public Parcelable captureSharedElementSnapshot(View sharedElement, Matrix viewToGlobalMatrix,
+ public Parcelable onCaptureSharedElementSnapshot(View sharedElement, Matrix viewToGlobalMatrix,
RectF screenBounds) {
int bitmapWidth = Math.round(screenBounds.width());
int bitmapHeight = Math.round(screenBounds.height());
@@ -160,20 +160,22 @@
/**
* Reconstitutes a snapshot View from a Parcelable returned in
- * {@link #captureSharedElementSnapshot(android.view.View, android.graphics.Matrix,
- * android.graphics.RectF)} to be used in {@link #setSharedElementStart(java.util.List,
- * java.util.List, java.util.List)} and {@link #setSharedElementEnd(java.util.List,
+ * {@link #onCaptureSharedElementSnapshot(android.view.View, android.graphics.Matrix,
+ * android.graphics.RectF)} to be used in {@link #onSharedElementStart(java.util.List,
+ * java.util.List, java.util.List)} and {@link #onSharedElementEnd(java.util.List,
* java.util.List, java.util.List)}. The returned View will be sized and positioned after
* this call so that it is ready to be added to the decor View's overlay.
*
+ * <p>This is not called for Fragment Transitions.</p>
+ *
* @param context The Context used to create the snapshot View.
- * @param snapshot The Parcelable returned by {@link #captureSharedElementSnapshot(
+ * @param snapshot The Parcelable returned by {@link #onCaptureSharedElementSnapshot(
* android.view.View, android.graphics.Matrix, android.graphics.RectF)}.
- * @return A View to be sent in {@link #setSharedElementStart(java.util.List, java.util.List,
- * java.util.List)} and {@link #setSharedElementEnd(java.util.List, java.util.List,
+ * @return A View to be sent in {@link #onSharedElementStart(java.util.List, java.util.List,
+ * java.util.List)} and {@link #onSharedElementEnd(java.util.List, java.util.List,
* java.util.List)}. A null value will produce a null snapshot value for those two methods.
*/
- public View createSnapshotView(Context context, Parcelable snapshot) {
+ public View onCreateSnapshotView(Context context, Parcelable snapshot) {
View view = null;
if (snapshot instanceof Bitmap) {
Bitmap bitmap = (Bitmap) snapshot;
diff --git a/core/java/android/appwidget/AppWidgetManager.java b/core/java/android/appwidget/AppWidgetManager.java
index bd45c7e..00248cc 100644
--- a/core/java/android/appwidget/AppWidgetManager.java
+++ b/core/java/android/appwidget/AppWidgetManager.java
@@ -188,7 +188,7 @@
* this widget. Can have the value {@link
* AppWidgetProviderInfo#WIDGET_CATEGORY_HOME_SCREEN} or {@link
* AppWidgetProviderInfo#WIDGET_CATEGORY_KEYGUARD} or {@link
- * AppWidgetProviderInfo#WIDGET_CATEGORY_RECENTS}.
+ * AppWidgetProviderInfo#WIDGET_CATEGORY_SEARCHBOX}.
*/
public static final String OPTION_APPWIDGET_HOST_CATEGORY = "appWidgetCategory";
diff --git a/core/java/android/appwidget/AppWidgetProviderInfo.java b/core/java/android/appwidget/AppWidgetProviderInfo.java
index 02f70c8..b4d79b4 100644
--- a/core/java/android/appwidget/AppWidgetProviderInfo.java
+++ b/core/java/android/appwidget/AppWidgetProviderInfo.java
@@ -61,9 +61,9 @@
public static final int WIDGET_CATEGORY_KEYGUARD = 2;
/**
- * Indicates that the widget can be displayed within recents.
+ * Indicates that the widget can be displayed within a space reserved for the search box.
*/
- public static final int WIDGET_CATEGORY_RECENTS = 4;
+ public static final int WIDGET_CATEGORY_SEARCHBOX = 4;
/**
* Identity of this AppWidget component. This component should be a {@link
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index edfa7af..081bfdf 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -1939,16 +1939,14 @@
*
* @param zoomFactor the zoom factor to apply. The zoom factor will be clamped to the Webview's
* zoom limits. This value must be in the range 0.01 to 100.0 inclusive.
- *
- * @return false if no zoom changes, true otherwise.
*/
- public boolean zoomBy(float zoomFactor) {
+ public void zoomBy(float zoomFactor) {
checkThread();
if (zoomFactor < 0.01)
throw new IllegalArgumentException("zoomFactor must be greater than 0.01.");
if (zoomFactor > 100.0)
throw new IllegalArgumentException("zoomFactor must be less than 100.");
- return mProvider.zoomBy(zoomFactor);
+ mProvider.zoomBy(zoomFactor);
}
/**
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 603fcde..3629cbb 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -6600,12 +6600,12 @@
<flag name="vertical" value="0x2" />
</attr>
<!-- Optional parameter which indicates where this widget can be shown,
- ie. home screen, keyguard, recents or any combination thereof.
+ ie. home screen, keyguard, search bar or any combination thereof.
Supports combined values using | operator. -->
<attr name="widgetCategory" format="integer">
<flag name="home_screen" value="0x1" />
<flag name="keyguard" value="0x2" />
- <flag name="recents" value="0x4" />
+ <flag name="searchbox" value="0x4" />
</attr>
</declare-styleable>
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index 082dde6..ec7799a 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -296,7 +296,7 @@
mSearchAppWidgetInfo);
Bundle opts = new Bundle();
opts.putInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY,
- AppWidgetProviderInfo.WIDGET_CATEGORY_RECENTS);
+ AppWidgetProviderInfo.WIDGET_CATEGORY_SEARCHBOX);
mSearchAppWidgetHostView.updateAppWidgetOptions(opts);
// Set the padding to 0 for this search widget
mSearchAppWidgetHostView.setPadding(0, 0, 0, 0);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
index e27c0ac..78fc4fb 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
@@ -392,7 +392,7 @@
// Find the first Recents widget from the same package as the global assist activity
List<AppWidgetProviderInfo> widgets = mAwm.getInstalledProviders(
- AppWidgetProviderInfo.WIDGET_CATEGORY_RECENTS);
+ AppWidgetProviderInfo.WIDGET_CATEGORY_SEARCHBOX);
for (AppWidgetProviderInfo info : widgets) {
if (info.provider.getPackageName().equals(mAssistComponent.getPackageName())) {
return info;
@@ -418,7 +418,7 @@
int searchWidgetId = host.allocateAppWidgetId();
Bundle opts = new Bundle();
opts.putInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY,
- AppWidgetProviderInfo.WIDGET_CATEGORY_RECENTS);
+ AppWidgetProviderInfo.WIDGET_CATEGORY_SEARCHBOX);
if (!mAwm.bindAppWidgetIdIfAllowed(searchWidgetId, searchWidgetInfo.provider, opts)) {
return null;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 9898f45..e5ca488 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -1625,10 +1625,11 @@
}
}
boolean showOnKeyguard = shouldShowOnKeyguard(entry.notification);
- if (onKeyguard && (visibleNotifications >= maxKeyguardNotifications
- || !showOnKeyguard)) {
+ if ((isLockscreenPublicMode() && !showOnKeyguard) ||
+ (onKeyguard && (visibleNotifications >= maxKeyguardNotifications
+ || !showOnKeyguard))) {
entry.row.setVisibility(View.GONE);
- if (showOnKeyguard) {
+ if (onKeyguard && showOnKeyguard) {
mKeyguardIconOverflowContainer.getIconsView().addNotification(entry);
}
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
index e3a0b18..c13593a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
@@ -147,6 +147,7 @@
mMaxExpandHeight = 0;
mWasReset = true;
onHeightReset();
+ requestLayout();
}
@Override
diff --git a/services/core/java/com/android/server/notification/ConditionProviders.java b/services/core/java/com/android/server/notification/ConditionProviders.java
index 189131c..05ad1fe 100644
--- a/services/core/java/com/android/server/notification/ConditionProviders.java
+++ b/services/core/java/com/android/server/notification/ConditionProviders.java
@@ -545,8 +545,9 @@
setZenModeCondition(condition, "downtime");
}
// exit downtime
- if (!inDowntime && mode == Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS
- && mDowntime.isDowntimeCondition(mExitCondition)) {
+ if (!inDowntime && mDowntime.isDowntimeCondition(mExitCondition)
+ && (mode == Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS
+ || mode == Global.ZEN_MODE_NO_INTERRUPTIONS)) {
mZenModeHelper.setZenMode(Global.ZEN_MODE_OFF, "downtimeExit");
}
}