diff options
author | John Spurlock <jspurlock@google.com> | 2013-10-14 17:21:33 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-10-14 17:21:33 +0000 |
commit | 774e8ad88331f82994e38d721418da556ce9edea (patch) | |
tree | c2843e94f7d19ff2ff5c7fd382b2082649ae4be7 /core | |
parent | edbab7b58227e66c2cc4e868bba314020ef52080 (diff) | |
parent | f1a36648ca099d7ffa8a19e403673820d4b8417a (diff) | |
download | frameworks_base-774e8ad88331f82994e38d721418da556ce9edea.zip frameworks_base-774e8ad88331f82994e38d721418da556ce9edea.tar.gz frameworks_base-774e8ad88331f82994e38d721418da556ce9edea.tar.bz2 |
Merge "Implement new SYSTEM_UI_FLAG_IMMERSIVE_STICKY." into klp-dev
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/provider/Settings.java | 2 | ||||
-rw-r--r-- | core/java/android/widget/Toast.java | 69 | ||||
-rw-r--r-- | core/res/res/anim/toast_bar_enter.xml | 27 | ||||
-rw-r--r-- | core/res/res/anim/toast_bar_exit.xml | 26 | ||||
-rw-r--r-- | core/res/res/drawable-hdpi/toast_bar_bg.9.png | bin | 599 -> 0 bytes | |||
-rw-r--r-- | core/res/res/drawable-mdpi/toast_bar_bg.9.png | bin | 374 -> 0 bytes | |||
-rw-r--r-- | core/res/res/drawable-xhdpi/toast_bar_bg.9.png | bin | 814 -> 0 bytes | |||
-rw-r--r-- | core/res/res/layout/immersive_mode_cling.xml (renamed from core/res/res/layout/transient_navigation_cling.xml) | 2 | ||||
-rw-r--r-- | core/res/res/layout/toast_bar.xml | 70 | ||||
-rw-r--r-- | core/res/res/values-land/dimens.xml | 2 | ||||
-rw-r--r-- | core/res/res/values-sw600dp/dimens.xml | 2 | ||||
-rw-r--r-- | core/res/res/values/config.xml | 4 | ||||
-rw-r--r-- | core/res/res/values/dimens.xml | 2 | ||||
-rw-r--r-- | core/res/res/values/strings.xml | 4 | ||||
-rw-r--r-- | core/res/res/values/styles.xml | 6 | ||||
-rw-r--r-- | core/res/res/values/symbols.xml | 7 |
16 files changed, 13 insertions, 210 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 6f1c6ba..7f24539 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -4379,7 +4379,7 @@ public final class Settings { public static final String BAR_SERVICE_COMPONENT = "bar_service_component"; /** @hide */ - public static final String TRANSIENT_NAV_CONFIRMATIONS = "transient_nav_confirmations"; + public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations"; /** * This is the query URI for finding a print service to install. diff --git a/core/java/android/widget/Toast.java b/core/java/android/widget/Toast.java index 4b71e36..e38dfa7 100644 --- a/core/java/android/widget/Toast.java +++ b/core/java/android/widget/Toast.java @@ -75,9 +75,6 @@ public class Toast { */ public static final int LENGTH_LONG = 1; - /** @hide */ - public static final int LENGTH_INFINITE = 2; - final Context mContext; final TN mTN; int mDuration; @@ -294,61 +291,6 @@ public class Toast { tv.setText(s); } - /** @hide */ - public static Toast makeBar(Context context, int resId, int duration) { - return makeBar(context, context.getResources().getText(resId), duration); - } - - /** @hide */ - public static Toast makeBar(Context context, CharSequence text, int duration) { - Toast result = new Toast(context); - - LayoutInflater inflate = (LayoutInflater) - context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - View v = inflate.inflate(com.android.internal.R.layout.toast_bar, null); - ((TextView)v.findViewById(android.R.id.message)).setText(text); - v.findViewById(android.R.id.button1).setVisibility(View.GONE); - - result.mNextView = v; - result.mDuration = duration; - result.mTN.mParams.alpha = 0.9f; - result.mTN.mParams.windowAnimations = com.android.internal.R.style.Animation_ToastBar; - - return result; - } - - /** @hide */ - public Toast setAction(int resId, Runnable action) { - return setAction(mContext.getResources().getText(resId), action); - } - - /** @hide */ - public Toast setAction(CharSequence actionText, final Runnable action) { - if (mNextView != null) { - TextView text1 = (TextView)mNextView.findViewById(android.R.id.text1); - View button1 = mNextView.findViewById(android.R.id.button1); - if (text1 != null && button1 != null) { - text1.setText(actionText); - button1.setVisibility(View.VISIBLE); - button1.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - if (action != null) { - action.run(); - } - }}); - return setInteractive(true); - } - } - throw new RuntimeException("This Toast was not created with Toast.makeBar()"); - } - - /** @hide */ - public Toast setInteractive(boolean interactive) { - mTN.setInteractive(interactive); - return this; - } - // ======================================================================================= // All the gunk below is the interaction with the Notification Service, which handles // the proper ordering of these system-wide. @@ -405,16 +347,9 @@ public class Toast { params.windowAnimations = com.android.internal.R.style.Animation_Toast; params.type = WindowManager.LayoutParams.TYPE_TOAST; params.setTitle("Toast"); - setInteractive(false); - } - - private void setInteractive(boolean interactive) { - mParams.flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON + params.flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE - | (interactive - ? (WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL - | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH) - : WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE); + | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; } /** diff --git a/core/res/res/anim/toast_bar_enter.xml b/core/res/res/anim/toast_bar_enter.xml deleted file mode 100644 index 5c0dfcf..0000000 --- a/core/res/res/anim/toast_bar_enter.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -** Copyright 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. -*/ ---> - -<set xmlns:android="http://schemas.android.com/apk/res/android" - android:shareInterpolator="false"> - <translate android:fromYDelta="10%" android:toYDelta="0" - android:interpolator="@interpolator/decelerate_quint" - android:duration="@android:integer/config_shortAnimTime"/> - <alpha android:fromAlpha="0.5" android:toAlpha="1.0" - android:interpolator="@interpolator/decelerate_cubic" - android:duration="@android:integer/config_shortAnimTime" /> -</set> diff --git a/core/res/res/anim/toast_bar_exit.xml b/core/res/res/anim/toast_bar_exit.xml deleted file mode 100644 index 4e3b7da..0000000 --- a/core/res/res/anim/toast_bar_exit.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -** Copyright 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. -*/ ---> -<set xmlns:android="http://schemas.android.com/apk/res/android" - android:shareInterpolator="false"> - <translate android:fromYDelta="0" android:toYDelta="10%" - android:interpolator="@interpolator/accelerate_quint" - android:duration="@android:integer/config_shortAnimTime"/> - <alpha android:fromAlpha="1.0" android:toAlpha="0.0" - android:interpolator="@interpolator/accelerate_cubic" - android:duration="@android:integer/config_shortAnimTime"/> -</set> diff --git a/core/res/res/drawable-hdpi/toast_bar_bg.9.png b/core/res/res/drawable-hdpi/toast_bar_bg.9.png Binary files differdeleted file mode 100644 index 2396b26..0000000 --- a/core/res/res/drawable-hdpi/toast_bar_bg.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/toast_bar_bg.9.png b/core/res/res/drawable-mdpi/toast_bar_bg.9.png Binary files differdeleted file mode 100644 index 291a936..0000000 --- a/core/res/res/drawable-mdpi/toast_bar_bg.9.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/toast_bar_bg.9.png b/core/res/res/drawable-xhdpi/toast_bar_bg.9.png Binary files differdeleted file mode 100644 index 1dc4927..0000000 --- a/core/res/res/drawable-xhdpi/toast_bar_bg.9.png +++ /dev/null diff --git a/core/res/res/layout/transient_navigation_cling.xml b/core/res/res/layout/immersive_mode_cling.xml index d33d965..f97225e 100644 --- a/core/res/res/layout/transient_navigation_cling.xml +++ b/core/res/res/layout/immersive_mode_cling.xml @@ -44,7 +44,7 @@ <TextView android:layout_width="match_parent" android:layout_height="wrap_content" - android:text="@string/transient_navigation_confirmation" + android:text="@string/immersive_mode_confirmation" android:textColor="#80000000" android:textSize="16sp" /> diff --git a/core/res/res/layout/toast_bar.xml b/core/res/res/layout/toast_bar.xml deleted file mode 100644 index a31d7cb..0000000 --- a/core/res/res/layout/toast_bar.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?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. ---> -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <LinearLayout - android:background="@drawable/toast_bar_bg" - android:layout_height="50dp" - android:layout_width="match_parent"> - - <TextView - android:id="@android:id/message" - android:layout_width="0dp" - android:layout_height="match_parent" - android:layout_weight="1" - android:ellipsize="end" - android:gravity="center_vertical" - android:paddingLeft="16dp" - android:paddingRight="16dp" - android:singleLine="true" - android:textColor="@android:color/white" - android:textSize="14sp" /> - - <LinearLayout - android:id="@android:id/button1" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:background="?android:attr/selectableItemBackground" - android:clickable="true"> - - <View - android:layout_width="1dp" - android:layout_height="match_parent" - android:layout_marginBottom="10dp" - android:layout_marginRight="12dp" - android:layout_marginTop="10dp" - android:background="#aaaaaa" /> - - <TextView - android:id="@android:id/text1" - android:textSize="12sp" - android:textColor="#aaaaaa" - android:textStyle="bold" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:gravity="center_vertical" - android:paddingLeft="8dp" - android:paddingRight="20dp" - android:textAllCaps="true" /> - </LinearLayout> - - </LinearLayout> - -</FrameLayout> diff --git a/core/res/res/values-land/dimens.xml b/core/res/res/values-land/dimens.xml index 81b4c09..dc59f61 100644 --- a/core/res/res/values-land/dimens.xml +++ b/core/res/res/values-land/dimens.xml @@ -61,6 +61,6 @@ Landscape's layout allows this to be smaller than for portrait. --> <dimen name="kg_squashed_layout_threshold">400dp</dimen> - <!-- width of TransientNavigationConfirmation (-1 for match_parent) --> + <!-- width of ImmersiveModeConfirmation (-1 for match_parent) --> <dimen name="immersive_mode_cling_width">380dp</dimen> </resources> diff --git a/core/res/res/values-sw600dp/dimens.xml b/core/res/res/values-sw600dp/dimens.xml index 6b5c505..d21f9b7 100644 --- a/core/res/res/values-sw600dp/dimens.xml +++ b/core/res/res/values-sw600dp/dimens.xml @@ -113,6 +113,6 @@ <!-- Margin around the various security views --> <dimen name="keyguard_muliuser_selector_margin">12dp</dimen> - <!-- width of TransientNavigationConfirmation (-1 for match_parent) --> + <!-- width of ImmersiveModeConfirmation (-1 for match_parent) --> <dimen name="immersive_mode_cling_width">380dp</dimen> </resources> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 2bcd820..196be74 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -1259,8 +1259,8 @@ </string-array> <!-- Threshold (in ms) under which a screen off / screen on will be considered a reset of the - transient navigation confirmation prompt.--> - <integer name="config_transient_navigation_confirmation_panic">5000</integer> + immersive mode confirmation prompt.--> + <integer name="config_immersive_mode_confirmation_panic">5000</integer> <!-- For some operators, PDU has garbages. To fix it, need to use valid index --> <integer name="config_valid_wappush_index">-1</integer> diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index f43581e..aad6252 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -356,6 +356,6 @@ <!-- Outline width for video subtitles. --> <dimen name="subtitle_outline_width">2dp</dimen> - <!-- width of TransientNavigationConfirmation (-1 for match_parent) --> + <!-- width of ImmersiveModeConfirmation (-1 for match_parent) --> <dimen name="immersive_mode_cling_width">-1px</dimen> </resources> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 92a6e52..e82ad1e 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -4486,7 +4486,7 @@ <!-- PIN entry dialog tells the user to not enter a PIN for a while. [CHAR LIMIT=none] --> <string name="restr_pin_try_later">Try again later</string> - <!-- Cling help message when hiding the transient navigation bar [CHAR LIMIT=none] --> - <string name="transient_navigation_confirmation">Swipe down from the top to exit full screen.</string> + <!-- Cling help message when hiding the navigation bar entering immersive mode [CHAR LIMIT=none] --> + <string name="immersive_mode_confirmation" msgid="8554991488096662508">Swipe down from the top to exit full screen.</string> </resources> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index c5dab3b..cb2fd6d 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -138,12 +138,6 @@ please see styles_device_defaults.xml. <item name="windowExitAnimation">@anim/submenu_exit</item> </style> - <!-- {@hide} --> - <style name="Animation.ToastBar"> - <item name="windowEnterAnimation">@anim/toast_bar_enter</item> - <item name="windowExitAnimation">@anim/toast_bar_exit</item> - </style> - <style name="Animation.TypingFilter"> <item name="windowEnterAnimation">@anim/grow_fade_in_center</item> <item name="windowExitAnimation">@anim/shrink_fade_out_center</item> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 6c944cf..0b050c7 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -292,6 +292,7 @@ <java-symbol type="integer" name="config_cursorWindowSize" /> <java-symbol type="integer" name="config_extraFreeKbytesAdjust" /> <java-symbol type="integer" name="config_extraFreeKbytesAbsolute" /> + <java-symbol type="integer" name="config_immersive_mode_confirmation_panic" /> <java-symbol type="integer" name="config_longPressOnPowerBehavior" /> <java-symbol type="integer" name="config_lowMemoryKillerMinFreeKbytesAdjust" /> <java-symbol type="integer" name="config_lowMemoryKillerMinFreeKbytesAbsolute" /> @@ -302,7 +303,6 @@ <java-symbol type="integer" name="config_ntpThreshold" /> <java-symbol type="integer" name="config_ntpTimeout" /> <java-symbol type="integer" name="config_toastDefaultGravity" /> - <java-symbol type="integer" name="config_transient_navigation_confirmation_panic" /> <java-symbol type="integer" name="config_wifi_framework_scan_interval" /> <java-symbol type="integer" name="config_wifi_supplicant_scan_interval" /> <java-symbol type="integer" name="config_wifi_scan_interval_p2p_connected" /> @@ -1083,7 +1083,6 @@ <java-symbol type="drawable" name="text_select_handle_left" /> <java-symbol type="drawable" name="text_select_handle_middle" /> <java-symbol type="drawable" name="text_select_handle_right" /> - <java-symbol type="drawable" name="toast_bar_bg" /> <java-symbol type="drawable" name="unknown_image" /> <java-symbol type="drawable" name="unlock_default" /> <java-symbol type="drawable" name="unlock_halo" /> @@ -1175,7 +1174,6 @@ <java-symbol type="layout" name="textview_hint" /> <java-symbol type="layout" name="time_picker" /> <java-symbol type="layout" name="time_picker_dialog" /> - <java-symbol type="layout" name="toast_bar" /> <java-symbol type="layout" name="transient_notification" /> <java-symbol type="layout" name="volume_adjust" /> <java-symbol type="layout" name="volume_adjust_item" /> @@ -1202,7 +1200,7 @@ <java-symbol type="layout" name="app_not_authorized" /> <java-symbol type="layout" name="restrictions_pin_challenge" /> <java-symbol type="layout" name="restrictions_pin_setup" /> - <java-symbol type="layout" name="transient_navigation_cling" /> + <java-symbol type="layout" name="immersive_mode_cling" /> <java-symbol type="anim" name="slide_in_child_bottom" /> <java-symbol type="anim" name="slide_in_right" /> @@ -1232,7 +1230,6 @@ <java-symbol type="style" name="Animation.DropDownUp" /> <java-symbol type="style" name="Animation.DropDownDown" /> <java-symbol type="style" name="Animation.PopupWindow" /> - <java-symbol type="style" name="Animation.ToastBar" /> <java-symbol type="style" name="Animation.TypingFilter" /> <java-symbol type="style" name="Animation.TypingFilterRestore" /> <java-symbol type="style" name="Animation.Dream" /> |