Skip to content

Commit fda73bf

Browse files
committed
Add ch11 code
1 parent d5d8988 commit fda73bf

27 files changed

+1239
-3
lines changed

Diff for: AsyncTaskDemo/src/com/oreilly/demo/android/pa/asynctask/AsyncTaskDemo.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ public void onCreate(Bundle state) {
8080
((Button) findViewById(R.id.start)).setOnClickListener(
8181
new View.OnClickListener() {
8282
@Override public void onClick(View v) {
83-
//initGame(
83+
// initGame(
8484
new AsyncInitGame(
8585
dots,
8686
bg,
8787
game,
88-
//msg,
89-
//"basic");
88+
// msg,
89+
// "basic");
9090
msg)
9191
.execute("basic");
9292
} });

Diff for: UIFramework/AndroidManifest.xml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.finchframework.uiframework"
4+
android:versionCode="1"
5+
android:versionName="1.0">
6+
<uses-sdk android:minSdkVersion="15" />
7+
8+
<application android:icon="@drawable/icon" android:label="@string/app_name"
9+
android:uiOptions="splitActionBarWhenNarrow" android:theme="@android:style/Theme.Holo">
10+
<activity android:name=".ListAndContentActivity"
11+
android:label="@string/app_name">
12+
<intent-filter>
13+
<action android:name="android.intent.action.MAIN" />
14+
<category android:name="android.intent.category.LAUNCHER" />
15+
</intent-filter>
16+
</activity>
17+
<activity android:name="ContentControlActivity" android:label="@string/data"></activity>
18+
19+
</application>
20+
</manifest>

Diff for: UIFramework/proguard.cfg

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-optimizationpasses 5
2+
-dontusemixedcaseclassnames
3+
-dontskipnonpubliclibraryclasses
4+
-dontpreverify
5+
-verbose
6+
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7+
8+
-keep public class * extends android.app.Activity
9+
-keep public class * extends android.app.Application
10+
-keep public class * extends android.app.Service
11+
-keep public class * extends android.content.BroadcastReceiver
12+
-keep public class * extends android.content.ContentProvider
13+
-keep public class * extends android.app.backup.BackupAgentHelper
14+
-keep public class * extends android.preference.Preference
15+
-keep public class com.android.vending.licensing.ILicensingService
16+
17+
-keepclasseswithmembernames class * {
18+
native <methods>;
19+
}
20+
21+
-keepclasseswithmembers class * {
22+
public <init>(android.content.Context, android.util.AttributeSet);
23+
}
24+
25+
-keepclasseswithmembers class * {
26+
public <init>(android.content.Context, android.util.AttributeSet, int);
27+
}
28+
29+
-keepclassmembers class * extends android.app.Activity {
30+
public void *(android.view.View);
31+
}
32+
33+
-keepclassmembers enum * {
34+
public static **[] values();
35+
public static ** valueOf(java.lang.String);
36+
}
37+
38+
-keep class * implements android.os.Parcelable {
39+
public static final android.os.Parcelable$Creator *;
40+
}

Diff for: UIFramework/project.properties

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system use,
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
10+
# Project target.
11+
target=android-15

Diff for: UIFramework/res/drawable-hdpi/icon.png

4.05 KB
Loading

Diff for: UIFramework/res/drawable-ldpi/icon.png

1.68 KB
Loading

Diff for: UIFramework/res/drawable-mdpi/icon.png

2.51 KB
Loading

Diff for: UIFramework/res/layout-large-port/main.xml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="fill_parent"
5+
android:orientation="vertical" >
6+
7+
<fragment
8+
android:id="@+id/list_frag"
9+
android:name="com.finchframework.uiframework.QueryResultsListFragment"
10+
android:layout_width="match_parent"
11+
android:layout_height="match_parent"
12+
class="com.finchframework.uiframework.QueryResultsListFragment" />
13+
14+
<LinearLayout
15+
xmlns:android="http://schemas.android.com/apk/res/android"
16+
android:layout_width="match_parent"
17+
android:layout_height="match_parent"
18+
android:orientation="vertical" >
19+
20+
<fragment
21+
android:id="@+id/content_frag"
22+
android:name="com.finchframework.uiframework.ContentFragment"
23+
android:layout_width="match_parent"
24+
android:layout_height="match_parent"
25+
class="com.finchframework.uiframework.ContentFragment" />
26+
27+
<fragment
28+
android:id="@+id/detail_frag"
29+
android:name="com.finchframework.uiframework.DetailFragment"
30+
android:layout_width="match_parent"
31+
android:layout_height="match_parent"
32+
class="com.finchframework.uiframework.DetailFragment" />
33+
</LinearLayout>
34+
35+
</LinearLayout>

Diff for: UIFramework/res/layout-large/main.xml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="fill_parent"
5+
android:id="@+id/content_layout"
6+
android:orientation="horizontal" >
7+
8+
<fragment
9+
android:id="@+id/list_frag"
10+
android:name="com.finchframework.uiframework.QueryResultsListFragment"
11+
android:layout_width="250dp"
12+
android:layout_height="match_parent"
13+
class="com.finchframework.uiframework.QueryResultsListFragment" />
14+
15+
<LinearLayout
16+
xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:layout_width="match_parent"
18+
android:layout_height="match_parent"
19+
android:orientation="vertical" >
20+
21+
<fragment
22+
android:id="@+id/content_frag"
23+
android:name="com.finchframework.uiframework.ContentFragment"
24+
android:layout_width="match_parent"
25+
android:layout_height="match_parent"
26+
class="com.finchframework.uiframework.ContentFragment" />
27+
28+
<fragment
29+
android:id="@+id/detail_frag"
30+
android:name="com.finchframework.uiframework.DetailFragment"
31+
android:layout_width="match_parent"
32+
android:layout_height="match_parent"
33+
class="com.finchframework.uiframework.DetailFragment" />
34+
</LinearLayout>
35+
36+
</LinearLayout>

Diff for: UIFramework/res/layout/content.xml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent" >
5+
6+
<EditText
7+
android:id="@+id/editText1"
8+
android:layout_width="match_parent"
9+
android:layout_height="wrap_content"
10+
android:ems="10"
11+
android:text="@string/empty_content"
12+
android:textSize="45sp" >
13+
14+
<requestFocus />
15+
</EditText>
16+
17+
</FrameLayout>

Diff for: UIFramework/res/layout/content_control_activity.xml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:id="@+id/content_layout"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:orientation="vertical" >
7+
8+
<fragment
9+
android:id="@+id/content_frag"
10+
android:name="com.finchframework.uiframework.ContentFragment"
11+
android:layout_width="match_parent"
12+
android:layout_height="match_parent"
13+
class="com.finchframework.uiframework.ContentFragment" />
14+
15+
<fragment
16+
android:id="@+id/detail_frag"
17+
android:name="com.finchframework.uiframework.DetailFragment"
18+
android:layout_width="match_parent"
19+
android:layout_height="match_parent"
20+
class="com.finchframework.uiframework.DetailFragment"/>
21+
22+
</LinearLayout>

Diff for: UIFramework/res/layout/control.xml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<MediaController xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent" >
5+
6+
7+
</MediaController>

Diff for: UIFramework/res/layout/detail.xml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent" >
5+
6+
<EditText
7+
xmlns:android="http://schemas.android.com/apk/res/android"
8+
android:id="@+id/detail_text"
9+
android:layout_width="match_parent"
10+
android:layout_height="match_parent"
11+
android:text="@string/empty_detail"
12+
android:textSize="35sp" >
13+
</EditText>
14+
15+
</FrameLayout>

Diff for: UIFramework/res/layout/list_frag_list.xml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent" >
5+
6+
7+
</ListView>

Diff for: UIFramework/res/layout/main.xml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="fill_parent"
5+
android:orientation="horizontal" >
6+
7+
<fragment
8+
android:id="@+id/list_frag"
9+
android:name="com.finchframework.uiframework.QueryResultsListFragment"
10+
android:layout_width="match_parent"
11+
android:layout_height="match_parent"
12+
class="com.finchframework.uiframework.QueryResultsListFragment" />
13+
14+
15+
</LinearLayout>

Diff for: UIFramework/res/menu/control_menu.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<menu xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<item android:id="@+id/itemPlay" android:title="@string/play"></item>
5+
<item android:id="@+id/itemPause" android:title="@string/pause"></item>
6+
</menu>

Diff for: UIFramework/res/menu/search_menu.xml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
3+
<item android:id="@+id/menu_search"
4+
android:icon="@android:drawable/ic_menu_search"
5+
android:showAsAction="ifRoom|collapseActionView"
6+
android:actionViewClass="android.widget.SearchView" />
7+
8+
</menu>

Diff for: UIFramework/res/values/strings.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="hello">Hello World, ListAndContentActivity!</string>
4+
<string name="app_name">UIFramework</string>
5+
<string name="empty_content">An empty content fragment</string>
6+
<string name="play">Play</string>
7+
<string name="pause">Pause</string>
8+
<string name="detail">Details</string>
9+
<string name="content">Content</string>
10+
<string name="empty_detail">An empty detail fragment</string>
11+
<string name="data">Data</string>
12+
</resources>

0 commit comments

Comments
 (0)