From bc6fa8a82b436912501baabc6cb1b93b6202eb7d Mon Sep 17 00:00:00 2001 From: Raphael Moll Date: Sun, 30 Jan 2011 17:05:10 -0800 Subject: [PATCH] Revamped CustomLocale for the SDK. - Revamped the list UI: replaced the long-press actions by some stateful buttons. Uses the listview's single choice mode. - Added a broadcast receiver to be able to change the system locale using an intent, e.g. sent by adb shell am. This is convenient for automated testing scripts. - Changed package namespace to v2. This makes it easier for an automated testing script to figure that an emulator has the old version and install the new one side-by-side. Change-Id: I1849d2b9d55441490b013cfefcca5d8fa48e22bd --- apps/CustomLocale/AndroidManifest.xml | 31 +- apps/CustomLocale/res/layout/list_item.xml | 35 -- apps/CustomLocale/res/layout/main.xml | 74 ++- apps/CustomLocale/res/values-fr/strings.xml | 33 +- apps/CustomLocale/res/values/strings.xml | 35 +- .../customlocale/CustomLocaleActivity.java | 334 ------------- .../android/customlocale2/ChangeLocale.java | 78 +++ .../customlocale2/CustomLocaleActivity.java | 454 ++++++++++++++++++ .../customlocale2/CustomLocaleReceiver.java | 82 ++++ .../NewLocaleDialog.java | 8 +- 10 files changed, 754 insertions(+), 410 deletions(-) delete mode 100644 apps/CustomLocale/res/layout/list_item.xml delete mode 100644 apps/CustomLocale/src/com/android/customlocale/CustomLocaleActivity.java create mode 100755 apps/CustomLocale/src/com/android/customlocale2/ChangeLocale.java create mode 100644 apps/CustomLocale/src/com/android/customlocale2/CustomLocaleActivity.java create mode 100755 apps/CustomLocale/src/com/android/customlocale2/CustomLocaleReceiver.java rename apps/CustomLocale/src/com/android/{customlocale => customlocale2}/NewLocaleDialog.java (93%) diff --git a/apps/CustomLocale/AndroidManifest.xml b/apps/CustomLocale/AndroidManifest.xml index 9dfa89630..0a446de3e 100644 --- a/apps/CustomLocale/AndroidManifest.xml +++ b/apps/CustomLocale/AndroidManifest.xml @@ -13,25 +13,40 @@ See the License for the specific language governing permissions and limitations under the License. --> + + android:versionName="1.0" + package="com.android.customlocale2" + > + + + + + + + android:label="@string/app_name" > + + android:label="@string/app_name" + android:name="CustomLocaleActivity" > + + android:theme="@android:style/Theme.Dialog" + android:name="NewLocaleDialog" /> + + + + + + - - - diff --git a/apps/CustomLocale/res/layout/list_item.xml b/apps/CustomLocale/res/layout/list_item.xml deleted file mode 100644 index 0ffb8b064..000000000 --- a/apps/CustomLocale/res/layout/list_item.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/apps/CustomLocale/res/layout/main.xml b/apps/CustomLocale/res/layout/main.xml index 55bd90cc6..e700a8ba1 100644 --- a/apps/CustomLocale/res/layout/main.xml +++ b/apps/CustomLocale/res/layout/main.xml @@ -17,7 +17,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + > + android:background="@color/header_background" + /> + android:padding="5dip" + /> - + + - -