Bring the shiny navigation button animations to phones.

Also fix the accessibility descriptions (bad merge?).

Bug: 4541219
Change-Id: I8a8e2a14e5557c45af0b9e74b0bd654ff804aab9
This commit is contained in:
Daniel Sandler
2011-07-29 08:42:15 -04:00
parent cdbb950afe
commit 5298582717
6 changed files with 35 additions and 11 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -35,6 +35,8 @@
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="horizontal"
android:clipChildren="false"
android:clipToPadding="false"
>
<!-- navigation controls -->
@ -42,6 +44,7 @@
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_weight="0"
android:visibility="invisible"
/>
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back"
android:layout_width="80dp"
@ -49,12 +52,14 @@
android:src="@drawable/ic_sysbar_back"
systemui:keyCode="4"
android:layout_weight="0"
systemui:glowBackground="@drawable/ic_sysbar_highlight"
android:contentDescription="@string/accessibility_back"
/>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:contentDescription="@string/accessibility_back"
android:visibility="invisible"
/>
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home"
android:layout_width="80dp"
@ -62,18 +67,22 @@
android:src="@drawable/ic_sysbar_home"
systemui:keyCode="3"
android:layout_weight="0"
systemui:glowBackground="@drawable/ic_sysbar_highlight"
android:contentDescription="@string/accessibility_home"
/>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:contentDescription="@string/accessibility_home"
android:visibility="invisible"
/>
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps"
android:layout_width="80dp"
android:layout_height="match_parent"
android:src="@drawable/ic_sysbar_recent"
android:layout_weight="0"
systemui:glowBackground="@drawable/ic_sysbar_highlight"
android:contentDescription="@string/accessibility_recent"
/>
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu"
android:layout_width="40dp"
@ -83,6 +92,7 @@
android:layout_weight="0"
android:visibility="invisible"
android:contentDescription="@string/accessibility_menu"
systemui:glowBackground="@drawable/ic_sysbar_highlight"
/>
</LinearLayout>
@ -106,6 +116,8 @@
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:clipChildren="false"
android:clipToPadding="false"
>
<!-- navigation controls -->
@ -117,17 +129,19 @@
android:layout_weight="0"
android:visibility="invisible"
/>
<ImageView android:id="@+id/recent_apps"
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps"
android:layout_height="80dp"
android:layout_width="match_parent"
android:src="@drawable/ic_sysbar_recent_land"
android:layout_weight="0"
android:contentDescription="@string/accessibility_recent"
systemui:glowBackground="@drawable/ic_sysbar_highlight_land"
/>
<View
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_weight="1"
android:contentDescription="@string/accessibility_menu"
android:visibility="invisible"
/>
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home"
android:layout_height="80dp"
@ -136,12 +150,13 @@
systemui:keyCode="3"
android:layout_weight="0"
android:contentDescription="@string/accessibility_home"
systemui:glowBackground="@drawable/ic_sysbar_highlight_land"
/>
<View
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_weight="1"
android:contentDescription="@string/accessibility_back"
android:visibility="invisible"
/>
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back"
android:layout_height="80dp"
@ -149,12 +164,18 @@
android:src="@drawable/ic_sysbar_back_land"
systemui:keyCode="4"
android:layout_weight="0"
android:contentDescription="@string/accessibility_back"
systemui:glowBackground="@drawable/ic_sysbar_highlight_land"
/>
<View
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu"
android:layout_height="40dp"
android:layout_width="match_parent"
android:src="@drawable/ic_sysbar_menu_land"
systemui:keyCode="82"
android:layout_weight="0"
android:visibility="invisible"
android:contentDescription="@string/accessibility_menu"
systemui:glowBackground="@drawable/ic_sysbar_highlight_land"
/>
</LinearLayout>

View File

@ -185,6 +185,8 @@
<string name="accessibility_home">Home</string>
<!-- Content description of the menu button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_menu">Menu</string>
<!-- Content description of the recents button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_recent">Recent applications</string>
<!-- Content description of the switch input method button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_ime_switch_button">Switch input method button.</string>

View File

@ -159,13 +159,14 @@ public class KeyButtonView extends ImageView {
if (x < 1.0f) {
invalidate();
} else {
x = (w * (x - 1.0f)) / 2.0f;
final float rx = (w * (x - 1.0f)) / 2.0f;
final float ry = (h * (x - 1.0f)) / 2.0f;
com.android.systemui.SwipeHelper.invalidateGlobalRegion(
this,
new RectF(getLeft() - x,
getTop() - x,
getRight() + x,
getBottom() + x));
new RectF(getLeft() - rx,
getTop() - ry,
getRight() + rx,
getBottom() + ry));
}
}