Skip to content

Commit f93c51f

Browse files
committed
Merge the two PA example repos
Conflicts: .gitignore 02/FillListTask/tools/ide/eclipse/classpath 02/SharedListTask/tools/ide/eclipse/classpath 03/TestApp/tools/ide/eclipse/classpath 06/AIDLDemo/tools/ide/eclipse/classpath 06/AsyncTaskDemo/tools/ide/eclipse/classpath 07/AndroidUIDemo/tools/ide/eclipse/classpath 08/SimpleFragment/default.properties 10/MicroJobs/tools/ant/build.xml 11/FinchLifecycle/default.properties 11/FinchLifecycle/proguard.cfg 11/FinchLifecycleBackport/proguard.cfg 12/FinchVideo/tools/ant/build.xml 16/SensorDemos/default.properties 16/SensorDemos/proguard.cfg 17/ClientDemo/default.properties 18/NDKDemo/default.properties AIDLDemo/project.properties AIDLDemo/tools/ide/eclipse/classpath AndroidUIDemo/project.properties AndroidUIDemo/res/layout/main.xml AndroidUIDemo/res/values/colors.xml AndroidUIDemo/src/com/oreilly/demo/android/pa/uidemo/view/DotView.java AndroidUIDemo/tools/ide/eclipse/classpath AndroidViewDemo/project.properties AsyncTaskDemo/proguard.cfg AsyncTaskDemo/tools/ant/build.xml AudioPlayer/proguard.cfg FillListTask/tools/ide/eclipse/classpath FinchChat/tools/ide/eclipse/classpath FinchFramework/project.properties FinchFramework/src/com/finchframework/finch/views/MesgEditText.java FinchLifecycle/project.properties FinchLifecycle/tools/ant/build.xml FinchLifecycle/tools/ide/eclipse/classpath FinchLifecycleBackport/proguard.cfg FinchLifecycleBackport/project.properties FinchVideo/project.properties FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/FinchVideoActivity.java NDKDemo/proguard.cfg NDKDemo/tools/ant/build.xml README.txt SearchDemo/project.properties SensorDemos/proguard.cfg SharedListTask/tools/ide/eclipse/classpath UIFramework/proguard.cfg UIFramework/project.properties
2 parents 4800c4a + 8cdbaf9 commit f93c51f

File tree

27 files changed

+98
-159
lines changed

27 files changed

+98
-159
lines changed

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
.classpath
44
.project
55
.settings
6+
.metadata
67
bin
78
gen
89
lint.xml
9-
/.metadata
1010

Diff for: AIDLDemo/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# project structure.
99

1010
# Project target.
11-
target=android-14
11+
target=android-15

Diff for: AndroidUIDemo/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# project structure.
99

1010
# Project target.
11-
target=android-14
11+
target=android-15

Diff for: AndroidViewDemo/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# project structure.
99

1010
# Project target.
11-
target=android-14
11+
target=android-15

Diff for: AsyncTaskDemo/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# project structure.
99

1010
# Project target.
11-
target=android-14
11+
target=android-15

Diff for: ClientDemo/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# project structure.
99

1010
# Project target.
11-
target=android-14
11+
target=android-15

Diff for: ContactViewer/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# project structure.
99

1010
# Project target.
11-
target=android-7
11+
target=android-15

Diff for: FinchChat/AndroidManifest.xml

+21-14
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.finchframework.finch"
4-
android:versionCode="1"
5-
android:versionName="1.0">
6-
<application android:icon="@drawable/icon"
7-
android:label="@string/app_name"
8-
android:debuggable="true">
9-
<activity android:name=".FinchWelcome"
10-
android:label="@string/app_name">
3+
package="com.finchframework.finch"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<application
8+
android:debuggable="true"
9+
android:icon="@drawable/icon"
10+
android:label="@string/app_name" >
11+
<activity
12+
android:name=".FinchWelcome"
13+
android:label="@string/app_name" >
1114
<intent-filter>
1215
<action android:name="android.intent.action.MAIN" />
16+
1317
<category android:name="android.intent.category.LAUNCHER" />
1418
</intent-filter>
1519
</activity>
1620
<activity android:name="com.finchframework.bluetooth.BtConsoleActivity" />
17-
<activity android:name="com.finchframework.bluetooth.DeviceListActivity"
18-
android:label="@string/select_device"
19-
android:configChanges="orientation|keyboardHidden"/>
20-
<activity android:name="animate.AnimateActivity"></activity>
21+
<activity
22+
android:name="com.finchframework.bluetooth.DeviceListActivity"
23+
android:configChanges="orientation|keyboardHidden"
24+
android:label="@string/select_device" />
25+
<activity android:name="animate.AnimateActivity" >
26+
</activity>
2127
</application>
2228

