summaryrefslogtreecommitdiffstats
path: root/tests/SharedLibrary/lib
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2014-09-30 16:06:58 -0700
committerAdam Lesinski <adamlesinski@google.com>2014-09-30 16:18:09 -0700
commit5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6 (patch)
treef0ddd3b922e53ed84c14558c6345724a588656ba /tests/SharedLibrary/lib
parent75c33d9d04d8c0a9884a70077681261b57c7833c (diff)
downloadframeworks_base-5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6.zip
frameworks_base-5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6.tar.gz
frameworks_base-5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6.tar.bz2
Fix issue with using locally defined attrs in a shared lib
The attribute name resource IDs were never fixed up with the runtime package ID so we weren't finding attributes whenever the runtime package ID was different than the build time one, which happened to be when a shared lib referenced itself (0x00 vs 0x02). Bug:17666947 Change-Id: Icf3e874bcea0e27eebe42d60fbed626a34bf9266
Diffstat (limited to 'tests/SharedLibrary/lib')
-rw-r--r--tests/SharedLibrary/lib/res/layout/main.xml26
-rw-r--r--tests/SharedLibrary/lib/res/values/strings.xml1
-rw-r--r--tests/SharedLibrary/lib/src/com/google/android/test/shared_library/ActivityMain.java6
3 files changed, 28 insertions, 5 deletions
diff --git a/tests/SharedLibrary/lib/res/layout/main.xml b/tests/SharedLibrary/lib/res/layout/main.xml
new file mode 100644
index 0000000..df0204d9
--- /dev/null
+++ b/tests/SharedLibrary/lib/res/layout/main.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/sample_layout"/>
+
+ <com.google.android.test.shared_library.AddressView xmlns:address="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:background="#03a9f4"
+ address:name="Librarian L"
+ address:streetNumber="21"
+ address:streetName="Android Lane"
+ address:city="AndroidVille"
+ address:state="OS"
+ address:zip="12345"
+ address:country="Mobile"/>
+
+</LinearLayout>
diff --git a/tests/SharedLibrary/lib/res/values/strings.xml b/tests/SharedLibrary/lib/res/values/strings.xml
index 6827f93..9beccd9 100644
--- a/tests/SharedLibrary/lib/res/values/strings.xml
+++ b/tests/SharedLibrary/lib/res/values/strings.xml
@@ -28,4 +28,5 @@
</string-array>
<string name="racoon">Racoon</string>
+ <string name="sample_layout">This is an example of a layout this library provides.</string>
</resources>
diff --git a/tests/SharedLibrary/lib/src/com/google/android/test/shared_library/ActivityMain.java b/tests/SharedLibrary/lib/src/com/google/android/test/shared_library/ActivityMain.java
index 895aced..4b4893c 100644
--- a/tests/SharedLibrary/lib/src/com/google/android/test/shared_library/ActivityMain.java
+++ b/tests/SharedLibrary/lib/src/com/google/android/test/shared_library/ActivityMain.java
@@ -18,15 +18,11 @@ package com.google.android.test.shared_library;
import android.app.Activity;
import android.os.Bundle;
-import android.widget.TextView;
public class ActivityMain extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
- TextView content = new TextView(this);
- content.setText("Dummy main entry for this apk; not really needed...");
- setContentView(content);
+ setContentView(R.layout.main);
}
}