From 247df4fe798d63ab99fed6fd7c4de0fc913b3aec Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Tue, 17 Jan 2012 09:36:47 -0800 Subject: Add AppNavigation demo This demo illustrates the use of the new support library functionality for navigating within and across tasks using "up" navigation. This matches the recommendations in the Android design guide. Change-Id: I2b36c962dd24f0e0f3b3ee3f86319dafc2fc66e2 --- build/sdk.atree | 1 + samples/AppNavigation/Android.mk | 19 ++++ samples/AppNavigation/AndroidManifest.xml | 116 ++++++++++++++++++++ .../AppNavigation/res/layout/content_category.xml | 29 +++++ samples/AppNavigation/res/layout/content_view.xml | 30 +++++ .../res/layout/interstitial_message.xml | 37 +++++++ samples/AppNavigation/res/layout/notifications.xml | 34 ++++++ samples/AppNavigation/res/layout/outside_task.xml | 29 +++++ samples/AppNavigation/res/layout/peer.xml | 35 ++++++ samples/AppNavigation/res/layout/simple_up.xml | 20 ++++ .../res/layout/view_from_other_task.xml | 30 +++++ samples/AppNavigation/res/values-v11/styles.xml | 25 +++++ samples/AppNavigation/res/values-v11/themes.xml | 19 ++++ samples/AppNavigation/res/values-v14/themes.xml | 18 +++ samples/AppNavigation/res/values/ids.xml | 19 ++++ samples/AppNavigation/res/values/strings.xml | 51 +++++++++ samples/AppNavigation/res/values/styles.xml | 22 ++++ samples/AppNavigation/res/values/themes.xml | 19 ++++ .../android/appnavigation/app/ActionBarCompat.java | 42 +++++++ .../appnavigation/app/AppNavHomeActivity.java | 121 +++++++++++++++++++++ .../appnavigation/app/ContentCategoryActivity.java | 50 +++++++++ .../appnavigation/app/ContentViewActivity.java | 67 ++++++++++++ .../app/InterstitialMessageActivity.java | 42 +++++++ .../appnavigation/app/NotificationsActivity.java | 80 ++++++++++++++ .../appnavigation/app/OutsideTaskActivity.java | 38 +++++++ .../android/appnavigation/app/PeerActivity.java | 62 +++++++++++ .../appnavigation/app/SimpleUpActivity.java | 44 ++++++++ .../app/ViewFromOtherTaskActivity.java | 52 +++++++++ 28 files changed, 1151 insertions(+) create mode 100644 samples/AppNavigation/Android.mk create mode 100644 samples/AppNavigation/AndroidManifest.xml create mode 100644 samples/AppNavigation/res/layout/content_category.xml create mode 100644 samples/AppNavigation/res/layout/content_view.xml create mode 100644 samples/AppNavigation/res/layout/interstitial_message.xml create mode 100644 samples/AppNavigation/res/layout/notifications.xml create mode 100644 samples/AppNavigation/res/layout/outside_task.xml create mode 100644 samples/AppNavigation/res/layout/peer.xml create mode 100644 samples/AppNavigation/res/layout/simple_up.xml create mode 100644 samples/AppNavigation/res/layout/view_from_other_task.xml create mode 100644 samples/AppNavigation/res/values-v11/styles.xml create mode 100644 samples/AppNavigation/res/values-v11/themes.xml create mode 100644 samples/AppNavigation/res/values-v14/themes.xml create mode 100644 samples/AppNavigation/res/values/ids.xml create mode 100644 samples/AppNavigation/res/values/strings.xml create mode 100644 samples/AppNavigation/res/values/styles.xml create mode 100644 samples/AppNavigation/res/values/themes.xml create mode 100644 samples/AppNavigation/src/com/example/android/appnavigation/app/ActionBarCompat.java create mode 100644 samples/AppNavigation/src/com/example/android/appnavigation/app/AppNavHomeActivity.java create mode 100644 samples/AppNavigation/src/com/example/android/appnavigation/app/ContentCategoryActivity.java create mode 100644 samples/AppNavigation/src/com/example/android/appnavigation/app/ContentViewActivity.java create mode 100644 samples/AppNavigation/src/com/example/android/appnavigation/app/InterstitialMessageActivity.java create mode 100644 samples/AppNavigation/src/com/example/android/appnavigation/app/NotificationsActivity.java create mode 100644 samples/AppNavigation/src/com/example/android/appnavigation/app/OutsideTaskActivity.java create mode 100644 samples/AppNavigation/src/com/example/android/appnavigation/app/PeerActivity.java create mode 100644 samples/AppNavigation/src/com/example/android/appnavigation/app/SimpleUpActivity.java create mode 100644 samples/AppNavigation/src/com/example/android/appnavigation/app/ViewFromOtherTaskActivity.java diff --git a/build/sdk.atree b/build/sdk.atree index b1b313b44..f380cd465 100644 --- a/build/sdk.atree +++ b/build/sdk.atree @@ -159,6 +159,7 @@ development/samples/AccelerometerPlay samples/${PLATFORM_NAME}/Accelero development/samples/ActionBarCompat samples/${PLATFORM_NAME}/ActionBarCompat development/samples/AndroidBeamDemo samples/${PLATFORM_NAME}/AndroidBeamDemo development/samples/ApiDemos samples/${PLATFORM_NAME}/ApiDemos +development/samples/AppNavigation samples/${PLATFORM_NAME}/AppNavigation development/samples/BackupRestore samples/${PLATFORM_NAME}/BackupRestore development/samples/BasicGLSurfaceView samples/${PLATFORM_NAME}/BasicGLSurfaceView development/samples/BluetoothChat samples/${PLATFORM_NAME}/BluetoothChat diff --git a/samples/AppNavigation/Android.mk b/samples/AppNavigation/Android.mk new file mode 100644 index 000000000..758201ea2 --- /dev/null +++ b/samples/AppNavigation/Android.mk @@ -0,0 +1,19 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := samples tests + +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_PACKAGE_NAME := AppNavigation + +LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4 + +LOCAL_SDK_VERSION := current + +include $(BUILD_PACKAGE) + +LOCAL_PROGUARD_FLAG_FILES := proguard.flags + +# Use the following include to make our test apk. +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/samples/AppNavigation/AndroidManifest.xml b/samples/AppNavigation/AndroidManifest.xml new file mode 100644 index 000000000..135016e07 --- /dev/null +++ b/samples/AppNavigation/AndroidManifest.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/AppNavigation/res/layout/content_category.xml b/samples/AppNavigation/res/layout/content_category.xml new file mode 100644 index 000000000..272726073 --- /dev/null +++ b/samples/AppNavigation/res/layout/content_category.xml @@ -0,0 +1,29 @@ + + + + +