2329
<uses-permission android:name="android.permission.INTERNET" />
2430
<uses-permission android:name="android.permission.BLUETOOTH" />
25-
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
31+
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
2632

2733
<uses-sdk android:minSdkVersion="7" />
28-
</manifest>
34+
35+
</manifest>

Diff for: FinchChat/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
# project structure.
99

1010
# Project target.
11-
target=android-14
11+
target=android-15
1212
android.library=false

Diff for: FinchFramework/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
# project structure.
99

1010
# Project target.
11-
target=android-14
11+
target=android-15
1212
android.library=true

Diff for: FinchFramework/src/com/finchframework/finch/views/MesgEditText.java

-87
This file was deleted.

Diff for: FinchLifecycle/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# project structure.
99

1010
# Project target.
11-
target=android-14
11+
target=android-15

Diff for: FinchLifecycleBackport/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
# project structure.
99

1010
# Project target.
11-
target=android-7
11+
target=android-15
1212
android.library.reference.1=../FinchFramework

Diff for: FinchVideo/AndroidManifest.xml

+29-19
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.oreilly.demo.android.pa.finchvideo"
4-
android:versionCode="1"
5-
android:versionName="1.0">
6-
<application android:icon="@drawable/icon"
7-
android:label="@string/app_name"
8-
android:debuggable="true">
9-
<provider android:name=".provider.FinchVideoContentProvider"
10-
android:authorities="com.oreilly.demo.android.pa.finchvideo.FinchVideo"
11-
/>
12-
<provider android:name=".provider.SimpleFinchVideoContentProvider"
13-
android:authorities="com.oreilly.demo.android.pa.finchvideo.SimpleFinchVideo"
14-
/>
15-
<activity android:name=".FinchVideoActivity"
16-
android:label="@string/finch_video_app_name" >
3+
package="com.oreilly.demo.android.pa.finchvideo"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-permission android:name="android.permission.INTERNET" />
8+
9+
<uses-sdk android:minSdkVersion="7" />
10+
11+
<application
12+
android:debuggable="true"
13+
android:icon="@drawable/icon"
14+
android:label="@string/app_name" >
15+
<provider
16+
android:name=".provider.FinchVideoContentProvider"
17+
android:authorities="com.oreilly.demo.android.pa.finchvideo.FinchVideo" />
18+
<provider
19+
android:name=".provider.SimpleFinchVideoContentProvider"
20+
android:authorities="com.oreilly.demo.android.pa.finchvideo.SimpleFinchVideo" />
21+
22+
<activity
23+
android:name=".FinchVideoActivity"
24+
android:label="@string/finch_video_app_name" >
1725
<intent-filter>
1826
<action android:name="android.intent.action.MAIN" />
27+
1928
<category android:name="android.intent.category.LAUNCHER" />
2029
</intent-filter>
2130
</activity>
22-
<activity android:name=".SimpleFinchVideoActivity"
23-
android:label="Simple Video Activity">
31+
<activity
32+
android:name=".SimpleFinchVideoActivity"
33+
android:label="Simple Video Activity" >
2434
<intent-filter>
2535
<action android:name="android.intent.action.MAIN" />
36+
2637
<category android:name="android.intent.category.LAUNCHER" />
2738
</intent-filter>
2839
</activity>
2940
</application>
30-
<uses-permission android:name="android.permission.INTERNET" />
31-
<uses-sdk android:minSdkVersion="7" />
32-
</manifest>
41+
42+
</manifest>

Diff for: FinchVideo/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
# project structure.
99

1010
# Project target.
11-
target=android-14
11+
target=android-15
1212
android.library.reference.1=../FinchFramework

Diff for: FinchVideo/res/layout/video_query_activity.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
2020
android:layout_gravity="center_horizontal"
2121
android:background="@color/medium_gray"
2222
>
23-
<com.finchframework.finch.views.MesgEditText
23+
<EditText
2424
android:id="@+id/video_search_box"
2525
android:width="0px"
2626
android:height="40px"
2727
android:layout_weight="1"
2828
android:layout_width="wrap_content"
2929
android:layout_height="wrap_content"
30-
android:text="@string/finch_video_search"
3130
android:lines="1"
3231
android:singleLine="true"
3332
/>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<string name="finch_video_app_name">Finch Video</string>
44
<string name="finch_video_update_content">Update Content</string>
55
<string name="finch_video_search">Search Videos</string>
6-
<string name="app_name">YouTube Video Example</string>
6+
<string name="app_name">FinchVideo</string>
77

