Permalink
Browse files

converted tabs to spaces

  • Loading branch information...
1 parent a8f991e commit 7083f69c6c619ac6687a1c1f470fc3db0506f202 @commonsguy committed Jul 23, 2011
Showing with 9,287 additions and 9,287 deletions.
  1. +16 −16 02-SimpleForm/LunchList/AndroidManifest.xml
  2. +50 −50 02-SimpleForm/LunchList/build.xml
  3. +39 −39 02-SimpleForm/LunchList/res/layout/main.xml
  4. +1 −1 02-SimpleForm/LunchList/res/values/strings.xml
  5. +21 −21 02-SimpleForm/LunchList/src/apt/tutorial/LunchList.java
  6. +18 −18 02-SimpleForm/LunchList/src/apt/tutorial/Restaurant.java
  7. +16 −16 03-FancierForm/LunchList/AndroidManifest.xml
  8. +50 −50 03-FancierForm/LunchList/build.xml
  9. +33 −33 03-FancierForm/LunchList/res/layout/main.xml
  10. +1 −1 03-FancierForm/LunchList/res/values/strings.xml
  11. +37 −37 03-FancierForm/LunchList/src/apt/tutorial/LunchList.java
  12. +27 −27 03-FancierForm/LunchList/src/apt/tutorial/Restaurant.java
  13. +16 −16 04-ListView/LunchList/AndroidManifest.xml
  14. +50 −50 04-ListView/LunchList/build.xml
  15. +45 −45 04-ListView/LunchList/res/layout/main.xml
  16. +1 −1 04-ListView/LunchList/res/values/strings.xml
  17. +48 −48 04-ListView/LunchList/src/apt/tutorial/LunchList.java
  18. +31 −31 04-ListView/LunchList/src/apt/tutorial/Restaurant.java
  19. +16 −16 05-FancyList/LunchList/AndroidManifest.xml
  20. +50 −50 05-FancyList/LunchList/build.xml
  21. +45 −45 05-FancyList/LunchList/res/layout/main.xml
  22. +35 −35 05-FancyList/LunchList/res/layout/row.xml
  23. +1 −1 05-FancyList/LunchList/res/values/strings.xml
  24. +100 −100 05-FancyList/LunchList/src/apt/tutorial/LunchList.java
  25. +31 −31 05-FancyList/LunchList/src/apt/tutorial/Restaurant.java
  26. +16 −16 06-Tabs/LunchList/AndroidManifest.xml
  27. +50 −50 06-Tabs/LunchList/build.xml
  28. +57 −57 06-Tabs/LunchList/res/layout/main.xml
  29. +35 −35 06-Tabs/LunchList/res/layout/row.xml
  30. +1 −1 06-Tabs/LunchList/res/values/strings.xml
  31. +142 −142 06-Tabs/LunchList/src/apt/tutorial/LunchList.java
  32. +31 −31 06-Tabs/LunchList/src/apt/tutorial/Restaurant.java
  33. +16 −16 07-MenusMessages/LunchList/AndroidManifest.xml
  34. +50 −50 07-MenusMessages/LunchList/build.xml
  35. +71 −71 07-MenusMessages/LunchList/res/layout/main.xml
  36. +35 −35 07-MenusMessages/LunchList/res/layout/row.xml
  37. +4 −4 07-MenusMessages/LunchList/res/menu/option.xml
  38. +1 −1 07-MenusMessages/LunchList/res/values/strings.xml
  39. +169 −169 07-MenusMessages/LunchList/src/apt/tutorial/LunchList.java
  40. +40 −40 07-MenusMessages/LunchList/src/apt/tutorial/Restaurant.java
  41. +16 −16 08-Threads/LunchList/AndroidManifest.xml
  42. +50 −50 08-Threads/LunchList/build.xml
  43. +71 −71 08-Threads/LunchList/res/layout/main.xml
  44. +35 −35 08-Threads/LunchList/res/layout/row.xml
  45. +8 −8 08-Threads/LunchList/res/menu/option.xml
  46. +1 −1 08-Threads/LunchList/res/values/strings.xml
  47. +203 −203 08-Threads/LunchList/src/apt/tutorial/LunchList.java
  48. +40 −40 08-Threads/LunchList/src/apt/tutorial/Restaurant.java
  49. +16 −16 09-Lifecycle/LunchList/AndroidManifest.xml
  50. +50 −50 09-Lifecycle/LunchList/build.xml
  51. +71 −71 09-Lifecycle/LunchList/res/layout/main.xml
  52. +35 −35 09-Lifecycle/LunchList/res/layout/row.xml
  53. +8 −8 09-Lifecycle/LunchList/res/menu/option.xml
  54. +1 −1 09-Lifecycle/LunchList/res/values/strings.xml
  55. +230 −230 09-Lifecycle/LunchList/src/apt/tutorial/LunchList.java
  56. +40 −40 09-Lifecycle/LunchList/src/apt/tutorial/Restaurant.java
  57. +16 −16 10-Resources/LunchList/AndroidManifest.xml
  58. +50 −50 10-Resources/LunchList/build.xml
  59. +91 −91 10-Resources/LunchList/res/layout-land/main.xml
  60. +71 −71 10-Resources/LunchList/res/layout/main.xml
  61. +35 −35 10-Resources/LunchList/res/layout/row.xml
  62. +8 −8 10-Resources/LunchList/res/menu/option.xml
  63. +1 −1 10-Resources/LunchList/res/values/strings.xml
  64. +230 −230 10-Resources/LunchList/src/apt/tutorial/LunchList.java
  65. +40 −40 10-Resources/LunchList/src/apt/tutorial/Restaurant.java
  66. +16 −16 11-Database/LunchList/AndroidManifest.xml
  67. +50 −50 11-Database/LunchList/build.xml
  68. +91 −91 11-Database/LunchList/res/layout-land/main.xml
  69. +76 −76 11-Database/LunchList/res/layout/main.xml
  70. +35 −35 11-Database/LunchList/res/layout/row.xml
  71. +8 −8 11-Database/LunchList/res/menu/option.xml
  72. +1 −1 11-Database/LunchList/res/values/strings.xml
  73. +154 −154 11-Database/LunchList/src/apt/tutorial/LunchList.java
  74. +49 −49 11-Database/LunchList/src/apt/tutorial/RestaurantHelper.java
  75. +17 −17 12-Activities/LunchList/AndroidManifest.xml
  76. +50 −50 12-Activities/LunchList/build.xml
  77. +47 −47 12-Activities/LunchList/res/layout/detail_form.xml
  78. +12 −12 12-Activities/LunchList/res/layout/main.xml
  79. +35 −35 12-Activities/LunchList/res/layout/row.xml
  80. +4 −4 12-Activities/LunchList/res/menu/option.xml
  81. +1 −1 12-Activities/LunchList/res/values/strings.xml
  82. +84 −84 12-Activities/LunchList/src/apt/tutorial/DetailForm.java
  83. +100 −100 12-Activities/LunchList/src/apt/tutorial/LunchList.java
  84. +70 −70 12-Activities/LunchList/src/apt/tutorial/RestaurantHelper.java
  85. +18 −18 13-Prefs/LunchList/AndroidManifest.xml
  86. +50 −50 13-Prefs/LunchList/build.xml
  87. +47 −47 13-Prefs/LunchList/res/layout/detail_form.xml
  88. +12 −12 13-Prefs/LunchList/res/layout/main.xml
  89. +35 −35 13-Prefs/LunchList/res/layout/row.xml
  90. +8 −8 13-Prefs/LunchList/res/menu/option.xml
  91. +14 −14 13-Prefs/LunchList/res/values/arrays.xml
  92. +1 −1 13-Prefs/LunchList/res/values/strings.xml
  93. +8 −8 13-Prefs/LunchList/res/xml/preferences.xml
  94. +85 −85 13-Prefs/LunchList/src/apt/tutorial/DetailForm.java
  95. +6 −6 13-Prefs/LunchList/src/apt/tutorial/EditPreferences.java
  96. +126 −126 13-Prefs/LunchList/src/apt/tutorial/LunchList.java
  97. +70 −70 13-Prefs/LunchList/src/apt/tutorial/RestaurantHelper.java
  98. +18 −18 14-Rotation/LunchList/AndroidManifest.xml
  99. +50 −50 14-Rotation/LunchList/build.xml
  100. +53 −53 14-Rotation/LunchList/res/layout-land/detail_form.xml
  101. +47 −47 14-Rotation/LunchList/res/layout/detail_form.xml
  102. +12 −12 14-Rotation/LunchList/res/layout/main.xml
  103. +35 −35 14-Rotation/LunchList/res/layout/row.xml
  104. +8 −8 14-Rotation/LunchList/res/menu/option.xml
  105. +14 −14 14-Rotation/LunchList/res/values/arrays.xml
  106. +1 −1 14-Rotation/LunchList/res/values/strings.xml
  107. +8 −8 14-Rotation/LunchList/res/xml/preferences.xml
  108. +104 −104 14-Rotation/LunchList/src/apt/tutorial/DetailForm.java
  109. +6 −6 14-Rotation/LunchList/src/apt/tutorial/EditPreferences.java
  110. +126 −126 14-Rotation/LunchList/src/apt/tutorial/LunchList.java
  111. +70 −70 14-Rotation/LunchList/src/apt/tutorial/RestaurantHelper.java
  112. +21 −21 15-Internet/LunchList/AndroidManifest.xml
  113. +50 −50 15-Internet/LunchList/build.xml
  114. +58 −58 15-Internet/LunchList/res/layout-land/detail_form.xml
  115. +48 −48 15-Internet/LunchList/res/layout/detail_form.xml
  116. +12 −12 15-Internet/LunchList/res/layout/main.xml
  117. +35 −35 15-Internet/LunchList/res/layout/row.xml
  118. +4 −4 15-Internet/LunchList/res/menu/details_option.xml
  119. +8 −8 15-Internet/LunchList/res/menu/option.xml
  120. +14 −14 15-Internet/LunchList/res/values/arrays.xml
  121. +1 −1 15-Internet/LunchList/res/values/strings.xml
  122. +8 −8 15-Internet/LunchList/res/xml/preferences.xml
  123. +123 −123 15-Internet/LunchList/src/apt/tutorial/DetailForm.java
  124. +6 −6 15-Internet/LunchList/src/apt/tutorial/EditPreferences.java
  125. +136 −136 15-Internet/LunchList/src/apt/tutorial/FeedActivity.java
  126. +126 −126 15-Internet/LunchList/src/apt/tutorial/LunchList.java
  127. +76 −76 15-Internet/LunchList/src/apt/tutorial/RestaurantHelper.java
  128. +22 −22 16-Service/LunchList/AndroidManifest.xml
  129. +50 −50 16-Service/LunchList/build.xml
  130. +58 −58 16-Service/LunchList/res/layout-land/detail_form.xml
  131. +50 −50 16-Service/LunchList/res/layout/detail_form.xml
  132. +12 −12 16-Service/LunchList/res/layout/main.xml
  133. +35 −35 16-Service/LunchList/res/layout/row.xml
  134. +4 −4 16-Service/LunchList/res/menu/details_option.xml
  135. +8 −8 16-Service/LunchList/res/menu/option.xml
  136. +14 −14 16-Service/LunchList/res/values/arrays.xml
  137. +1 −1 16-Service/LunchList/res/values/strings.xml
  138. +8 −8 16-Service/LunchList/res/xml/preferences.xml
  139. +123 −123 16-Service/LunchList/src/apt/tutorial/DetailForm.java
  140. +6 −6 16-Service/LunchList/src/apt/tutorial/EditPreferences.java
  141. +127 −127 16-Service/LunchList/src/apt/tutorial/FeedActivity.java
  142. +31 −31 16-Service/LunchList/src/apt/tutorial/FeedService.java
  143. +126 −126 16-Service/LunchList/src/apt/tutorial/LunchList.java
  144. +76 −76 16-Service/LunchList/src/apt/tutorial/RestaurantHelper.java
  145. +23 −23 17-Location/LunchList/AndroidManifest.xml
  146. +50 −50 17-Location/LunchList/build.xml
  147. +68 −68 17-Location/LunchList/res/layout-land/detail_form.xml
  148. +50 −50 17-Location/LunchList/res/layout/detail_form.xml
  149. +12 −12 17-Location/LunchList/res/layout/main.xml
  150. +35 −35 17-Location/LunchList/res/layout/row.xml
  151. +8 −8 17-Location/LunchList/res/menu/details_option.xml
  152. +8 −8 17-Location/LunchList/res/menu/option.xml
  153. +14 −14 17-Location/LunchList/res/values/arrays.xml
  154. +1 −1 17-Location/LunchList/res/values/strings.xml
  155. +8 −8 17-Location/LunchList/res/xml/preferences.xml
  156. +177 −177 17-Location/LunchList/src/apt/tutorial/DetailForm.java
  157. +6 −6 17-Location/LunchList/src/apt/tutorial/EditPreferences.java
  158. +127 −127 17-Location/LunchList/src/apt/tutorial/FeedActivity.java
  159. +31 −31 17-Location/LunchList/src/apt/tutorial/FeedService.java
  160. +126 −126 17-Location/LunchList/src/apt/tutorial/LunchList.java
  161. +102 −102 17-Location/LunchList/src/apt/tutorial/RestaurantHelper.java
  162. +25 −25 18-Map/LunchList/AndroidManifest.xml
  163. +50 −50 18-Map/LunchList/build.xml
  164. +68 −68 18-Map/LunchList/res/layout-land/detail_form.xml
  165. +50 −50 18-Map/LunchList/res/layout/detail_form.xml
  166. +12 −12 18-Map/LunchList/res/layout/main.xml
  167. +6 −6 18-Map/LunchList/res/layout/map.xml
  168. +35 −35 18-Map/LunchList/res/layout/row.xml
  169. +12 −12 18-Map/LunchList/res/menu/details_option.xml
  170. +8 −8 18-Map/LunchList/res/menu/option.xml
  171. +14 −14 18-Map/LunchList/res/values/arrays.xml
  172. +1 −1 18-Map/LunchList/res/values/strings.xml
  173. +8 −8 18-Map/LunchList/res/xml/preferences.xml
  174. +194 −194 18-Map/LunchList/src/apt/tutorial/DetailForm.java
  175. +6 −6 18-Map/LunchList/src/apt/tutorial/EditPreferences.java
  176. +127 −127 18-Map/LunchList/src/apt/tutorial/FeedActivity.java
  177. +31 −31 18-Map/LunchList/src/apt/tutorial/FeedService.java
  178. +126 −126 18-Map/LunchList/src/apt/tutorial/LunchList.java
  179. +102 −102 18-Map/LunchList/src/apt/tutorial/RestaurantHelper.java
  180. +71 −71 18-Map/LunchList/src/apt/tutorial/RestaurantMap.java
  181. +34 −34 19-Alarm/LunchList/AndroidManifest.xml
  182. +50 −50 19-Alarm/LunchList/build.xml
  183. +68 −68 19-Alarm/LunchList/res/layout-land/detail_form.xml
  184. +6 −6 19-Alarm/LunchList/res/layout/alarm.xml
  185. +50 −50 19-Alarm/LunchList/res/layout/detail_form.xml
  186. +12 −12 19-Alarm/LunchList/res/layout/main.xml
  187. +6 −6 19-Alarm/LunchList/res/layout/map.xml
  188. +35 −35 19-Alarm/LunchList/res/layout/row.xml
  189. +12 −12 19-Alarm/LunchList/res/menu/details_option.xml
  190. +8 −8 19-Alarm/LunchList/res/menu/option.xml
  191. +14 −14 19-Alarm/LunchList/res/values/arrays.xml
  192. +1 −1 19-Alarm/LunchList/res/values/strings.xml
  193. +18 −18 19-Alarm/LunchList/res/xml/preferences.xml
  194. +5 −5 19-Alarm/LunchList/src/apt/tutorial/AlarmActivity.java
  195. +194 −194 19-Alarm/LunchList/src/apt/tutorial/DetailForm.java
  196. +54 −54 19-Alarm/LunchList/src/apt/tutorial/EditPreferences.java
  197. +127 −127 19-Alarm/LunchList/src/apt/tutorial/FeedActivity.java
  198. +31 −31 19-Alarm/LunchList/src/apt/tutorial/FeedService.java
  199. +126 −126 19-Alarm/LunchList/src/apt/tutorial/LunchList.java
  200. +8 −8 19-Alarm/LunchList/src/apt/tutorial/OnAlarmReceiver.java
  201. +35 −35 19-Alarm/LunchList/src/apt/tutorial/OnBootReceiver.java
  202. +102 −102 19-Alarm/LunchList/src/apt/tutorial/RestaurantHelper.java
  203. +71 −71 19-Alarm/LunchList/src/apt/tutorial/RestaurantMap.java
  204. +72 −72 19-Alarm/LunchList/src/apt/tutorial/TimePreference.java
  205. +34 −34 20-Notification/LunchList/AndroidManifest.xml
