aboutsummaryrefslogtreecommitdiffstats
path: root/testapps/basicProjectWithJava
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2011-01-16 19:06:18 -0800
committerXavier Ducrohet <xav@android.com>2011-01-16 19:06:18 -0800
commite9b03254100808c9515df6956a735fa1d8cecc8c (patch)
tree97771f97b5f5a603f198f2f17529dbd34f3d4cf2 /testapps/basicProjectWithJava
parente8f078a7d240caf687a62cc200bdda339d70f814 (diff)
downloadsdk-e9b03254100808c9515df6956a735fa1d8cecc8c.zip
sdk-e9b03254100808c9515df6956a735fa1d8cecc8c.tar.gz
sdk-e9b03254100808c9515df6956a735fa1d8cecc8c.tar.bz2
Update test project with java dependency.
The android project now has a custom view that depends on a class in the referenced Java project. Change-Id: I59db9dd3b771731e8bd30f9da8072755eee3ce96
Diffstat (limited to 'testapps/basicProjectWithJava')
-rw-r--r--testapps/basicProjectWithJava/res/layout/main.xml11
-rw-r--r--testapps/basicProjectWithJava/src/com/android/tests/basicProjectWithJava/MyTextView.java27
2 files changed, 35 insertions, 3 deletions
diff --git a/testapps/basicProjectWithJava/res/layout/main.xml b/testapps/basicProjectWithJava/res/layout/main.xml
index c7a95da..670dd32 100644
--- a/testapps/basicProjectWithJava/res/layout/main.xml
+++ b/testapps/basicProjectWithJava/res/layout/main.xml
@@ -4,10 +4,15 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
-<TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
+<TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
android:text="basicProjectWithJava"
android:id="@+id/text"
/>
+<com.android.tests.basicProjectWithJava.MyTextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/text"
+ />
</LinearLayout>
diff --git a/testapps/basicProjectWithJava/src/com/android/tests/basicProjectWithJava/MyTextView.java b/testapps/basicProjectWithJava/src/com/android/tests/basicProjectWithJava/MyTextView.java
new file mode 100644
index 0000000..ae35dca
--- /dev/null
+++ b/testapps/basicProjectWithJava/src/com/android/tests/basicProjectWithJava/MyTextView.java
@@ -0,0 +1,27 @@
+package com.android.tests.basicProjectWithJava;
+
+import com.android.tests.basicJavaProject.Foo;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.TextView;
+
+public class MyTextView extends TextView {
+
+ public MyTextView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+
+ Foo f = new Foo();
+ setText("Foo: " + f.getRandomFoo());
+ }
+
+ public MyTextView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ Foo f = new Foo();
+ setText("Foo: " + f.getRandomFoo());
+ }
+
+ public MyTextView(Context context) {
+ super(context);
+ }
+}