88
<string name="simple_insert_text">Insert</string>
99
<string name="title">Title</string>

Diff for: FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/FinchVideoActivity.java

+20-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import android.graphics.BitmapFactory;
99
import android.net.Uri;
1010
import android.os.Bundle;
11+
import android.text.Editable;
1112
import android.util.Log;
1213
import android.view.KeyEvent;
1314
import android.view.View;
@@ -17,8 +18,9 @@
1718
import android.widget.ListView;
1819
import android.widget.SimpleCursorAdapter;
1920
import android.widget.TextView;
21+
2022
import com.finchframework.finch.Finch;
21-
import com.finchframework.finch.views.MesgEditText;
23+
2224
import com.oreilly.demo.android.pa.finchvideo.provider.FinchVideo;
2325

2426
import java.io.FileNotFoundException;
@@ -33,7 +35,7 @@
3335
public class FinchVideoActivity extends Activity {
3436
SimpleCursorAdapter mAdapter;
3537

36-
private MesgEditText mSearchText;
38+
private EditText mSearchText;
3739

3840
@Override
3941
public void onCreate(Bundle savedInstanceState) {
@@ -83,8 +85,7 @@ public boolean setViewValue(View view, Cursor cursor, int i) {
8385

8486
searchList.setAdapter(mAdapter);
8587

86-
mSearchText = (MesgEditText) findViewById(R.id.video_search_box);
87-
mSearchText.setMesgText(r.getString(R.string.finch_video_search));
88+
mSearchText = (EditText) findViewById(R.id.video_search_box);
8889
mSearchText.setOnEditorActionListener(
8990
new EditText.OnEditorActionListener() {
9091
@Override
@@ -137,15 +138,28 @@ void setThumbResource(View view, Cursor cursor) {
137138

138139
// sends the query to the finch video content provider
139140
void query() {
140-
if (!mSearchText.searchEmpty()) {
141+
String searchText = getText();
142+
if (!searchEmpty(searchText)) {
141143
String queryString =
142144
FinchVideo.Videos.QUERY_PARAM_NAME + "=" +
143-
Uri.encode(mSearchText.getText().toString());
145+
Uri.encode(searchText.toString());
144146
Uri queryUri =
145147
Uri.parse(FinchVideo.Videos.CONTENT_URI + "?" +
146148
queryString);
147149
Cursor c = managedQuery(queryUri, null, null, null, null);
148150
mAdapter.changeCursor(c);
149151
}
150152
}
153+
154+
private String getText() {
155+
Editable editable = mSearchText.getText();
156+
if (editable != null) {
157+
return editable.toString();
158+
}
159+
return null;
160+
}
161+
162+
private boolean searchEmpty(String text) {
163+
return (text != null) && ("".equals(text));
164+
}
151165
}

Diff for: FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/provider/FinchVideo.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public class FinchVideo {
2323
public static final int MEDIA_ID_COLUMN = 8;
2424

2525
public static final String AUTHORITY =
26-
"com.oreilly.demo.pa.finchvideo.FinchVideo";
26+
"com.oreilly.demo.android.pa.finchvideo.FinchVideo";
2727

2828
public static final String SIMPLE_AUTHORITY =
29-
"com.oreilly.demo.pa.finchvideo.SimpleFinchVideo";
29+
"com.oreilly.demo.android.pa.finchvideo.SimpleFinchVideo";
3030
/**
3131
* Simple Videos columns
3232
*/

Diff for: FinchVideo/src/com/oreilly/demo/android/pa/finchvideo/provider/FinchVideoContentProvider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class FinchVideoContentProvider extends RESTfulContentProvider {
3232
public static final String VIDEOS_TABLE_NAME = "video";
3333

3434
private static final String FILE_CACHE_DIR =
35-
"/data/data/com.oreilly.demo.pa.finchvideo/file_cache";
35+
"/data/data/com.oreilly.demo.android.pa.finchvideo/file_cache";
3636

3737
private static final int VIDEOS = 1;
3838
private static final int VIDEO_ID = 2;

0 commit comments

Comments
 (0)