summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2013-06-15 12:56:26 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-06-15 12:56:27 +0000
commit75d71b7e9471c2b1069479ad1eb0e442e18ee7c3 (patch)
tree8de53b9648ee4c00f76c026eaf7e35c8fb130ec5 /packages/SystemUI
parentfbf7a9aea201484ff40e827de97a6db903b53ac3 (diff)
parente804cb56d02cc31b917e755670f08cb4ec60cf80 (diff)
downloadframeworks_base-75d71b7e9471c2b1069479ad1eb0e442e18ee7c3.zip
frameworks_base-75d71b7e9471c2b1069479ad1eb0e442e18ee7c3.tar.gz
frameworks_base-75d71b7e9471c2b1069479ad1eb0e442e18ee7c3.tar.bz2
Merge "Stabilize hideybar confirmation toast."
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/res/values-land/refs.xml20
-rw-r--r--packages/SystemUI/res/values-sw600dp-port/refs.xml20
-rw-r--r--packages/SystemUI/res/values/strings.xml11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java16
4 files changed, 46 insertions, 21 deletions
diff --git a/packages/SystemUI/res/values-land/refs.xml b/packages/SystemUI/res/values-land/refs.xml
new file mode 100644
index 0000000..f5e79b9
--- /dev/null
+++ b/packages/SystemUI/res/values-land/refs.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (c) 2013, 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.
+*/
+-->
+<resources>
+ <item type="string" name="hideybar_confirmation_message">@string/hideybar_confirmation_message_long</item>
+</resources>
diff --git a/packages/SystemUI/res/values-sw600dp-port/refs.xml b/packages/SystemUI/res/values-sw600dp-port/refs.xml
new file mode 100644
index 0000000..f5e79b9
--- /dev/null
+++ b/packages/SystemUI/res/values-sw600dp-port/refs.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (c) 2013, 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.
+*/
+-->
+<resources>
+ <item type="string" name="hideybar_confirmation_message">@string/hideybar_confirmation_message_long</item>
+</resources>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 9498fe4..a462465 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -517,12 +517,9 @@
<!-- Body of help text shown when the notification panel is pulled down for the very first time. [CHAR LIMIT=NONE] -->
<string name="status_bar_help_text">Access them anytime by swiping down.\nSwipe down again for system controls.</string>
- <!-- Toast bar message when hiding the navigation bar on bottom -->
- <string name="hideybar_confirmation_message_bottom">Swipe up from bottom of screen to reveal system bar</string>
+ <!-- Toast bar message when hiding the navigation bar -->
+ <string name="hideybar_confirmation_message">Swipe edge of screen to reveal bar</string>
- <!-- Shorter version of toast bar message when hiding the navigation bar on bottom -->
- <string name="hideybar_confirmation_message_bottom_short">Swipe bottom of screen to reveal bar</string>
-
- <!-- Toast bar message when hiding the navigation bar on right -->
- <string name="hideybar_confirmation_message_right">Swipe from right of screen to reveal system bar</string>
+ <!-- Longer version of toast bar message when hiding the navigation bar (if room) -->
+ <string name="hideybar_confirmation_message_long">Swipe from edge of screen to reveal system bar</string>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index a54c435..4b30c86 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1959,13 +1959,8 @@ public class PhoneStatusBar extends BaseStatusBar {
private void setHideybarConfirmationVisible(boolean visible) {
if (DEBUG) Log.d(TAG, "setHideybarConfirmationVisible " + visible);
if (visible && mHideybarConfirmation == null && !mHideybarConfirmationDismissed) {
- // create the confirmation toast bar with the correct message for this config
- float widthDp = mCurrentDisplaySize.x /
- (mDisplayMetrics.densityDpi / (float) DisplayMetrics.DENSITY_DEFAULT);
- int msg = mNavigationBarView.isVertical() ?
- R.string.hideybar_confirmation_message_right :
- widthDp < 600 ? R.string.hideybar_confirmation_message_bottom_short :
- R.string.hideybar_confirmation_message_bottom;
+ // create the confirmation toast bar
+ int msg = R.string.hideybar_confirmation_message;
mHideybarConfirmation = Toast.makeBar(mContext, msg, Toast.LENGTH_INFINITE)
.setAction(com.android.internal.R.string.ok, mHideybarConfirmationAction);
View v = mHideybarConfirmation.getView();
@@ -1975,13 +1970,6 @@ public class PhoneStatusBar extends BaseStatusBar {
// dismiss on outside touch if globally confirmed
v.setOnTouchListener(mDismissHideybarConfirmationOnTouchOutside);
}
- // position at the bottom like normal toasts, but use top gravity
- // to avoid jumping around when showing/hiding the nav bar
- v.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
- int offsetY = mContext.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.toast_y_offset);
- mHideybarConfirmation.setGravity(Gravity.TOP, 0,
- mCurrentDisplaySize.y - v.getMeasuredHeight() / 2 - offsetY);
// show the confirmation
mHideybarConfirmation.show();
} else if (!visible) {