summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt16
-rw-r--r--core/java/android/app/Activity.java14
-rw-r--r--core/java/android/app/ActivityThread.java4
-rw-r--r--core/java/android/app/ActivityTransitionCoordinator.java31
-rw-r--r--core/java/android/app/ExitTransitionCoordinator.java1
-rw-r--r--core/java/android/provider/CallLog.java9
-rw-r--r--core/java/android/widget/AutoCompleteTextView.java48
-rw-r--r--core/res/res/layout/notification_template_material_big_base.xml2
-rw-r--r--core/res/res/layout/notification_template_material_big_media.xml12
-rw-r--r--core/res/res/layout/notification_template_material_big_text.xml2
-rw-r--r--core/res/res/layout/notification_template_material_inbox.xml16
-rw-r--r--core/res/res/layout/notification_template_material_media.xml10
-rw-r--r--core/res/res/layout/notification_template_part_chronometer.xml2
-rw-r--r--core/res/res/layout/notification_template_part_line1.xml2
-rw-r--r--core/res/res/layout/notification_template_part_line2.xml2
-rw-r--r--core/res/res/layout/notification_template_part_line3.xml4
-rw-r--r--core/res/res/layout/notification_template_part_time.xml2
-rw-r--r--core/res/res/values/public.xml14
-rw-r--r--core/res/res/values/styles_material.xml18
-rw-r--r--core/res/res/values/themes_material.xml2
-rw-r--r--libs/hwui/DisplayListOp.h3
-rw-r--r--libs/hwui/RenderNode.cpp53
-rw-r--r--libs/hwui/RenderNode.h11
-rw-r--r--libs/hwui/StatefulBaseRenderer.cpp4
-rw-r--r--libs/hwui/StatefulBaseRenderer.h9
-rw-r--r--packages/SystemUI/res/layout/notification_guts.xml6
-rw-r--r--packages/SystemUI/res/values/styles.xml4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java2
28 files changed, 142 insertions, 161 deletions
diff --git a/api/current.txt b/api/current.txt
index c96213d..ec00363 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -2025,6 +2025,12 @@ package android {
field public static final int TextAppearance_Material_Medium = 16974355; // 0x1030213
field public static final int TextAppearance_Material_Medium_Inverse = 16974356; // 0x1030214
field public static final int TextAppearance_Material_Menu = 16974554; // 0x10302da
+ field public static final int TextAppearance_Material_Notification = 16974560; // 0x10302e0
+ field public static final int TextAppearance_Material_Notification_Emphasis = 16974565; // 0x10302e5
+ field public static final int TextAppearance_Material_Notification_Info = 16974563; // 0x10302e3
+ field public static final int TextAppearance_Material_Notification_Line2 = 16974562; // 0x10302e2
+ field public static final int TextAppearance_Material_Notification_Time = 16974564; // 0x10302e4
+ field public static final int TextAppearance_Material_Notification_Title = 16974561; // 0x10302e1
field public static final int TextAppearance_Material_SearchResult_Subtitle = 16974357; // 0x1030215
field public static final int TextAppearance_Material_SearchResult_Title = 16974358; // 0x1030216
field public static final int TextAppearance_Material_Small = 16974359; // 0x1030217
@@ -2063,13 +2069,6 @@ package android {
field public static final int TextAppearance_StatusBar_EventContent = 16973927; // 0x1030067
field public static final int TextAppearance_StatusBar_EventContent_Title = 16973928; // 0x1030068
field public static final int TextAppearance_StatusBar_Icon = 16973926; // 0x1030066
- field public static final int TextAppearance_StatusBar_Material = 16974559; // 0x10302df
- field public static final int TextAppearance_StatusBar_Material_EventContent = 16974560; // 0x10302e0
- field public static final int TextAppearance_StatusBar_Material_EventContent_Emphasis = 16974565; // 0x10302e5
- field public static final int TextAppearance_StatusBar_Material_EventContent_Info = 16974563; // 0x10302e3
- field public static final int TextAppearance_StatusBar_Material_EventContent_Line2 = 16974562; // 0x10302e2
- field public static final int TextAppearance_StatusBar_Material_EventContent_Time = 16974564; // 0x10302e4
- field public static final int TextAppearance_StatusBar_Material_EventContent_Title = 16974561; // 0x10302e1
field public static final int TextAppearance_StatusBar_Title = 16973925; // 0x1030065
field public static final int TextAppearance_SuggestionHighlight = 16974104; // 0x1030118
field public static final int TextAppearance_Theme = 16973888; // 0x1030040
@@ -2628,6 +2627,7 @@ package android {
field public static final int Widget_Toolbar = 16974339; // 0x1030203
field public static final int Widget_Toolbar_Button_Navigation = 16974340; // 0x1030204
field public static final int Widget_WebView = 16973875; // 0x1030033
+ field public static final int __removed = 16974559; // 0x10302df
field public static final int l_resource_pad1 = 16974336; // 0x1030200
field public static final int l_resource_pad10 = 16974327; // 0x10301f7
field public static final int l_resource_pad11 = 16974326; // 0x10301f6
@@ -3512,7 +3512,7 @@ package android.app {
method public void onTrimMemory(int);
method public void onUserInteraction();
method protected void onUserLeaveHint();
- method public void onVisibleBehindCancelled();
+ method public void onVisibleBehindCanceled();
method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
method public void onWindowFocusChanged(boolean);
method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index c80eeb9..2503d17 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -5459,7 +5459,7 @@ public class Activity extends ContextThemeWrapper
* this method anytime before a return from {@link #onPause()}. If this call is successful
* then the activity will remain visible when {@link #onPause()} is called, and can continue to
* play media in the background, but it must stop playing and release resources prior to or
- * within the call to {@link #onVisibleBehindCancelled()}. If this call returns false, the
+ * within the call to {@link #onVisibleBehindCanceled()}. If this call returns false, the
* activity will not be visible in the background, and must release any media resources
* immediately.
*
@@ -5475,10 +5475,10 @@ public class Activity extends ContextThemeWrapper
* @return the resulting visibiity state. If true the activity may remain visible beyond
* {@link #onPause()}. If false then the activity may not count on being visible behind
* other translucent activities, and must stop any media playback and release resources.
- * Returning false may occur in lieu of a call to onVisibleBehindCancelled() so the return
+ * Returning false may occur in lieu of a call to onVisibleBehindCanceled() so the return
* value must be checked.
*
- * @see #onVisibleBehindCancelled()
+ * @see #onVisibleBehindCanceled()
* @see #onBackgroundVisibleBehindChanged(boolean)
*/
public boolean requestVisibleBehind(boolean visible) {
@@ -5498,7 +5498,7 @@ public class Activity extends ContextThemeWrapper
/**
* Called when a translucent activity over this activity is becoming opaque or another
* activity is being launched. Activities that override this method must call
- * <code>super.onVisibleBehindCancelled()</code> or a SuperNotCalledException will be thrown.
+ * <code>super.onVisibleBehindCanceled()</code> or a SuperNotCalledException will be thrown.
*
* <p>When this method is called the activity has 500 msec to release any resources it may be
* using while visible in the background.
@@ -5509,7 +5509,7 @@ public class Activity extends ContextThemeWrapper
* @see #requestVisibleBehind(boolean)
* @see #onBackgroundVisibleBehindChanged(boolean)
*/
- public void onVisibleBehindCancelled() {
+ public void onVisibleBehindCanceled() {
mCalled = true;
}
@@ -5521,7 +5521,7 @@ public class Activity extends ContextThemeWrapper
* {@link #requestVisibleBehind(boolean)}, false otherwise.
*
* @see #requestVisibleBehind(boolean)
- * @see #onVisibleBehindCancelled()
+ * @see #onVisibleBehindCanceled()
* @see #onBackgroundVisibleBehindChanged(boolean)
* @hide
*/
@@ -5544,7 +5544,7 @@ public class Activity extends ContextThemeWrapper
* @param visible true if a background activity is visible, false otherwise.
*
* @see #requestVisibleBehind(boolean)
- * @see #onVisibleBehindCancelled()
+ * @see #onVisibleBehindCanceled()
* @hide
*/
@SystemApi
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index d70e5df..38999a8 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -2485,11 +2485,11 @@ public final class ActivityThread {
final Activity activity = r.activity;
if (activity.mVisibleBehind) {
activity.mCalled = false;
- activity.onVisibleBehindCancelled();
+ activity.onVisibleBehindCanceled();
// Tick, tick, tick. The activity has 500 msec to return or it will be destroyed.
if (!activity.mCalled) {
throw new SuperNotCalledException("Activity " + activity.getLocalClassName() +
- " did not call through to super.onVisibleBehindCancelled()");
+ " did not call through to super.onVisibleBehindCanceled()");
}
activity.mVisibleBehind = false;
}
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java
index e4f2b88..a09a2e7 100644
--- a/core/java/android/app/ActivityTransitionCoordinator.java
+++ b/core/java/android/app/ActivityTransitionCoordinator.java
@@ -217,7 +217,10 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
}
protected void viewsReady(ArrayMap<String, View> sharedElements) {
- setSharedElements(sharedElements);
+ sharedElements.retainAll(mAllSharedElementNames);
+ mListener.remapSharedElements(mAllSharedElementNames, sharedElements);
+ mSharedElementNames.addAll(sharedElements.keySet());
+ mSharedElements.addAll(sharedElements.values());
if (getViewsTransition() != null) {
getDecor().captureTransitioningViews(mTransitioningViews);
mTransitioningViews.removeAll(mSharedElements);
@@ -339,32 +342,16 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
protected ArrayMap<String, View> mapSharedElements(ArrayList<String> accepted,
ArrayList<View> localViews) {
ArrayMap<String, View> sharedElements = new ArrayMap<String, View>();
- if (!mAllSharedElementNames.isEmpty()) {
- if (accepted != null) {
- for (int i = 0; i < accepted.size(); i++) {
- sharedElements.put(accepted.get(i), localViews.get(i));
- }
- } else {
- getDecor().findNamedViews(sharedElements);
+ if (accepted != null) {
+ for (int i = 0; i < accepted.size(); i++) {
+ sharedElements.put(accepted.get(i), localViews.get(i));
}
+ } else {
+ getDecor().findNamedViews(sharedElements);
}
return sharedElements;
}
- private void setSharedElements(ArrayMap<String, View> sharedElements) {
- sharedElements.retainAll(mAllSharedElementNames);
- mListener.remapSharedElements(mAllSharedElementNames, sharedElements);
- sharedElements.retainAll(mAllSharedElementNames);
- for (int i = 0; i < mAllSharedElementNames.size(); i++) {
- String name = mAllSharedElementNames.get(i);
- View sharedElement = sharedElements.get(name);
- if (sharedElement != null) {
- mSharedElementNames.add(name);
- mSharedElements.add(sharedElement);
- }
- }
- }
-
protected void setResultReceiver(ResultReceiver resultReceiver) {
mResultReceiver = resultReceiver;
}
diff --git a/core/java/android/app/ExitTransitionCoordinator.java b/core/java/android/app/ExitTransitionCoordinator.java
index 43b9ea8..f31800d 100644
--- a/core/java/android/app/ExitTransitionCoordinator.java
+++ b/core/java/android/app/ExitTransitionCoordinator.java
@@ -174,6 +174,7 @@ class ExitTransitionCoordinator extends ActivityTransitionCoordinator {
});
setGhostVisibility(View.INVISIBLE);
scheduleGhostVisibilityChange(View.INVISIBLE);
+ mListener.setSharedElementEnd(mSharedElementNames, mSharedElements, sharedElementSnapshots);
TransitionManager.beginDelayedTransition(getDecor(), transition);
scheduleGhostVisibilityChange(View.VISIBLE);
setGhostVisibility(View.VISIBLE);
diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java
index d9d4398..0202f91 100644
--- a/core/java/android/provider/CallLog.java
+++ b/core/java/android/provider/CallLog.java
@@ -350,6 +350,15 @@ public class CallLog {
public static final String PHONE_ACCOUNT_ID = "subscription_id";
/**
+ * The identifier of a account that is unique to a specified component. Equivalent value
+ * to {@link #PHONE_ACCOUNT_ID}. For ContactsProvider internal use only.
+ * <P>Type: INTEGER</P>
+ *
+ * @hide
+ */
+ public static final String SUB_ID = "sub_id";
+
+ /**
* If a successful call is made that is longer than this duration, update the phone number
* in the ContactsProvider with the normalized version of the number, based on the user's
* current country code.
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index eb232fd..add0de3 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -35,9 +35,8 @@ import android.view.WindowManager;
import android.view.inputmethod.CompletionInfo;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
-
import com.android.internal.R;
-
+import java.lang.ref.WeakReference;
/**
* <p>An editable text view that shows completion suggestions automatically
@@ -629,7 +628,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
*/
public <T extends ListAdapter & Filterable> void setAdapter(T adapter) {
if (mObserver == null) {
- mObserver = new PopupDataSetObserver();
+ mObserver = new PopupDataSetObserver(this);
} else if (mAdapter != null) {
mAdapter.unregisterDataSetObserver(mObserver);
}
@@ -1255,25 +1254,44 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
}
}
- private class PopupDataSetObserver extends DataSetObserver {
+ /**
+ * Static inner listener that keeps a WeakReference to the actual AutoCompleteTextView.
+ * <p>
+ * This way, if adapter has a longer life span than the View, we won't leak the View, instead
+ * we will just leak a small Observer with 1 field.
+ */
+ private static class PopupDataSetObserver extends DataSetObserver {
+ private final WeakReference<AutoCompleteTextView> mViewReference;
+
+ private PopupDataSetObserver(AutoCompleteTextView view) {
+ mViewReference = new WeakReference<AutoCompleteTextView>(view);
+ }
+
@Override
public void onChanged() {
- if (mAdapter != null) {
+ final AutoCompleteTextView textView = mViewReference.get();
+ if (textView != null && textView.mAdapter != null) {
// If the popup is not showing already, showing it will cause
// the list of data set observers attached to the adapter to
// change. We can't do it from here, because we are in the middle
// of iterating through the list of observers.
- post(new Runnable() {
- public void run() {
- final ListAdapter adapter = mAdapter;
- if (adapter != null) {
- // This will re-layout, thus resetting mDataChanged, so that the
- // listView click listener stays responsive
- updateDropDownForFilter(adapter.getCount());
- }
- }
- });
+ textView.post(updateRunnable);
}
}
+
+ private final Runnable updateRunnable = new Runnable() {
+ @Override
+ public void run() {
+ final AutoCompleteTextView textView = mViewReference.get();
+ if (textView == null) {
+ return;
+ }
+ final ListAdapter adapter = textView.mAdapter;
+ if (adapter == null) {
+ return;
+ }
+ textView.updateDropDownForFilter(adapter.getCount());
+ }
+ };
}
}
diff --git a/core/res/res/layout/notification_template_material_big_base.xml b/core/res/res/layout/notification_template_material_big_base.xml
index f264b7b..3595033 100644
--- a/core/res/res/layout/notification_template_material_big_base.xml
+++ b/core/res/res/layout/notification_template_material_big_base.xml
@@ -45,7 +45,7 @@
android:gravity="top"
>
<TextView android:id="@+id/big_text"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
diff --git a/core/res/res/layout/notification_template_material_big_media.xml b/core/res/res/layout/notification_template_material_big_media.xml
index f8e1986..3c44141 100644
--- a/core/res/res/layout/notification_template_material_big_media.xml
+++ b/core/res/res/layout/notification_template_material_big_media.xml
@@ -49,7 +49,7 @@
android:orientation="horizontal"
>
<TextView android:id="@+id/title"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Title"
+ android:textAppearance="@style/TextAppearance.Material.Notification.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
@@ -73,7 +73,7 @@
/>
</LinearLayout>
<TextView android:id="@+id/text2"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Line2"
+ android:textAppearance="@style/TextAppearance.Material.Notification.Line2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-2dp"
@@ -86,7 +86,7 @@
android:visibility="gone"
/>
<TextView android:id="@+id/big_text"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
@@ -104,7 +104,7 @@
android:gravity="center_vertical"
>
<TextView android:id="@+id/text"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -114,7 +114,7 @@
android:fadingEdge="horizontal"
/>
<TextView android:id="@+id/info"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Info"
+ android:textAppearance="@style/TextAppearance.Material.Notification.Info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@@ -146,7 +146,7 @@
android:layout_height="6dp"
android:layout_gravity="top"
android:visibility="gone"
- style="@style/Widget.StatusBar.Material.ProgressBar.Media"
+ style="@style/Widget.Material.Notification.ProgressBar.Media"
/>
</FrameLayout>
</LinearLayout>
diff --git a/core/res/res/layout/notification_template_material_big_text.xml b/core/res/res/layout/notification_template_material_big_text.xml
index d9120f6..d601d4a 100644
--- a/core/res/res/layout/notification_template_material_big_text.xml
+++ b/core/res/res/layout/notification_template_material_big_text.xml
@@ -46,7 +46,7 @@
android:gravity="top"
>
<TextView android:id="@+id/big_text"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
diff --git a/core/res/res/layout/notification_template_material_inbox.xml b/core/res/res/layout/notification_template_material_inbox.xml
index 38b3ae2..2bd9f81 100644
--- a/core/res/res/layout/notification_template_material_inbox.xml
+++ b/core/res/res/layout/notification_template_material_inbox.xml
@@ -50,7 +50,7 @@
android:orientation="vertical"
>
<TextView android:id="@+id/inbox_text0"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -59,7 +59,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text1"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -68,7 +68,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text2"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -77,7 +77,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text3"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -86,7 +86,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text4"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -95,7 +95,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text5"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -104,7 +104,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text6"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -113,7 +113,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_more"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
diff --git a/core/res/res/layout/notification_template_material_media.xml b/core/res/res/layout/notification_template_material_media.xml
index c2fc006..db24c1f 100644
--- a/core/res/res/layout/notification_template_material_media.xml
+++ b/core/res/res/layout/notification_template_material_media.xml
@@ -50,7 +50,7 @@
android:orientation="horizontal"
>
<TextView android:id="@+id/title"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Title"
+ android:textAppearance="@style/TextAppearance.Material.Notification.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
@@ -74,7 +74,7 @@
/>
</LinearLayout>
<TextView android:id="@+id/text2"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Line2"
+ android:textAppearance="@style/TextAppearance.Material.Notification.Line2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-2dp"
@@ -91,7 +91,7 @@
android:layout_height="12dp"
android:layout_marginStart="8dp"
android:visibility="gone"
- style="@style/Widget.StatusBar.Material.ProgressBar"
+ style="@style/Widget.Material.Notification.ProgressBar"
/>
<LinearLayout
android:id="@+id/line3"
@@ -102,7 +102,7 @@
android:layout_marginStart="8dp"
>
<TextView android:id="@+id/text"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -112,7 +112,7 @@
android:fadingEdge="horizontal"
/>
<TextView android:id="@+id/info"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Info"
+ android:textAppearance="@style/TextAppearance.Material.Notification.Info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
diff --git a/core/res/res/layout/notification_template_part_chronometer.xml b/core/res/res/layout/notification_template_part_chronometer.xml
index 87dfe1f..1f0430e 100644
--- a/core/res/res/layout/notification_template_part_chronometer.xml
+++ b/core/res/res/layout/notification_template_part_chronometer.xml
@@ -15,7 +15,7 @@
-->
<Chronometer android:id="@+id/chronometer" xmlns:android="http://schemas.android.com/apk/res/android"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Time"
+ android:textAppearance="@style/TextAppearance.Material.Notification.Time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
diff --git a/core/res/res/layout/notification_template_part_line1.xml b/core/res/res/layout/notification_template_part_line1.xml
index c6ea6bf..7de4089 100644
--- a/core/res/res/layout/notification_template_part_line1.xml
+++ b/core/res/res/layout/notification_template_part_line1.xml
@@ -23,7 +23,7 @@
android:orientation="horizontal"
>
<TextView android:id="@+id/title"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Title"
+ android:textAppearance="@style/TextAppearance.Material.Notification.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
diff --git a/core/res/res/layout/notification_template_part_line2.xml b/core/res/res/layout/notification_template_part_line2.xml
index 1f95150..28d2bef 100644
--- a/core/res/res/layout/notification_template_part_line2.xml
+++ b/core/res/res/layout/notification_template_part_line2.xml
@@ -27,7 +27,7 @@
>
<TextView
android:id="@+id/text2"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Line2"
+ android:textAppearance="@style/TextAppearance.Material.Notification.Line2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="-1dp"
diff --git a/core/res/res/layout/notification_template_part_line3.xml b/core/res/res/layout/notification_template_part_line3.xml
index 06de2a5..56de5c9 100644
--- a/core/res/res/layout/notification_template_part_line3.xml
+++ b/core/res/res/layout/notification_template_part_line3.xml
@@ -24,7 +24,7 @@
android:gravity="center_vertical"
>
<TextView android:id="@+id/text"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent"
+ android:textAppearance="@style/TextAppearance.Material.Notification"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -34,7 +34,7 @@
android:fadingEdge="horizontal"
/>
<TextView android:id="@+id/info"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Info"
+ android:textAppearance="@style/TextAppearance.Material.Notification.Info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
diff --git a/core/res/res/layout/notification_template_part_time.xml b/core/res/res/layout/notification_template_part_time.xml
index 5982c48..37c7ebe 100644
--- a/core/res/res/layout/notification_template_part_time.xml
+++ b/core/res/res/layout/notification_template_part_time.xml
@@ -15,7 +15,7 @@
-->
<DateTimeView android:id="@+id/time" xmlns:android="http://schemas.android.com/apk/res/android"
- android:textAppearance="@style/TextAppearance.StatusBar.Material.EventContent.Time"
+ android:textAppearance="@style/TextAppearance.Material.Notification.Time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index eca6c72..3b49bed 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2527,13 +2527,13 @@
<public type="style" name="Theme.Leanback.FormWizard"/>
- <public type="style" name="TextAppearance.StatusBar.Material" />
- <public type="style" name="TextAppearance.StatusBar.Material.EventContent" />
- <public type="style" name="TextAppearance.StatusBar.Material.EventContent.Title" />
- <public type="style" name="TextAppearance.StatusBar.Material.EventContent.Line2" />
- <public type="style" name="TextAppearance.StatusBar.Material.EventContent.Info" />
- <public type="style" name="TextAppearance.StatusBar.Material.EventContent.Time" />
- <public type="style" name="TextAppearance.StatusBar.Material.EventContent.Emphasis" />
+ <public type="style" name="__removed" />
+ <public type="style" name="TextAppearance.Material.Notification" />
+ <public type="style" name="TextAppearance.Material.Notification.Title" />
+ <public type="style" name="TextAppearance.Material.Notification.Line2" />
+ <public type="style" name="TextAppearance.Material.Notification.Info" />
+ <public type="style" name="TextAppearance.Material.Notification.Time" />
+ <public type="style" name="TextAppearance.Material.Notification.Emphasis" />
<public type="style" name="Widget.Material.Spinner.Underlined" />
<public type="style" name="Widget.Material.Light.Spinner.Underlined" />
diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml
index 3ee5552..2bb52c9 100644
--- a/core/res/res/values/styles_material.xml
+++ b/core/res/res/values/styles_material.xml
@@ -410,37 +410,35 @@ please see styles_device_defaults.xml.
<item name="textSize">@dimen/datepicker_year_label_text_size</item>
</style>
- <style name="TextAppearance.StatusBar.Material" />
-
- <style name="TextAppearance.StatusBar.Material.EventContent">
+ <style name="TextAppearance.Material.Notification">
<item name="textColor">@color/secondary_text_material_light</item>
<item name="textSize">@dimen/notification_text_size</item>
</style>
- <style name="TextAppearance.StatusBar.Material.EventContent.Title">
+ <style name="TextAppearance.Material.Notification.Title">
<item name="textColor">@color/primary_text_default_material_light</item>
<item name="textSize">@dimen/notification_title_text_size</item>
</style>
- <style name="TextAppearance.StatusBar.Material.EventContent.Line2">
+ <style name="TextAppearance.Material.Notification.Line2">
<item name="textSize">@dimen/notification_subtext_size</item>
</style>
- <style name="TextAppearance.StatusBar.Material.EventContent.Info">
+ <style name="TextAppearance.Material.Notification.Info">
<item name="textSize">@dimen/notification_subtext_size</item>
</style>
- <style name="TextAppearance.StatusBar.Material.EventContent.Time">
+ <style name="TextAppearance.Material.Notification.Time">
<item name="textSize">@dimen/notification_subtext_size</item>
</style>
- <style name="TextAppearance.StatusBar.Material.EventContent.Emphasis">
+ <style name="TextAppearance.Material.Notification.Emphasis">
<item name="textColor">#66000000</item>
</style>
- <style name="Widget.StatusBar.Material.ProgressBar" parent="Widget.Material.Light.ProgressBar.Horizontal" />
+ <style name="Widget.Material.Notification.ProgressBar" parent="Widget.Material.Light.ProgressBar.Horizontal" />
- <style name="Widget.StatusBar.Material.ProgressBar.Media">
+ <style name="Widget.Material.Notification.ProgressBar.Media">
<item name="progressDrawable">@drawable/notification_material_media_progress</item>
</style>
diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml
index a79bd0a..89fac13 100644
--- a/core/res/res/values/themes_material.xml
+++ b/core/res/res/values/themes_material.xml
@@ -1257,4 +1257,6 @@ please see themes_device_defaults.xml.
<item name="colorAccent">@color/material_deep_teal_500</item>
</style>
+ <!-- TODO: Spacer to be removed from here and public.xml -->
+ <style name="__removed" />
</resources>
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h
index 8818510..5ff7b7f 100644
--- a/libs/hwui/DisplayListOp.h
+++ b/libs/hwui/DisplayListOp.h
@@ -1528,8 +1528,7 @@ public:
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
TessellationCache::vertexBuffer_pair_t buffers;
- Matrix4 drawTransform;
- renderer.getMatrix(&drawTransform);
+ Matrix4 drawTransform(*(renderer.currentTransform()));
renderer.getCaches().tessellationCache.getShadowBuffers(&drawTransform,
renderer.getLocalClipBounds(), isCasterOpaque(), mCasterOutline,
&mTransformXY, &mTransformZ, renderer.getLightCenter(), renderer.getLightRadius(),
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index a79875e..72786eb 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -653,41 +653,12 @@ void RenderNode::issueDrawShadowOperation(const Matrix4& transformFromParent, T&
handler(shadowOp, PROPERTY_SAVECOUNT, properties().getClipToBounds());
}
-template <class T>
-int RenderNode::issueOperationsOfNegZChildren(
- const Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
- OpenGLRenderer& renderer, T& handler) {
- if (zTranslatedNodes.isEmpty()) return -1;
-
- // create a save around the body of the ViewGroup's draw method, so that
- // matrix/clip methods don't affect composited children
- int shadowSaveCount = renderer.getSaveCount();
- handler(new (handler.allocator()) SaveOp(SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag),
- PROPERTY_SAVECOUNT, properties().getClipToBounds());
-
- issueOperationsOf3dChildren(zTranslatedNodes, kNegativeZChildren, renderer, handler);
- return shadowSaveCount;
-}
-
-template <class T>
-void RenderNode::issueOperationsOfPosZChildren(int shadowRestoreTo,
- const Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
- OpenGLRenderer& renderer, T& handler) {
- if (zTranslatedNodes.isEmpty()) return;
-
- LOG_ALWAYS_FATAL_IF(shadowRestoreTo < 0, "invalid save to restore to");
- handler(new (handler.allocator()) RestoreToCountOp(shadowRestoreTo),
- PROPERTY_SAVECOUNT, properties().getClipToBounds());
- renderer.setOverrideLayerAlpha(1.0f);
-
- issueOperationsOf3dChildren(zTranslatedNodes, kPositiveZChildren, renderer, handler);
-}
-
#define SHADOW_DELTA 0.1f
template <class T>
-void RenderNode::issueOperationsOf3dChildren(const Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
- ChildrenSelectMode mode, OpenGLRenderer& renderer, T& handler) {
+void RenderNode::issueOperationsOf3dChildren(ChildrenSelectMode mode,
+ const Matrix4& initialTransform, const Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
+ OpenGLRenderer& renderer, T& handler) {
const int size = zTranslatedNodes.size();
if (size == 0
|| (mode == kNegativeZChildren && zTranslatedNodes[0].key > 0.0f)
@@ -696,6 +667,11 @@ void RenderNode::issueOperationsOf3dChildren(const Vector<ZDrawRenderNodeOpPair>
return;
}
+ // Apply the base transform of the parent of the 3d children. This isolates
+ // 3d children of the current chunk from transformations made in previous chunks.
+ int rootRestoreTo = renderer.save(SkCanvas::kMatrix_SaveFlag);
+ renderer.setMatrix(initialTransform);
+
/**
* Draw shadows and (potential) casters mostly in order, but allow the shadows of casters
* with very similar Z heights to draw together.
@@ -750,6 +726,7 @@ void RenderNode::issueOperationsOf3dChildren(const Vector<ZDrawRenderNodeOpPair>
renderer.restoreToCount(restoreTo);
drawIndex++;
}
+ renderer.restoreToCount(rootRestoreTo);
}
template <class T>
@@ -869,6 +846,8 @@ void RenderNode::issueOperations(OpenGLRenderer& renderer, T& handler) {
bool quickRejected = properties().getClipToBounds()
&& renderer.quickRejectConservative(0, 0, properties().getWidth(), properties().getHeight());
if (!quickRejected) {
+ Matrix4 initialTransform(*(renderer.currentTransform()));
+
if (drawLayer) {
handler(new (alloc) DrawLayerOp(mLayer, 0, 0),
renderer.getSaveCount() - 1, properties().getClipToBounds());
@@ -880,9 +859,9 @@ void RenderNode::issueOperations(OpenGLRenderer& renderer, T& handler) {
Vector<ZDrawRenderNodeOpPair> zTranslatedNodes;
buildZSortedChildList(chunk, zTranslatedNodes);
- // for 3d root, draw children with negative z values
- int shadowRestoreTo = issueOperationsOfNegZChildren(zTranslatedNodes,
- renderer, handler);
+ issueOperationsOf3dChildren(kNegativeZChildren,
+ initialTransform, zTranslatedNodes, renderer, handler);
+
const int saveCountOffset = renderer.getSaveCount() - 1;
const int projectionReceiveIndex = mDisplayListData->projectionReceiveIndex;
@@ -899,8 +878,8 @@ void RenderNode::issueOperations(OpenGLRenderer& renderer, T& handler) {
}
}
- // for 3d root, draw children with positive z values
- issueOperationsOfPosZChildren(shadowRestoreTo, zTranslatedNodes, renderer, handler);
+ issueOperationsOf3dChildren(kPositiveZChildren,
+ initialTransform, zTranslatedNodes, renderer, handler);
}
}
}
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h
index 27b05e2..d897997 100644
--- a/libs/hwui/RenderNode.h
+++ b/libs/hwui/RenderNode.h
@@ -208,16 +208,9 @@ private:
inline void issueDrawShadowOperation(const Matrix4& transformFromParent, T& handler);
template <class T>
- inline int issueOperationsOfNegZChildren(
- const Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
+ inline void issueOperationsOf3dChildren(ChildrenSelectMode mode,
+ const Matrix4& initialTransform, const Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
OpenGLRenderer& renderer, T& handler);
- template <class T>
- inline void issueOperationsOfPosZChildren(int shadowRestoreTo,
- const Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
- OpenGLRenderer& renderer, T& handler);
- template <class T>
- inline void issueOperationsOf3dChildren(const Vector<ZDrawRenderNodeOpPair>& zTranslatedNodes,
- ChildrenSelectMode mode, OpenGLRenderer& renderer, T& handler);
template <class T>
inline void issueOperationsOfProjectedChildren(OpenGLRenderer& renderer, T& handler);
diff --git a/libs/hwui/StatefulBaseRenderer.cpp b/libs/hwui/StatefulBaseRenderer.cpp
index bdac47b..3e1aed3 100644
--- a/libs/hwui/StatefulBaseRenderer.cpp
+++ b/libs/hwui/StatefulBaseRenderer.cpp
@@ -102,10 +102,6 @@ void StatefulBaseRenderer::restoreToCount(int saveCount) {
// Matrix
///////////////////////////////////////////////////////////////////////////////
-void StatefulBaseRenderer::getMatrix(Matrix4* matrix) const {
- matrix->load(*(mSnapshot->transform));
-}
-
void StatefulBaseRenderer::getMatrix(SkMatrix* matrix) const {
mSnapshot->transform->copyTo(*matrix);
}
diff --git a/libs/hwui/StatefulBaseRenderer.h b/libs/hwui/StatefulBaseRenderer.h
index 3957d36..c6974b4 100644
--- a/libs/hwui/StatefulBaseRenderer.h
+++ b/libs/hwui/StatefulBaseRenderer.h
@@ -69,7 +69,6 @@ public:
// int alpha, SkXfermode::Mode mode, int flags);
// Matrix
- void getMatrix(Matrix4* outMatrix) const;
virtual void getMatrix(SkMatrix* outMatrix) const;
virtual void translate(float dx, float dy, float dz = 0.0f);
virtual void rotate(float degrees);
@@ -100,6 +99,10 @@ public:
void setClippingRoundRect(LinearAllocator& allocator,
const Rect& rect, float radius);
+ inline const mat4* currentTransform() const {
+ return mSnapshot->transform;
+ }
+
protected:
const Rect& getRenderTargetClipBounds() const { return mSnapshot->getRenderTargetClip(); }
@@ -134,10 +137,6 @@ protected:
return mSnapshot->clipRect;
}
- inline const mat4* currentTransform() const {
- return mSnapshot->transform;
- }
-
inline const Snapshot* currentSnapshot() const {
return mSnapshot != NULL ? mSnapshot.get() : mFirstSnapshot.get();
}
diff --git a/packages/SystemUI/res/layout/notification_guts.xml b/packages/SystemUI/res/layout/notification_guts.xml
index d65a23e..566c304 100644
--- a/packages/SystemUI/res/layout/notification_guts.xml
+++ b/packages/SystemUI/res/layout/notification_guts.xml
@@ -53,7 +53,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|start"
android:layout_weight="1"
- android:textAppearance="@*android:style/TextAppearance.StatusBar.Material.EventContent.Title"
+ android:textAppearance="@*android:style/TextAppearance.Material.Notification.Title"
android:textColor="@color/notification_guts_title_color"
/>
<DateTimeView
@@ -62,7 +62,7 @@
android:layout_height="wrap_content"
android:layout_weight="0"
android:layout_gravity="center_vertical|start"
- android:textAppearance="@*android:style/TextAppearance.StatusBar.Material.EventContent.Time"
+ android:textAppearance="@*android:style/TextAppearance.Material.Notification.Time"
android:textColor="@color/notification_guts_text_color"
/>
<TextView
@@ -70,7 +70,7 @@
android:layout_height="wrap_content"
android:id="@+id/debug_info"
android:layout_weight="0"
- android:textAppearance="@*android:style/TextAppearance.StatusBar.Material.EventContent.Time"
+ android:textAppearance="@*android:style/TextAppearance.Material.Notification.Time"
android:layout_gravity="bottom|start"
android:visibility="gone"
android:textColor="@color/notification_guts_text_color"
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index d236c7e..efd4fb4 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -234,8 +234,8 @@
<item name="android:windowExitAnimation">@*android:anim/popup_exit_material</item>
</style>
- <style name="TextAppearance.StatusBar.Material.EventContent.Parenthetical"
- parent="@*android:style/TextAppearance.StatusBar.Material.EventContent">
+ <style name="TextAppearance.Material.Notification.Parenthetical"
+ parent="@*android:style/TextAppearance.Material.Notification">
<item name="android:textStyle">italic</item>
<item name="android:textColor">#60000000</item>
</style>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 35ed3e5..da99118 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -1232,7 +1232,7 @@ public abstract class BaseStatusBar extends SystemUI implements
if (text != null) {
text.setText(R.string.notification_hidden_text);
text.setTextAppearance(mContext,
- R.style.TextAppearance_StatusBar_Material_EventContent_Parenthetical);
+ R.style.TextAppearance_Material_Notification_Parenthetical);
}
int topPadding = Notification.Builder.calculateTopPadding(mContext,