Sorry, we could not display the entire diff because too many files (479) changed.
View
32 02-SimpleForm/LunchList/AndroidManifest.xml 100755 → 100644
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1"
- android:versionName="1.0"
- package="apt.tutorial"
- xmlns:android="http://schemas.android.com/apk/res/android">
-
- <supports-screens android:largeScreens="true"
- android:normalScreens="true"
- android:smallScreens="false" />
- <application android:label="@string/app_name">
- <activity android:label="@string/app_name"
- android:name=".LunchList">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
+ android:versionName="1.0"
+ package="apt.tutorial"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <supports-screens android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="false" />
+ <application android:label="@string/app_name">
+ <activity android:label="@string/app_name"
+ android:name=".LunchList">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
</manifest>
View
100 02-SimpleForm/LunchList/build.xml
@@ -1,67 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="LunchList" default="help">
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked in in Version
- Control Systems. -->
- <property file="local.properties" />
+ <!-- The local.properties file is created and updated by the 'android' tool.
+ It contains the path to the SDK. It should *NOT* be checked in in Version
+ Control Systems. -->
+ <property file="local.properties" />
- <!-- The build.properties file can be created by you and is never touched
- by the 'android' tool. This is the place to change some of the default property values
- used by the Ant rules.
- Here are some properties you may want to change/update:
+ <!-- The build.properties file can be created by you and is never touched
+ by the 'android' tool. This is the place to change some of the default property values
+ used by the Ant rules.
+ Here are some properties you may want to change/update:
- application.package
- the name of your application package as defined in the manifest. Used by the
- 'uninstall' rule.
- source.dir
- the name of the source directory. Default is 'src'.
- out.dir
- the name of the output directory. Default is 'bin'.
+ application.package
+ the name of your application package as defined in the manifest. Used by the
+ 'uninstall' rule.
+ source.dir
+ the name of the source directory. Default is 'src'.
+ out.dir
+ the name of the output directory. Default is 'bin'.
- Properties related to the SDK location or the project target should be updated
- using the 'android' tool with the 'update' action.
+ Properties related to the SDK location or the project target should be updated
+ using the 'android' tool with the 'update' action.
- This file is an integral part of the build system for your application and
- should be checked in in Version Control Systems.
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems.
- -->
- <property file="build.properties" />
+ -->
+ <property file="build.properties" />
- <!-- The default.properties file is created and updated by the 'android' tool, as well
- as ADT.
- This file is an integral part of the build system for your application and
- should be checked in in Version Control Systems. -->
- <property file="default.properties" />
+ <!-- The default.properties file is created and updated by the 'android' tool, as well
+ as ADT.
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems. -->
+ <property file="default.properties" />
- <!-- Custom Android task to deal with the project target, and import the proper rules.
- This requires ant 1.6.0 or above. -->
- <path id="android.antlibs">
- <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
- <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
- <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
- <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
- <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
- </path>
+ <!-- Custom Android task to deal with the project target, and import the proper rules.
+ This requires ant 1.6.0 or above. -->
+ <path id="android.antlibs">
+ <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
+ </path>
- <taskdef name="setup"
- classname="com.android.ant.SetupTask"
- classpathref="android.antlibs" />
+ <taskdef name="setup"
+ classname="com.android.ant.SetupTask"
+ classpathref="android.antlibs" />
- <!-- Execute the Android Setup task that will setup some properties specific to the target,
- and import the build rules files.
+ <!-- Execute the Android Setup task that will setup some properties specific to the target,
+ and import the build rules files.
- The rules file is imported from
- <SDK>/platforms/<target_platform>/templates/android_rules.xml
+ The rules file is imported from
+ <SDK>/platforms/<target_platform>/templates/android_rules.xml
- To customize some build steps for your project:
- - copy the content of the main node <project> from android_rules.xml
- - paste it in this build.xml below the <setup /> task.
- - disable the import by changing the setup task below to <setup import="false" />
+ To customize some build steps for your project:
+ - copy the content of the main node <project> from android_rules.xml
+ - paste it in this build.xml below the <setup /> task.
+ - disable the import by changing the setup task below to <setup import="false" />
- This will ensure that the properties are setup correctly but that your customized
- build steps are used.
- -->
- <setup />
+ This will ensure that the properties are setup correctly but that your customized
+ build steps are used.
+ -->
+ <setup />
</project>
View
78 02-SimpleForm/LunchList/res/layout/main.xml 100755 → 100644
@@ -1,42 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- >
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- >
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Name:"
- />
- <EditText android:id="@+id/name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- />
- </LinearLayout>
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- >
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Address:"
- />
- <EditText android:id="@+id/addr"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- />
- </LinearLayout>
- <Button android:id="@+id/save"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="Save"
- />
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ >
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ >
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Name:"
+ />
+ <EditText android:id="@+id/name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ >
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Address:"
+ />
+ <EditText android:id="@+id/addr"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ />
+ </LinearLayout>
+ <Button android:id="@+id/save"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Save"
+ />
</LinearLayout>
View
2 02-SimpleForm/LunchList/res/values/strings.xml 100755 → 100644
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">LunchList</string>
+ <string name="app_name">LunchList</string>
</resources>
View
42 02-SimpleForm/LunchList/src/apt/tutorial/LunchList.java 100755 → 100644
@@ -7,25 +7,25 @@
import android.widget.EditText;
public class LunchList extends Activity {
- Restaurant r=new Restaurant();
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- Button save=(Button)findViewById(R.id.save);
-
- save.setOnClickListener(onSave);
- }
-
- private View.OnClickListener onSave=new View.OnClickListener() {
- public void onClick(View v) {
- EditText name=(EditText)findViewById(R.id.name);
- EditText address=(EditText)findViewById(R.id.addr);
-
- r.setName(name.getText().toString());
- r.setAddress(address.getText().toString());
- }
- };
+ Restaurant r=new Restaurant();
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ Button save=(Button)findViewById(R.id.save);
+
+ save.setOnClickListener(onSave);
+ }
+
+ private View.OnClickListener onSave=new View.OnClickListener() {
+ public void onClick(View v) {
+ EditText name=(EditText)findViewById(R.id.name);
+ EditText address=(EditText)findViewById(R.id.addr);
+
+ r.setName(name.getText().toString());
+ r.setAddress(address.getText().toString());
+ }
+ };
}
View
36 02-SimpleForm/LunchList/src/apt/tutorial/Restaurant.java 100755 → 100644
@@ -1,22 +1,22 @@
package apt.tutorial;
public class Restaurant {
- private String name="";
- private String address="";
-
- public String getName() {
- return(name);
- }
-
- public void setName(String name) {
- this.name=name;
- }
-
- public String getAddress() {
- return(address);
- }
-
- public void setAddress(String address) {
- this.address=address;
- }
+ private String name="";
+ private String address="";
+
+ public String getName() {
+ return(name);
+ }
+
+ public void setName(String name) {
+ this.name=name;
+ }
+
+ public String getAddress() {
+ return(address);
+ }
+
+ public void setAddress(String address) {
+ this.address=address;
+ }
}
View
32 03-FancierForm/LunchList/AndroidManifest.xml 100755 → 100644
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1"
- android:versionName="1.0"
- package="apt.tutorial"
- xmlns:android="http://schemas.android.com/apk/res/android">
-
- <supports-screens android:largeScreens="true"
- android:normalScreens="true"
- android:smallScreens="false" />
- <application android:label="@string/app_name">
- <activity android:label="@string/app_name"
- android:name=".LunchList">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
+ android:versionName="1.0"
+ package="apt.tutorial"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <supports-screens android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="false" />
+ <application android:label="@string/app_name">
+ <activity android:label="@string/app_name"
+ android:name=".LunchList">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
</manifest>
View
100 03-FancierForm/LunchList/build.xml 100755 → 100644
@@ -1,67 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="LunchList" default="help">
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked in in Version
- Control Systems. -->
- <property file="local.properties" />
+ <!-- The local.properties file is created and updated by the 'android' tool.
+ It contains the path to the SDK. It should *NOT* be checked in in Version
+ Control Systems. -->
+ <property file="local.properties" />
- <!-- The build.properties file can be created by you and is never touched
- by the 'android' tool. This is the place to change some of the default property values
- used by the Ant rules.
- Here are some properties you may want to change/update:
+ <!-- The build.properties file can be created by you and is never touched
+ by the 'android' tool. This is the place to change some of the default property values
+ used by the Ant rules.
+ Here are some properties you may want to change/update:
- application.package
- the name of your application package as defined in the manifest. Used by the
- 'uninstall' rule.
- source.dir
- the name of the source directory. Default is 'src'.
- out.dir
- the name of the output directory. Default is 'bin'.
+ application.package
+ the name of your application package as defined in the manifest. Used by the
+ 'uninstall' rule.
+ source.dir
+ the name of the source directory. Default is 'src'.
+ out.dir
+ the name of the output directory. Default is 'bin'.
- Properties related to the SDK location or the project target should be updated
- using the 'android' tool with the 'update' action.
+ Properties related to the SDK location or the project target should be updated
+ using the 'android' tool with the 'update' action.
- This file is an integral part of the build system for your application and
- should be checked in in Version Control Systems.
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems.
- -->
- <property file="build.properties" />
+ -->
+ <property file="build.properties" />
- <!-- The default.properties file is created and updated by the 'android' tool, as well
- as ADT.
- This file is an integral part of the build system for your application and
- should be checked in in Version Control Systems. -->
- <property file="default.properties" />
+ <!-- The default.properties file is created and updated by the 'android' tool, as well
+ as ADT.
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems. -->
+ <property file="default.properties" />
- <!-- Custom Android task to deal with the project target, and import the proper rules.
- This requires ant 1.6.0 or above. -->
- <path id="android.antlibs">
- <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
- <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
- <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
- <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
- <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
- </path>
+ <!-- Custom Android task to deal with the project target, and import the proper rules.
+ This requires ant 1.6.0 or above. -->
+ <path id="android.antlibs">
+ <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
+ </path>
- <taskdef name="setup"
- classname="com.android.ant.SetupTask"
- classpathref="android.antlibs" />
+ <taskdef name="setup"
+ classname="com.android.ant.SetupTask"
+ classpathref="android.antlibs" />
- <!-- Execute the Android Setup task that will setup some properties specific to the target,
- and import the build rules files.
+ <!-- Execute the Android Setup task that will setup some properties specific to the target,
+ and import the build rules files.
- The rules file is imported from
- <SDK>/platforms/<target_platform>/templates/android_rules.xml
+ The rules file is imported from
+ <SDK>/platforms/<target_platform>/templates/android_rules.xml
- To customize some build steps for your project:
- - copy the content of the main node <project> from android_rules.xml
- - paste it in this build.xml below the <setup /> task.
- - disable the import by changing the setup task below to <setup import="false" />
+ To customize some build steps for your project:
+ - copy the content of the main node <project> from android_rules.xml
+ - paste it in this build.xml below the <setup /> task.
+ - disable the import by changing the setup task below to <setup import="false" />
- This will ensure that the properties are setup correctly but that your customized
- build steps are used.
- -->
- <setup />
+ This will ensure that the properties are setup correctly but that your customized
+ build steps are used.
+ -->
+ <setup />
</project>
View
66 03-FancierForm/LunchList/res/layout/main.xml 100755 → 100644
@@ -1,36 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:stretchColumns="1"
- android:shrinkColumns="1"
- >
- <TableRow>
- <TextView android:text="Name:" />
- <EditText android:id="@+id/name" />
- </TableRow>
- <TableRow>
- <TextView android:text="Address:" />
- <EditText android:id="@+id/addr" />
- </TableRow>
- <TableRow>
- <TextView android:text="Type:" />
- <RadioGroup android:id="@+id/types">
- <RadioButton android:id="@+id/take_out"
- android:text="Take-Out"
- android:checked="true"
- />
- <RadioButton android:id="@+id/sit_down"
- android:text="Sit-Down"
- />
- <RadioButton android:id="@+id/delivery"
- android:text="Delivery"
- />
- </RadioGroup>
- </TableRow>
- <Button android:id="@+id/save"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="Save"
- />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:stretchColumns="1"
+ android:shrinkColumns="1"
+ >
+ <TableRow>
+ <TextView android:text="Name:" />
+ <EditText android:id="@+id/name" />
+ </TableRow>
+ <TableRow>
+ <TextView android:text="Address:" />
+ <EditText android:id="@+id/addr" />
+ </TableRow>
+ <TableRow>
+ <TextView android:text="Type:" />
+ <RadioGroup android:id="@+id/types">
+ <RadioButton android:id="@+id/take_out"
+ android:text="Take-Out"
+ android:checked="true"
+ />
+ <RadioButton android:id="@+id/sit_down"
+ android:text="Sit-Down"
+ />
+ <RadioButton android:id="@+id/delivery"
+ android:text="Delivery"
+ />
+ </RadioGroup>
+ </TableRow>
+ <Button android:id="@+id/save"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Save"
+ />
</TableLayout>
View
2 03-FancierForm/LunchList/res/values/strings.xml 100755 → 100644
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">LunchList</string>
+ <string name="app_name">LunchList</string>
</resources>
View
74 03-FancierForm/LunchList/src/apt/tutorial/LunchList.java 100755 → 100644
@@ -8,41 +8,41 @@
import android.widget.RadioGroup;
public class LunchList extends Activity {
- Restaurant r=new Restaurant();
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- Button save=(Button)findViewById(R.id.save);
-
- save.setOnClickListener(onSave);
- }
-
- private View.OnClickListener onSave=new View.OnClickListener() {
- public void onClick(View v) {
- EditText name=(EditText)findViewById(R.id.name);
- EditText address=(EditText)findViewById(R.id.addr);
-
- r.setName(name.getText().toString());
- r.setAddress(address.getText().toString());
-
- RadioGroup types=(RadioGroup)findViewById(R.id.types);
-
- switch (types.getCheckedRadioButtonId()) {
- case R.id.sit_down:
- r.setType("sit_down");
- break;
-
- case R.id.take_out:
- r.setType("take_out");
- break;
-
- case R.id.delivery:
- r.setType("delivery");
- break;
- }
- }
- };
+ Restaurant r=new Restaurant();
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ Button save=(Button)findViewById(R.id.save);
+
+ save.setOnClickListener(onSave);
+ }
+
+ private View.OnClickListener onSave=new View.OnClickListener() {
+ public void onClick(View v) {
+ EditText name=(EditText)findViewById(R.id.name);
+ EditText address=(EditText)findViewById(R.id.addr);
+
+ r.setName(name.getText().toString());
+ r.setAddress(address.getText().toString());
+
+ RadioGroup types=(RadioGroup)findViewById(R.id.types);
+
+ switch (types.getCheckedRadioButtonId()) {
+ case R.id.sit_down:
+ r.setType("sit_down");
+ break;
+
+ case R.id.take_out:
+ r.setType("take_out");
+ break;
+
+ case R.id.delivery:
+ r.setType("delivery");
+ break;
+ }
+ }
+ };
}
View
54 03-FancierForm/LunchList/src/apt/tutorial/Restaurant.java 100755 → 100644
@@ -1,31 +1,31 @@
package apt.tutorial;
public class Restaurant {
- private String name="";
- private String address="";
- private String type="";
-
- public String getName() {
- return(name);
- }
-
- public void setName(String name) {
- this.name=name;
- }
-
- public String getAddress() {
- return(address);
- }
-
- public void setAddress(String address) {
- this.address=address;
- }
-
- public String getType() {
- return(type);
- }
-
- public void setType(String type) {
- this.type=type;
- }
+ private String name="";
+ private String address="";
+ private String type="";
+
+ public String getName() {
+ return(name);
+ }
+
+ public void setName(String name) {
+ this.name=name;
+ }
+
+ public String getAddress() {
+ return(address);
+ }
+
+ public void setAddress(String address) {
+ this.address=address;
+ }
+
+ public String getType() {
+ return(type);
+ }
+
+ public void setType(String type) {
+ this.type=type;
+ }
}
View
32 04-ListView/LunchList/AndroidManifest.xml 100755 → 100644
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1"
- android:versionName="1.0"
- package="apt.tutorial"
- xmlns:android="http://schemas.android.com/apk/res/android">
-
- <supports-screens android:largeScreens="true"
- android:normalScreens="true"
- android:smallScreens="false" />
- <application android:label="@string/app_name">
- <activity android:label="@string/app_name"
- android:name=".LunchList">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
+ android:versionName="1.0"
+ package="apt.tutorial"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <supports-screens android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="false" />
+ <application android:label="@string/app_name">
+ <activity android:label="@string/app_name"
+ android:name=".LunchList">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
</manifest>
View
100 04-ListView/LunchList/build.xml 100755 → 100644
@@ -1,67 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="LunchList" default="help">
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked in in Version
- Control Systems. -->
- <property file="local.properties" />
+ <!-- The local.properties file is created and updated by the 'android' tool.
+ It contains the path to the SDK. It should *NOT* be checked in in Version
+ Control Systems. -->
+ <property file="local.properties" />
- <!-- The build.properties file can be created by you and is never touched
- by the 'android' tool. This is the place to change some of the default property values
- used by the Ant rules.
- Here are some properties you may want to change/update:
+ <!-- The build.properties file can be created by you and is never touched
+ by the 'android' tool. This is the place to change some of the default property values
+ used by the Ant rules.
+ Here are some properties you may want to change/update:
- application.package
- the name of your application package as defined in the manifest. Used by the
- 'uninstall' rule.
- source.dir
- the name of the source directory. Default is 'src'.
- out.dir
- the name of the output directory. Default is 'bin'.
+ application.package
+ the name of your application package as defined in the manifest. Used by the
+ 'uninstall' rule.
+ source.dir
+ the name of the source directory. Default is 'src'.
+ out.dir
+ the name of the output directory. Default is 'bin'.
- Properties related to the SDK location or the project target should be updated
- using the 'android' tool with the 'update' action.
+ Properties related to the SDK location or the project target should be updated
+ using the 'android' tool with the 'update' action.
- This file is an integral part of the build system for your application and
- should be checked in in Version Control Systems.
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems.
- -->
- <property file="build.properties" />
+ -->
+ <property file="build.properties" />
- <!-- The default.properties file is created and updated by the 'android' tool, as well
- as ADT.
- This file is an integral part of the build system for your application and
- should be checked in in Version Control Systems. -->
- <property file="default.properties" />
+ <!-- The default.properties file is created and updated by the 'android' tool, as well
+ as ADT.
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems. -->
+ <property file="default.properties" />
- <!-- Custom Android task to deal with the project target, and import the proper rules.
- This requires ant 1.6.0 or above. -->
- <path id="android.antlibs">
- <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
- <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
- <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
- <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
- <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
- </path>
+ <!-- Custom Android task to deal with the project target, and import the proper rules.
+ This requires ant 1.6.0 or above. -->
+ <path id="android.antlibs">
+ <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
+ </path>
- <taskdef name="setup"
- classname="com.android.ant.SetupTask"
- classpathref="android.antlibs" />
+ <taskdef name="setup"
+ classname="com.android.ant.SetupTask"
+ classpathref="android.antlibs" />
- <!-- Execute the Android Setup task that will setup some properties specific to the target,
- and import the build rules files.
+ <!-- Execute the Android Setup task that will setup some properties specific to the target,
+ and import the build rules files.
- The rules file is imported from
- <SDK>/platforms/<target_platform>/templates/android_rules.xml
+ The rules file is imported from
+ <SDK>/platforms/<target_platform>/templates/android_rules.xml
- To customize some build steps for your project:
- - copy the content of the main node <project> from android_rules.xml
- - paste it in this build.xml below the <setup /> task.
- - disable the import by changing the setup task below to <setup import="false" />
+ To customize some build steps for your project:
+ - copy the content of the main node <project> from android_rules.xml
+ - paste it in this build.xml below the <setup /> task.
+ - disable the import by changing the setup task below to <setup import="false" />
- This will ensure that the properties are setup correctly but that your customized
- build steps are used.
- -->
- <setup />
+ This will ensure that the properties are setup correctly but that your customized
+ build steps are used.
+ -->
+ <setup />
</project>
View
90 04-ListView/LunchList/res/layout/main.xml 100755 → 100644
@@ -1,48 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- >
- <TableLayout android:id="@+id/details"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:stretchColumns="1"
- android:shrinkColumns="1"
- >
- <TableRow>
- <TextView android:text="Name:" />
- <EditText android:id="@+id/name" />
- </TableRow>
- <TableRow>
- <TextView android:text="Address:" />
- <EditText android:id="@+id/addr" />
- </TableRow>
- <TableRow>
- <TextView android:text="Type:" />
- <RadioGroup android:id="@+id/types">
- <RadioButton android:id="@+id/take_out"
- android:text="Take-Out"
- android:checked="true"
- />
- <RadioButton android:id="@+id/sit_down"
- android:text="Sit-Down"
- />
- <RadioButton android:id="@+id/delivery"
- android:text="Delivery"
- />
- </RadioGroup>
- </TableRow>
- <Button android:id="@+id/save"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="Save"
- />
- </TableLayout>
- <ListView android:id="@+id/restaurants"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_above="@id/details"
- />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ >
+ <TableLayout android:id="@+id/details"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:stretchColumns="1"
+ android:shrinkColumns="1"
+ >
+ <TableRow>
+ <TextView android:text="Name:" />
+ <EditText android:id="@+id/name" />
+ </TableRow>
+ <TableRow>
+ <TextView android:text="Address:" />
+ <EditText android:id="@+id/addr" />
+ </TableRow>
+ <TableRow>
+ <TextView android:text="Type:" />
+ <RadioGroup android:id="@+id/types">
+ <RadioButton android:id="@+id/take_out"
+ android:text="Take-Out"
+ android:checked="true"
+ />
+ <RadioButton android:id="@+id/sit_down"
+ android:text="Sit-Down"
+ />
+ <RadioButton android:id="@+id/delivery"
+ android:text="Delivery"
+ />
+ </RadioGroup>
+ </TableRow>
+ <Button android:id="@+id/save"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Save"
+ />
+ </TableLayout>
+ <ListView android:id="@+id/restaurants"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_above="@id/details"
+ />
</RelativeLayout>
View
2 04-ListView/LunchList/res/values/strings.xml 100755 → 100644
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">LunchList</string>
+ <string name="app_name">LunchList</string>
</resources>
View
96 04-ListView/LunchList/src/apt/tutorial/LunchList.java 100755 → 100644
@@ -12,52 +12,52 @@
import java.util.List;
public class LunchList extends Activity {
- List<Restaurant> model=new ArrayList<Restaurant>();
- ArrayAdapter<Restaurant> adapter=null;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- Button save=(Button)findViewById(R.id.save);
-
- save.setOnClickListener(onSave);
-
- ListView list=(ListView)findViewById(R.id.restaurants);
-
- adapter=new ArrayAdapter<Restaurant>(this,
- android.R.layout.simple_list_item_1,
- model);
- list.setAdapter(adapter);
- }
-
- private View.OnClickListener onSave=new View.OnClickListener() {
- public void onClick(View v) {
- Restaurant r=new Restaurant();
- EditText name=(EditText)findViewById(R.id.name);
- EditText address=(EditText)findViewById(R.id.addr);
-
- r.setName(name.getText().toString());
- r.setAddress(address.getText().toString());
-
- RadioGroup types=(RadioGroup)findViewById(R.id.types);
-
- switch (types.getCheckedRadioButtonId()) {
- case R.id.sit_down:
- r.setType("sit_down");
- break;
-
- case R.id.take_out:
- r.setType("take_out");
- break;
-
- case R.id.delivery:
- r.setType("delivery");
- break;
- }
-
- adapter.add(r);
- }
- };
+ List<Restaurant> model=new ArrayList<Restaurant>();
+ ArrayAdapter<Restaurant> adapter=null;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ Button save=(Button)findViewById(R.id.save);
+
+ save.setOnClickListener(onSave);
+
+ ListView list=(ListView)findViewById(R.id.restaurants);
+
+ adapter=new ArrayAdapter<Restaurant>(this,
+ android.R.layout.simple_list_item_1,
+ model);
+ list.setAdapter(adapter);
+ }
+
+ private View.OnClickListener onSave=new View.OnClickListener() {
+ public void onClick(View v) {
+ Restaurant r=new Restaurant();
+ EditText name=(EditText)findViewById(R.id.name);
+ EditText address=(EditText)findViewById(R.id.addr);
+
+ r.setName(name.getText().toString());
+ r.setAddress(address.getText().toString());
+
+ RadioGroup types=(RadioGroup)findViewById(R.id.types);
+
+ switch (types.getCheckedRadioButtonId()) {
+ case R.id.sit_down:
+ r.setType("sit_down");
+ break;
+
+ case R.id.take_out:
+ r.setType("take_out");
+ break;
+
+ case R.id.delivery:
+ r.setType("delivery");
+ break;
+ }
+
+ adapter.add(r);
+ }
+ };
}
View
62 04-ListView/LunchList/src/apt/tutorial/Restaurant.java 100755 → 100644
@@ -1,35 +1,35 @@
package apt.tutorial;
public class Restaurant {
- private String name="";
- private String address="";
- private String type="";
-
- public String getName() {
- return(name);
- }
-
- public void setName(String name) {
- this.name=name;
- }
-
- public String getAddress() {
- return(address);
- }
-
- public void setAddress(String address) {
- this.address=address;
- }
-
- public String getType() {
- return(type);
- }
-
- public void setType(String type) {
- this.type=type;
- }
-
- public String toString() {
- return(getName());
- }
+ private String name="";
+ private String address="";
+ private String type="";
+
+ public String getName() {
+ return(name);
+ }
+
+ public void setName(String name) {
+ this.name=name;
+ }
+
+ public String getAddress() {
+ return(address);
+ }
+
+ public void setAddress(String address) {
+ this.address=address;
+ }
+
+ public String getType() {
+ return(type);
+ }
+
+ public void setType(String type) {
+ this.type=type;
+ }
+
+ public String toString() {
+ return(getName());
+ }
}
View
32 05-FancyList/LunchList/AndroidManifest.xml 100755 → 100644
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1"
- android:versionName="1.0"
- package="apt.tutorial"
- xmlns:android="http://schemas.android.com/apk/res/android">
-
- <supports-screens android:largeScreens="true"
- android:normalScreens="true"
- android:smallScreens="false" />
- <application android:label="@string/app_name">
- <activity android:label="@string/app_name"
- android:name=".LunchList">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
+ android:versionName="1.0"
+ package="apt.tutorial"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <supports-screens android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="false" />
+ <application android:label="@string/app_name">
+ <activity android:label="@string/app_name"
+ android:name=".LunchList">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
</manifest>
View
100 05-FancyList/LunchList/build.xml 100755 → 100644
@@ -1,67 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="LunchList" default="help">
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked in in Version
- Control Systems. -->
- <property file="local.properties" />
+ <!-- The local.properties file is created and updated by the 'android' tool.
+ It contains the path to the SDK. It should *NOT* be checked in in Version
+ Control Systems. -->
+ <property file="local.properties" />
- <!-- The build.properties file can be created by you and is never touched
- by the 'android' tool. This is the place to change some of the default property values
- used by the Ant rules.
- Here are some properties you may want to change/update:
+ <!-- The build.properties file can be created by you and is never touched
+ by the 'android' tool. This is the place to change some of the default property values
+ used by the Ant rules.
+ Here are some properties you may want to change/update:
- application.package
- the name of your application package as defined in the manifest. Used by the
- 'uninstall' rule.
- source.dir
- the name of the source directory. Default is 'src'.
- out.dir
- the name of the output directory. Default is 'bin'.
+ application.package
+ the name of your application package as defined in the manifest. Used by the
+ 'uninstall' rule.
+ source.dir
+ the name of the source directory. Default is 'src'.
+ out.dir
+ the name of the output directory. Default is 'bin'.
- Properties related to the SDK location or the project target should be updated
- using the 'android' tool with the 'update' action.
+ Properties related to the SDK location or the project target should be updated
+ using the 'android' tool with the 'update' action.
- This file is an integral part of the build system for your application and
- should be checked in in Version Control Systems.
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems.
- -->
- <property file="build.properties" />
+ -->
+ <property file="build.properties" />
- <!-- The default.properties file is created and updated by the 'android' tool, as well
- as ADT.
- This file is an integral part of the build system for your application and
- should be checked in in Version Control Systems. -->
- <property file="default.properties" />
+ <!-- The default.properties file is created and updated by the 'android' tool, as well
+ as ADT.
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems. -->
+ <property file="default.properties" />
- <!-- Custom Android task to deal with the project target, and import the proper rules.
- This requires ant 1.6.0 or above. -->
- <path id="android.antlibs">
- <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
- <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
- <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
- <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
- <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
- </path>
+ <!-- Custom Android task to deal with the project target, and import the proper rules.
+ This requires ant 1.6.0 or above. -->
+ <path id="android.antlibs">
+ <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
+ </path>
- <taskdef name="setup"
- classname="com.android.ant.SetupTask"
- classpathref="android.antlibs" />
+ <taskdef name="setup"
+ classname="com.android.ant.SetupTask"
+ classpathref="android.antlibs" />
- <!-- Execute the Android Setup task that will setup some properties specific to the target,
- and import the build rules files.
+ <!-- Execute the Android Setup task that will setup some properties specific to the target,
+ and import the build rules files.
- The rules file is imported from
- <SDK>/platforms/<target_platform>/templates/android_rules.xml
+ The rules file is imported from
+ <SDK>/platforms/<target_platform>/templates/android_rules.xml
- To customize some build steps for your project:
- - copy the content of the main node <project> from android_rules.xml
- - paste it in this build.xml below the <setup /> task.
- - disable the import by changing the setup task below to <setup import="false" />
+ To customize some build steps for your project:
+ - copy the content of the main node <project> from android_rules.xml
+ - paste it in this build.xml below the <setup /> task.
+ - disable the import by changing the setup task below to <setup import="false" />
- This will ensure that the properties are setup correctly but that your customized
- build steps are used.
- -->
- <setup />
+ This will ensure that the properties are setup correctly but that your customized
+ build steps are used.
+ -->
+ <setup />
</project>
View
90 05-FancyList/LunchList/res/layout/main.xml 100755 → 100644
@@ -1,48 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- >
- <TableLayout android:id="@+id/details"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:stretchColumns="1"
- android:shrinkColumns="1"
- >
- <TableRow>
- <TextView android:text="Name:" />
- <EditText android:id="@+id/name" />
- </TableRow>
- <TableRow>
- <TextView android:text="Address:" />
- <EditText android:id="@+id/addr" />
- </TableRow>
- <TableRow>
- <TextView android:text="Type:" />
- <RadioGroup android:id="@+id/types">
- <RadioButton android:id="@+id/take_out"
- android:text="Take-Out"
- android:checked="true"
- />
- <RadioButton android:id="@+id/sit_down"
- android:text="Sit-Down"
- />
- <RadioButton android:id="@+id/delivery"
- android:text="Delivery"
- />
- </RadioGroup>
- </TableRow>
- <Button android:id="@+id/save"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="Save"
- />
- </TableLayout>
- <ListView android:id="@+id/restaurants"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_above="@id/details"
- />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ >
+ <TableLayout android:id="@+id/details"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:stretchColumns="1"
+ android:shrinkColumns="1"
+ >
+ <TableRow>
+ <TextView android:text="Name:" />
+ <EditText android:id="@+id/name" />
+ </TableRow>
+ <TableRow>
+ <TextView android:text="Address:" />
+ <EditText android:id="@+id/addr" />
+ </TableRow>
+ <TableRow>
+ <TextView android:text="Type:" />
+ <RadioGroup android:id="@+id/types">
+ <RadioButton android:id="@+id/take_out"
+ android:text="Take-Out"
+ android:checked="true"
+ />
+ <RadioButton android:id="@+id/sit_down"
+ android:text="Sit-Down"
+ />
+ <RadioButton android:id="@+id/delivery"
+ android:text="Delivery"
+ />
+ </RadioGroup>
+ </TableRow>
+ <Button android:id="@+id/save"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Save"
+ />
+ </TableLayout>
+ <ListView android:id="@+id/restaurants"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_above="@id/details"
+ />
</RelativeLayout>
View
70 05-FancyList/LunchList/res/layout/row.xml 100755 → 100644
@@ -1,37 +1,37 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:padding="4dip"
- >
- <ImageView android:id="@+id/icon"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentBottom="true"
- android:layout_marginRight="4dip"
- />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- >
- <TextView android:id="@+id/title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:gravity="center_vertical"
- android:textStyle="bold"
- android:maxLines="1"
- android:ellipsize="end"
- />
- <TextView android:id="@+id/address"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:gravity="center_vertical"
- android:maxLines="1"
- android:ellipsize="end"
- />
- </LinearLayout>
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:padding="4dip"
+ >
+ <ImageView android:id="@+id/icon"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentBottom="true"
+ android:layout_marginRight="4dip"
+ />
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ >
+ <TextView android:id="@+id/title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:gravity="center_vertical"
+ android:textStyle="bold"
+ android:maxLines="1"
+ android:ellipsize="end"
+ />
+ <TextView android:id="@+id/address"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:gravity="center_vertical"
+ android:maxLines="1"
+ android:ellipsize="end"
+ />
+ </LinearLayout>
</LinearLayout>
View
2 05-FancyList/LunchList/res/values/strings.xml 100755 → 100644
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">LunchList</string>
+ <string name="app_name">LunchList</string>
</resources>
View
200 05-FancyList/LunchList/src/apt/tutorial/LunchList.java 100755 → 100644
@@ -16,104 +16,104 @@
import java.util.List;
public class LunchList extends Activity {
- List<Restaurant> model=new ArrayList<Restaurant>();
- RestaurantAdapter adapter=null;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- Button save=(Button)findViewById(R.id.save);
-
- save.setOnClickListener(onSave);
-
- ListView list=(ListView)findViewById(R.id.restaurants);
-
- adapter=new RestaurantAdapter();
- list.setAdapter(adapter);
- }
-
- private View.OnClickListener onSave=new View.OnClickListener() {
- public void onClick(View v) {
- Restaurant r=new Restaurant();
- EditText name=(EditText)findViewById(R.id.name);
- EditText address=(EditText)findViewById(R.id.addr);
-
- r.setName(name.getText().toString());
- r.setAddress(address.getText().toString());
-
- RadioGroup types=(RadioGroup)findViewById(R.id.types);
-
- switch (types.getCheckedRadioButtonId()) {
- case R.id.sit_down:
- r.setType("sit_down");
- break;
-
- case R.id.take_out:
- r.setType("take_out");
- break;
-
- case R.id.delivery:
- r.setType("delivery");
- break;
- }
-
- adapter.add(r);
- }
- };
-
- class RestaurantAdapter extends ArrayAdapter<Restaurant> {
- RestaurantAdapter() {
- super(LunchList.this, R.layout.row, model);
- }
-
- public View getView(int position, View convertView,
- ViewGroup parent) {
- View row=convertView;
- RestaurantHolder holder=null;
-
- if (row==null) {
- LayoutInflater inflater=getLayoutInflater();
-
- row=inflater.inflate(R.layout.row, parent, false);
- holder=new RestaurantHolder(row);
- row.setTag(holder);
- }
- else {
- holder=(RestaurantHolder)row.getTag();
- }
-
- holder.populateFrom(model.get(position));
-
- return(row);
- }
- }
-
- static class RestaurantHolder {
- private TextView name=null;
- private TextView address=null;
- private ImageView icon=null;
-
- RestaurantHolder(View row) {
- name=(TextView)row.findViewById(R.id.title);
- address=(TextView)row.findViewById(R.id.address);
- icon=(ImageView)row.findViewById(R.id.icon);
- }
-
- void populateFrom(Restaurant r) {
- name.setText(r.getName());
- address.setText(r.getAddress());
-
- if (r.getType().equals("sit_down")) {
- icon.setImageResource(R.drawable.ball_red);
- }
- else if (r.getType().equals("take_out")) {
- icon.setImageResource(R.drawable.ball_yellow);
- }
- else {
- icon.setImageResource(R.drawable.ball_green);
- }
- }
- }
+ List<Restaurant> model=new ArrayList<Restaurant>();
+ RestaurantAdapter adapter=null;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ Button save=(Button)findViewById(R.id.save);
+
+ save.setOnClickListener(onSave);
+
+ ListView list=(ListView)findViewById(R.id.restaurants);
+
+ adapter=new RestaurantAdapter();
+ list.setAdapter(adapter);
+ }
+
+ private View.OnClickListener onSave=new View.OnClickListener() {
+ public void onClick(View v) {
+ Restaurant r=new Restaurant();
+ EditText name=(EditText)findViewById(R.id.name);
+ EditText address=(EditText)findViewById(R.id.addr);
+
+ r.setName(name.getText().toString());
+ r.setAddress(address.getText().toString());
+
+ RadioGroup types=(RadioGroup)findViewById(R.id.types);
+
+ switch (types.getCheckedRadioButtonId()) {
+ case R.id.sit_down:
+ r.setType("sit_down");
+ break;
+
+ case R.id.take_out:
+ r.setType("take_out");
+ break;
+
+ case R.id.delivery:
+ r.setType("delivery");
+ break;
+ }
+
+ adapter.add(r);
+ }
+ };
+
+ class RestaurantAdapter extends ArrayAdapter<Restaurant> {
+ RestaurantAdapter() {
+ super(LunchList.this, R.layout.row, model);
+ }
+
+ public View getView(int position, View convertView,
+ ViewGroup parent) {
+ View row=convertView;
+ RestaurantHolder holder=null;
+
+ if (row==null) {
+ LayoutInflater inflater=getLayoutInflater();
+
+ row=inflater.inflate(R.layout.row, parent, false);
+ holder=new RestaurantHolder(row);
+ row.setTag(holder);
+ }
+ else {
+ holder=(RestaurantHolder)row.getTag();
+ }
+
+ holder.populateFrom(model.get(position));
+
+ return(row);
+ }
+ }
+
+ static class RestaurantHolder {
+ private TextView name=null;
+ private TextView address=null;
+ private ImageView icon=null;
+
+ RestaurantHolder(View ro