diff options
author | Adam Lesinski <adamlesinski@google.com> | 2014-08-21 11:21:42 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2014-08-21 11:38:49 -0700 |
commit | 49e2fa5c5e0389d5a457b99fd785ce33f3977c65 (patch) | |
tree | 6a0e9ba5c40dc79747d4278f56fde91901ef99fa | |
parent | 6a7d2757a936ee79b8dba2055139c8b71130c58e (diff) | |
download | frameworks_base-49e2fa5c5e0389d5a457b99fd785ce33f3977c65.zip frameworks_base-49e2fa5c5e0389d5a457b99fd785ce33f3977c65.tar.gz frameworks_base-49e2fa5c5e0389d5a457b99fd785ce33f3977c65.tar.bz2 |
Update the Split example
Caveat: There are two bugs:
- Mipmap definitions get placed in all splits.
- mdpi drawable doesn't get split properly.
Change-Id: I53b8e54cbcb3dfba495ec68e602f98666e8883a7
-rw-r--r-- | tests/Split/Android.mk | 3 | ||||
-rw-r--r-- | tests/Split/AndroidManifest.xml | 3 | ||||
-rw-r--r-- | tests/Split/res/drawable-hdpi/image.png | bin | 0 -> 881 bytes | |||
-rw-r--r-- | tests/Split/res/drawable-mdpi/image.png | bin | 0 -> 604 bytes | |||
-rw-r--r-- | tests/Split/res/drawable-xhdpi/image.png | bin | 0 -> 1395 bytes | |||
-rw-r--r-- | tests/Split/res/drawable-xxhdpi/image.png | bin | 0 -> 2341 bytes | |||
-rw-r--r-- | tests/Split/res/layout/main.xml | 10 | ||||
-rw-r--r-- | tests/Split/res/mipmap-hdpi/ic_app.png | bin | 0 -> 1725 bytes | |||
-rw-r--r-- | tests/Split/res/mipmap-mdpi/ic_app.png | bin | 0 -> 1135 bytes | |||
-rw-r--r-- | tests/Split/res/mipmap-xhdpi/ic_app.png | bin | 0 -> 2357 bytes | |||
-rw-r--r-- | tests/Split/res/mipmap-xxhdpi/ic_app.png | bin | 0 -> 3555 bytes | |||
-rw-r--r-- | tests/Split/res/mipmap-xxxhdpi/ic_app.png | bin | 0 -> 4778 bytes | |||
-rw-r--r-- | tests/Split/src/java/com/android/example/split/ActivityMain.java | 4 |
13 files changed, 12 insertions, 8 deletions
diff --git a/tests/Split/Android.mk b/tests/Split/Android.mk index 7884d4d..b068bef 100644 --- a/tests/Split/Android.mk +++ b/tests/Split/Android.mk @@ -20,8 +20,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(call all-subdir-java-files) LOCAL_PACKAGE_NAME := Split -LOCAL_AAPT_FLAGS := --split fr,de -LOCAL_AAPT_FLAGS += -v +LOCAL_PACKAGE_SPLITS := mdpi-v4 hdpi-v4 xhdpi-v4 xxhdpi-v4 LOCAL_MODULE_TAGS := tests diff --git a/tests/Split/AndroidManifest.xml b/tests/Split/AndroidManifest.xml index a4956a7..d5552de 100644 --- a/tests/Split/AndroidManifest.xml +++ b/tests/Split/AndroidManifest.xml @@ -17,7 +17,8 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.example.split"> <application android:label="@string/app_title"> - <activity android:name="ActivityMain"> + <activity android:name="ActivityMain" + android:icon="@mipmap/ic_app"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/tests/Split/res/drawable-hdpi/image.png b/tests/Split/res/drawable-hdpi/image.png Binary files differnew file mode 100644 index 0000000..dcf4242 --- /dev/null +++ b/tests/Split/res/drawable-hdpi/image.png diff --git a/tests/Split/res/drawable-mdpi/image.png b/tests/Split/res/drawable-mdpi/image.png Binary files differnew file mode 100644 index 0000000..3437952 --- /dev/null +++ b/tests/Split/res/drawable-mdpi/image.png diff --git a/tests/Split/res/drawable-xhdpi/image.png b/tests/Split/res/drawable-xhdpi/image.png Binary files differnew file mode 100644 index 0000000..68b2f8e --- /dev/null +++ b/tests/Split/res/drawable-xhdpi/image.png diff --git a/tests/Split/res/drawable-xxhdpi/image.png b/tests/Split/res/drawable-xxhdpi/image.png Binary files differnew file mode 100644 index 0000000..4bff9b9 --- /dev/null +++ b/tests/Split/res/drawable-xxhdpi/image.png diff --git a/tests/Split/res/layout/main.xml b/tests/Split/res/layout/main.xml index 36992a2..607cdb0 100644 --- a/tests/Split/res/layout/main.xml +++ b/tests/Split/res/layout/main.xml @@ -14,6 +14,12 @@ limitations under the License. --> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="match_parent"/> + android:layout_height="match_parent"> + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" + android:src="@drawable/image"/> +</RelativeLayout> diff --git a/tests/Split/res/mipmap-hdpi/ic_app.png b/tests/Split/res/mipmap-hdpi/ic_app.png Binary files differnew file mode 100644 index 0000000..ffcb9e5 --- /dev/null +++ b/tests/Split/res/mipmap-hdpi/ic_app.png diff --git a/tests/Split/res/mipmap-mdpi/ic_app.png b/tests/Split/res/mipmap-mdpi/ic_app.png Binary files differnew file mode 100644 index 0000000..35f5b45 --- /dev/null +++ b/tests/Split/res/mipmap-mdpi/ic_app.png diff --git a/tests/Split/res/mipmap-xhdpi/ic_app.png b/tests/Split/res/mipmap-xhdpi/ic_app.png Binary files differnew file mode 100644 index 0000000..bfe71fe --- /dev/null +++ b/tests/Split/res/mipmap-xhdpi/ic_app.png diff --git a/tests/Split/res/mipmap-xxhdpi/ic_app.png b/tests/Split/res/mipmap-xxhdpi/ic_app.png Binary files differnew file mode 100644 index 0000000..b65532c --- /dev/null +++ b/tests/Split/res/mipmap-xxhdpi/ic_app.png diff --git a/tests/Split/res/mipmap-xxxhdpi/ic_app.png b/tests/Split/res/mipmap-xxxhdpi/ic_app.png Binary files differnew file mode 100644 index 0000000..2679b49 --- /dev/null +++ b/tests/Split/res/mipmap-xxxhdpi/ic_app.png diff --git a/tests/Split/src/java/com/android/example/split/ActivityMain.java b/tests/Split/src/java/com/android/example/split/ActivityMain.java index a15fb3c..63963a2 100644 --- a/tests/Split/src/java/com/android/example/split/ActivityMain.java +++ b/tests/Split/src/java/com/android/example/split/ActivityMain.java @@ -24,8 +24,6 @@ public class ActivityMain extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - TextView text = new TextView(this); - text.setText(R.string.test); - setContentView(text); + setContentView(R.layout.main); } } |