Skip to content

Commit 9c27759

Browse files
committed
Fix reversed chapters 07 and 09
1 parent 4f0a2bc commit 9c27759

File tree

42 files changed

+98
-593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+98
-593
lines changed
File renamed without changes.

09/AndroidUIDemo/AndroidManifest.xml renamed to 07/AndroidUIDemo/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
android:versionCode="1"
4-
android:versionName="1.0.0" package="com.oreilly.demo.android.ch09">
4+
android:versionName="1.0.0" package="com.oreilly.demo.android.ch07">
55
<uses-sdk android:targetSdkVersion="9"></uses-sdk>
66
<application android:icon="@drawable/icon" android:label="@string/app_name">
77
<activity android:name=".TouchMe"
File renamed without changes.
6.9 KB
Loading
3.43 KB
Loading
2.51 KB
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.

09/AndroidUIDemo/src/com/oreilly/demo/android/ch09/TouchMe.java renamed to 07/AndroidUIDemo/src/com/oreilly/demo/android/ch07/TouchMe.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.oreilly.demo.android.ch09;
1+
package com.oreilly.demo.android.ch07;
22

33
import java.util.Random;
44

@@ -19,10 +19,9 @@
1919
import android.widget.EditText;
2020
import android.widget.LinearLayout;
2121

22-
import com.oreilly.demo.android.ch09.R;
23-
import com.oreilly.demo.android.ch09.model.Dot;
24-
import com.oreilly.demo.android.ch09.model.Dots;
25-
import com.oreilly.demo.android.ch09.view.DotView;
22+
import com.oreilly.demo.android.ch07.model.Dot;
23+
import com.oreilly.demo.android.ch07.model.Dots;
24+
import com.oreilly.demo.android.ch07.view.DotView;
2625

2726

2827
/**
@@ -87,7 +86,7 @@ private final class DotGenerator implements Runnable {
8786

8887
private final Handler hdlr = new Handler();
8988
private final Runnable makeDots = new Runnable() {
90-
public void run() { makeDot(dots, view, color); }
89+
@Override public void run() { makeDot(dots, view, color); }
9190
};
9291

9392
private volatile boolean done;
@@ -100,6 +99,7 @@ private final class DotGenerator implements Runnable {
10099

101100
public void done() { done = true; }
102101

102+
@Override
103103
public void run() {
104104
while (!done) {
105105
hdlr.post(makeDots);
@@ -113,7 +113,7 @@ public void run() {
113113

114114
/** The application model */
115115
final Dots dotModel = new Dots();
116-
116+
117117
/** The application view */
118118
DotView dotView;
119119

@@ -126,7 +126,7 @@ public void run() {
126126

127127
dotView = new DotView(this, dotModel);
128128
dotView.setOnCreateContextMenuListener(this);
129-
129+
130130
// install the view
131131
setContentView(R.layout.main);
132132
((LinearLayout) findViewById(R.id.root)).addView(dotView, 0);
@@ -191,15 +191,15 @@ else if (hasFocus && (null == dotGenerator)) {
191191
dotView.invalidate();
192192
} });
193193
}
194-
194+
195195
/** Install an options menu. */
196196
@Override public boolean onCreateOptionsMenu(Menu menu) {
197197
super.onCreateOptionsMenu(menu);
198198
menu.add(Menu.NONE, 1, Menu.NONE, "Clear")
199199
.setAlphabeticShortcut('x');
200200
return true;
201201
}
202-
202+
203203
/** Respond to an options menu selection. */
204204
@Override public boolean onOptionsItemSelected(MenuItem item) {
205205
switch (item.getItemId()) {
@@ -221,7 +221,7 @@ else if (hasFocus && (null == dotGenerator)) {
221221
menu.add(Menu.NONE, 1, Menu.NONE, "Clear")
222222
.setAlphabeticShortcut('x');
223223
}
224-
224+
225225
/** Respond to a context menu selection. */
226226
@Override public boolean onContextItemSelected(MenuItem item) {
227227
switch (item.getItemId()) {

0 commit comments

Comments
 (0)