summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-09-11 18:17:56 +0200
committerJorim Jaggi <jjaggi@google.com>2014-09-12 18:42:20 +0200
commite19b1ac57c116c8592d64a83b1f1484a5b1898ed (patch)
tree9729b7b087a424e3babc3ed703d372852ad085f7
parent2418d7381f1a1c15b26af252d7d08745c1858af4 (diff)
downloadframeworks_base-e19b1ac57c116c8592d64a83b1f1484a5b1898ed.zip
frameworks_base-e19b1ac57c116c8592d64a83b1f1484a5b1898ed.tar.gz
frameworks_base-e19b1ac57c116c8592d64a83b1f1484a5b1898ed.tar.bz2
Avoid some more layer creations
Bug: 17287256 Change-Id: I8c0c6f1f189b70d9a0c261f75987def3464d808d
-rw-r--r--packages/Keyguard/res/layout/keyguard_pin_view.xml6
-rw-r--r--packages/Keyguard/src/com/android/keyguard/AlphaOptimizedImageButton.java38
-rw-r--r--packages/Keyguard/src/com/android/keyguard/AlphaOptimizedLinearLayout.java (renamed from packages/SystemUI/src/com/android/systemui/statusbar/AlphaOptimizedLinearLayout.java)2
-rw-r--r--packages/Keyguard/src/com/android/keyguard/AlphaOptimizedRelativeLayout.java37
-rw-r--r--packages/Keyguard/src/com/android/keyguard/EmergencyCarrierArea.java4
-rw-r--r--packages/SystemUI/res/layout/keyguard_user_switcher.xml4
-rw-r--r--packages/SystemUI/res/layout/status_bar.xml8
-rw-r--r--packages/SystemUI/res/layout/status_bar_expanded_header.xml2
-rw-r--r--packages/SystemUI/res/layout/system_icons.xml2
9 files changed, 88 insertions, 15 deletions
diff --git a/packages/Keyguard/res/layout/keyguard_pin_view.xml b/packages/Keyguard/res/layout/keyguard_pin_view.xml
index a33f95b..4cbddde 100644
--- a/packages/Keyguard/res/layout/keyguard_pin_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_pin_view.xml
@@ -40,7 +40,7 @@
android:layout_weight="1"
android:layoutDirection="ltr"
>
- <RelativeLayout
+ <com.android.keyguard.AlphaOptimizedRelativeLayout
android:id="@+id/row0"
android:layout_width="match_parent"
android:layout_height="0dp"
@@ -79,7 +79,7 @@
android:layout_alignParentBottom="true"
android:background="#28FFFFFF"
/>
- </RelativeLayout>
+ </com.android.keyguard.AlphaOptimizedRelativeLayout>
<LinearLayout
android:id="@+id/row1"
android:layout_width="match_parent"
@@ -196,7 +196,7 @@
androidprv:textView="@+id/pinEntry"
androidprv:digit="0"
/>
- <ImageButton
+ <com.android.keyguard.AlphaOptimizedImageButton
android:id="@+id/key_enter"
android:layout_width="0px"
android:layout_height="match_parent"
diff --git a/packages/Keyguard/src/com/android/keyguard/AlphaOptimizedImageButton.java b/packages/Keyguard/src/com/android/keyguard/AlphaOptimizedImageButton.java
new file mode 100644
index 0000000..eda790f
--- /dev/null
+++ b/packages/Keyguard/src/com/android/keyguard/AlphaOptimizedImageButton.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.keyguard;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.ImageButton;
+import android.widget.RelativeLayout;
+
+/**
+ * A frame layout which does not have overlapping renderings commands and therefore does not need a
+ * layer when alpha is changed.
+ */
+public class AlphaOptimizedImageButton extends ImageButton {
+
+ public AlphaOptimizedImageButton(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ public boolean hasOverlappingRendering() {
+ return false;
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/AlphaOptimizedLinearLayout.java b/packages/Keyguard/src/com/android/keyguard/AlphaOptimizedLinearLayout.java
index 9f4c3a9..36da6f1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/AlphaOptimizedLinearLayout.java
+++ b/packages/Keyguard/src/com/android/keyguard/AlphaOptimizedLinearLayout.java
@@ -14,7 +14,7 @@
* limitations under the License
*/
-package com.android.systemui.statusbar;
+package com.android.keyguard;
import android.content.Context;
import android.util.AttributeSet;
diff --git a/packages/Keyguard/src/com/android/keyguard/AlphaOptimizedRelativeLayout.java b/packages/Keyguard/src/com/android/keyguard/AlphaOptimizedRelativeLayout.java
new file mode 100644
index 0000000..200b116
--- /dev/null
+++ b/packages/Keyguard/src/com/android/keyguard/AlphaOptimizedRelativeLayout.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.keyguard;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.RelativeLayout;
+
+/**
+ * A frame layout which does not have overlapping renderings commands and therefore does not need a
+ * layer when alpha is changed.
+ */
+public class AlphaOptimizedRelativeLayout extends RelativeLayout {
+
+ public AlphaOptimizedRelativeLayout(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ public boolean hasOverlappingRendering() {
+ return false;
+ }
+}
diff --git a/packages/Keyguard/src/com/android/keyguard/EmergencyCarrierArea.java b/packages/Keyguard/src/com/android/keyguard/EmergencyCarrierArea.java
index a592db9..0a89d9b 100644
--- a/packages/Keyguard/src/com/android/keyguard/EmergencyCarrierArea.java
+++ b/packages/Keyguard/src/com/android/keyguard/EmergencyCarrierArea.java
@@ -17,13 +17,11 @@
package com.android.keyguard;
import android.content.Context;
-import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
-import android.widget.LinearLayout;
-public class EmergencyCarrierArea extends LinearLayout {
+public class EmergencyCarrierArea extends AlphaOptimizedLinearLayout {
private CarrierText mCarrierText;
private EmergencyButton mEmergencyButton;
diff --git a/packages/SystemUI/res/layout/keyguard_user_switcher.xml b/packages/SystemUI/res/layout/keyguard_user_switcher.xml
index 7c918c2..3730bbe 100644
--- a/packages/SystemUI/res/layout/keyguard_user_switcher.xml
+++ b/packages/SystemUI/res/layout/keyguard_user_switcher.xml
@@ -14,7 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
-<com.android.systemui.statusbar.AlphaOptimizedLinearLayout
+<com.android.keyguard.AlphaOptimizedLinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyguard_user_switcher"
android:orientation="vertical"
@@ -23,4 +23,4 @@
android:gravity="end"
android:visibility="gone"
android:paddingTop="4dp">
-</com.android.systemui.statusbar.AlphaOptimizedLinearLayout>
+</com.android.keyguard.AlphaOptimizedLinearLayout>
diff --git a/packages/SystemUI/res/layout/status_bar.xml b/packages/SystemUI/res/layout/status_bar.xml
index 0d414f9..245c128 100644
--- a/packages/SystemUI/res/layout/status_bar.xml
+++ b/packages/SystemUI/res/layout/status_bar.xml
@@ -57,7 +57,7 @@
>
<!-- The alpha of this area is both controlled from PhoneStatusBarTransitions and
PhoneStatusBar (DISABLE_NOTIFICATION_ICONS), so we need two views here. -->
- <com.android.systemui.statusbar.AlphaOptimizedLinearLayout
+ <com.android.keyguard.AlphaOptimizedLinearLayout
android:id="@+id/notification_icon_area_inner"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -74,10 +74,10 @@
android:layout_alignParentStart="true"
android:gravity="center_vertical"
android:orientation="horizontal"/>
- </com.android.systemui.statusbar.AlphaOptimizedLinearLayout>
+ </com.android.keyguard.AlphaOptimizedLinearLayout>
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
- <com.android.systemui.statusbar.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area"
+ <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
@@ -94,7 +94,7 @@
android:paddingStart="7dp"
android:gravity="center_vertical|start"
/>
- </com.android.systemui.statusbar.AlphaOptimizedLinearLayout>
+ </com.android.keyguard.AlphaOptimizedLinearLayout>
</LinearLayout>
<ViewStub
diff --git a/packages/SystemUI/res/layout/status_bar_expanded_header.xml b/packages/SystemUI/res/layout/status_bar_expanded_header.xml
index 34e062c..7ea9145 100644
--- a/packages/SystemUI/res/layout/status_bar_expanded_header.xml
+++ b/packages/SystemUI/res/layout/status_bar_expanded_header.xml
@@ -44,7 +44,7 @@
android:scaleType="centerInside"/>
</com.android.systemui.statusbar.phone.MultiUserSwitch>
- <ImageButton android:id="@+id/settings_button"
+ <com.android.keyguard.AlphaOptimizedImageButton android:id="@+id/settings_button"
style="@android:style/Widget.Material.Button.Borderless"
android:layout_toStartOf="@id/multi_user_switch"
android:layout_width="48dp"
diff --git a/packages/SystemUI/res/layout/system_icons.xml b/packages/SystemUI/res/layout/system_icons.xml
index 8f25d99..21386ef 100644
--- a/packages/SystemUI/res/layout/system_icons.xml
+++ b/packages/SystemUI/res/layout/system_icons.xml
@@ -20,7 +20,7 @@
android:layout_height="match_parent"
android:gravity="center_vertical">
- <com.android.systemui.statusbar.AlphaOptimizedLinearLayout android:id="@+id/statusIcons"
+ <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/statusIcons"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"