Permalink
Browse files

updates for v0.3

  • Loading branch information...
1 parent 55cff5e commit 6b33c89fba66d46ae4628d7a319f80a9adddac68 Mark Murphy committed Mar 31, 2012
Showing with 3,543 additions and 119 deletions.
  1. +8 −0 ActionBar/ActionBarDemo/.classpath
  2. +33 −0 ActionBar/ActionBarDemo/.project
  3. +31 −0 ActionBar/ActionBarDemo/AndroidManifest.xml
  4. +85 −0 ActionBar/ActionBarDemo/build.xml
  5. +13 −0 ActionBar/ActionBarDemo/project.properties
  6. BIN ActionBar/ActionBarDemo/res/drawable-hdpi/ic_launcher.png
  7. BIN ActionBar/ActionBarDemo/res/drawable-ldpi/ic_launcher.png
  8. BIN ActionBar/ActionBarDemo/res/drawable-mdpi/ic_launcher.png
  9. BIN ActionBar/ActionBarDemo/res/drawable-xhdpi/ic_launcher.png
  10. +24 −0 ActionBar/ActionBarDemo/res/layout/add.xml
  11. +15 −0 ActionBar/ActionBarDemo/res/menu/actions.xml
  12. +6 −0 ActionBar/ActionBarDemo/res/values/strings.xml
  13. +102 −0 ActionBar/ActionBarDemo/src/com/commonsware/android/inflation/ActionBarDemoActivity.java
  14. BIN Basic/Button/res/drawable-hdpi/ic_launcher.png
  15. BIN Basic/Button/res/drawable-ldpi/ic_launcher.png
  16. BIN Basic/Button/res/drawable-mdpi/ic_launcher.png
  17. BIN Basic/Button/res/drawable-xhdpi/ic_launcher.png
  18. +1 −1 Basic/Button/res/layout/main.xml
  19. +1 −1 Basic/Button/res/values/strings.xml
  20. +24 −18 Basic/CheckBox/AndroidManifest.xml
  21. BIN Basic/CheckBox/res/drawable-hdpi/ic_launcher.png
  22. BIN Basic/CheckBox/res/drawable-ldpi/ic_launcher.png
  23. BIN Basic/CheckBox/res/drawable-mdpi/ic_launcher.png
  24. BIN Basic/CheckBox/res/drawable-xhdpi/ic_launcher.png
  25. +23 −17 Basic/Field/AndroidManifest.xml
  26. BIN Basic/Field/res/drawable-hdpi/ic_launcher.png
  27. BIN Basic/Field/res/drawable-ldpi/ic_launcher.png
  28. BIN Basic/Field/res/drawable-mdpi/ic_launcher.png
  29. BIN Basic/Field/res/drawable-xhdpi/ic_launcher.png
  30. +26 −17 Basic/ImageView/AndroidManifest.xml
  31. BIN Basic/ImageView/res/drawable-hdpi/ic_launcher.png
  32. BIN Basic/ImageView/res/drawable-ldpi/ic_launcher.png
  33. BIN Basic/ImageView/res/drawable-mdpi/ic_launcher.png
  34. BIN Basic/ImageView/res/{drawable → drawable-mdpi}/molecule.png
  35. BIN Basic/ImageView/res/drawable-xhdpi/ic_launcher.png
  36. +26 −17 Basic/Label/AndroidManifest.xml
  37. BIN Basic/Label/res/drawable-hdpi/ic_launcher.png
  38. BIN Basic/Label/res/drawable-ldpi/ic_launcher.png
  39. BIN Basic/Label/res/drawable-mdpi/ic_launcher.png
  40. BIN Basic/Label/res/drawable-xhdpi/ic_launcher.png
  41. +1 −1 Basic/Label/res/layout/main.xml
  42. +1 −0 Basic/Label/res/values/strings.xml
  43. +26 −17 Basic/RadioButton/AndroidManifest.xml
  44. BIN Basic/RadioButton/res/drawable-hdpi/ic_launcher.png
  45. BIN Basic/RadioButton/res/drawable-ldpi/ic_launcher.png
  46. BIN Basic/RadioButton/res/drawable-mdpi/ic_launcher.png
  47. BIN Basic/RadioButton/res/drawable-xhdpi/ic_launcher.png
  48. +3 −3 Basic/RadioButton/res/layout/main.xml
  49. +3 −0 Basic/RadioButton/res/values/strings.xml
  50. +2 −2 Basic/ToggleButton/AndroidManifest.xml
  51. BIN Basic/ToggleButton/res/drawable-hdpi/ic_launcher.png
  52. BIN Basic/ToggleButton/res/drawable-ldpi/ic_launcher.png
  53. BIN Basic/ToggleButton/res/drawable-mdpi/ic_launcher.png
  54. BIN Basic/ToggleButton/res/drawable-xhdpi/ic_launcher.png
  55. BIN Basic/ToggleButton/res/drawable/cw.png
  56. +2 −2 Containers/LinearPercent/AndroidManifest.xml
  57. BIN Containers/LinearPercent/res/drawable-hdpi/ic_launcher.png
  58. BIN Containers/LinearPercent/res/drawable-ldpi/ic_launcher.png
  59. BIN Containers/LinearPercent/res/drawable-mdpi/ic_launcher.png
  60. BIN Containers/LinearPercent/res/drawable-xhdpi/ic_launcher.png
  61. BIN Containers/LinearPercent/res/drawable/cw.png
  62. +1 −0 Containers/Relative/.classpath
  63. +2 −2 Containers/Relative/AndroidManifest.xml
  64. BIN Containers/Relative/res/drawable-hdpi/ic_launcher.png
  65. BIN Containers/Relative/res/drawable-ldpi/ic_launcher.png
  66. BIN Containers/Relative/res/drawable-mdpi/ic_launcher.png
  67. BIN Containers/Relative/res/drawable-xhdpi/ic_launcher.png
  68. BIN Containers/Relative/res/drawable/cw.png
  69. +1 −0 Containers/RelativeOverlap/.classpath
  70. +2 −2 Containers/RelativeOverlap/AndroidManifest.xml
  71. BIN Containers/RelativeOverlap/res/drawable-hdpi/ic_launcher.png
  72. BIN Containers/RelativeOverlap/res/drawable-ldpi/ic_launcher.png
  73. BIN Containers/RelativeOverlap/res/drawable-mdpi/ic_launcher.png
  74. BIN Containers/RelativeOverlap/res/drawable-xhdpi/ic_launcher.png
  75. BIN Containers/RelativeOverlap/res/drawable/cw.png
  76. +26 −17 Containers/Scroll/AndroidManifest.xml
  77. BIN Containers/Scroll/res/drawable-hdpi/ic_launcher.png
  78. BIN Containers/Scroll/res/drawable-ldpi/ic_launcher.png
  79. BIN Containers/Scroll/res/drawable-mdpi/ic_launcher.png
  80. BIN Containers/Scroll/res/drawable-xhdpi/ic_launcher.png
  81. BIN Containers/Scroll/res/drawable/cw.png
  82. +1 −0 Containers/Table/.classpath
  83. +2 −2 Containers/Table/AndroidManifest.xml
  84. BIN Containers/Table/res/drawable-hdpi/ic_launcher.png
  85. BIN Containers/Table/res/drawable-ldpi/ic_launcher.png
  86. BIN Containers/Table/res/drawable-mdpi/ic_launcher.png
  87. BIN Containers/Table/res/drawable-xhdpi/ic_launcher.png
  88. BIN Containers/Table/res/drawable/cw.png
  89. +8 −0 Selection/AutoComplete/.classpath
  90. +33 −0 Selection/AutoComplete/.project
  91. +18 −0 Selection/AutoComplete/AndroidManifest.xml
  92. +85 −0 Selection/AutoComplete/build.xml
  93. +40 −0 Selection/AutoComplete/proguard.cfg
  94. +12 −0 Selection/AutoComplete/project.properties
  95. BIN {Basic/CheckBox → Selection/AutoComplete}/res/drawable/cw.png
  96. +17 −0 Selection/AutoComplete/res/layout/main.xml
  97. +4 −0 Selection/AutoComplete/res/values/strings.xml
  98. +65 −0 Selection/AutoComplete/src/com/commonsware/android/auto/AutoCompleteDemo.java
  99. +8 −0 Selection/Checklist/.classpath
  100. +33 −0 Selection/Checklist/.project
  101. +18 −0 Selection/Checklist/AndroidManifest.xml
  102. +85 −0 Selection/Checklist/build.xml
  103. +40 −0 Selection/Checklist/proguard.cfg
  104. +12 −0 Selection/Checklist/project.properties
  105. BIN {Basic/Field → Selection/Checklist}/res/drawable/cw.png
  106. +9 −0 Selection/Checklist/res/layout/main.xml
  107. +4 −0 Selection/Checklist/res/values/strings.xml
  108. +37 −0 Selection/Checklist/src/com/commonsware/android/checklist/ChecklistDemo.java
  109. +8 −0 Selection/Dynamic/.classpath
  110. +33 −0 Selection/Dynamic/.project
  111. +27 −0 Selection/Dynamic/AndroidManifest.xml
  112. +85 −0 Selection/Dynamic/build.xml
  113. +40 −0 Selection/Dynamic/proguard.cfg
  114. +12 −0 Selection/Dynamic/project.properties
  115. BIN Selection/Dynamic/res/drawable-hdpi/ic_launcher.png
  116. BIN Selection/Dynamic/res/drawable-ldpi/ic_launcher.png
  117. BIN Selection/Dynamic/res/drawable-mdpi/delete.png
  118. BIN Selection/Dynamic/res/drawable-mdpi/ic_launcher.png
  119. BIN Selection/Dynamic/res/drawable-mdpi/ok.png
  120. BIN Selection/Dynamic/res/drawable-xhdpi/ic_launcher.png
  121. +35 −0 Selection/Dynamic/res/layout/row.xml
  122. +6 −0 Selection/Dynamic/res/values/strings.xml
  123. +64 −0 Selection/Dynamic/src/com/commonsware/android/fancylists/three/DynamicDemo.java
  124. +8 −0 Selection/Grid/.classpath
  125. +33 −0 Selection/Grid/.project
  126. +18 −0 Selection/Grid/AndroidManifest.xml
  127. +85 −0 Selection/Grid/build.xml
  128. +40 −0 Selection/Grid/proguard.cfg
  129. +12 −0 Selection/Grid/project.properties
  130. BIN {Basic/ImageView → Selection/Grid}/res/drawable/cw.png
  131. +7 −0 Selection/Grid/res/layout/cell.xml
  132. +24 −0 Selection/Grid/res/layout/main.xml
  133. +4 −0 Selection/Grid/res/values/strings.xml
  134. +53 −0 Selection/Grid/src/com/commonsware/android/grid/GridDemo.java
  135. +8 −0 Selection/List/.classpath
  136. +33 −0 Selection/List/.project
  137. +18 −0 Selection/List/AndroidManifest.xml
  138. +85 −0 Selection/List/build.xml
  139. +40 −0 Selection/List/proguard.cfg
  140. +12 −0 Selection/List/project.properties
  141. BIN {Basic/Label → Selection/List}/res/drawable/cw.png
  142. +17 −0 Selection/List/res/layout/main.xml
  143. +4 −0 Selection/List/res/values/strings.xml
  144. +48 −0 Selection/List/src/com/commonsware/android/list/ListViewDemo.java
  145. +8 −0 Selection/Spinner/.classpath
  146. +33 −0 Selection/Spinner/.project
  147. +18 −0 Selection/Spinner/AndroidManifest.xml
  148. +85 −0 Selection/Spinner/build.xml
  149. +40 −0 Selection/Spinner/proguard.cfg
  150. +12 −0 Selection/Spinner/project.properties
  151. BIN {Basic/RadioButton → Selection/Spinner}/res/drawable/cw.png
  152. +18 −0 Selection/Spinner/res/layout/main.xml
  153. +4 −0 Selection/Spinner/res/values/strings.xml
  154. +63 −0 Selection/Spinner/src/com/commonsware/android/selection/SpinnerDemo.java
  155. +8 −0 Selection/ViewHolder/.classpath
  156. +33 −0 Selection/ViewHolder/.project
  157. +27 −0 Selection/ViewHolder/AndroidManifest.xml
  158. +85 −0 Selection/ViewHolder/build.xml
  159. +40 −0 Selection/ViewHolder/proguard.cfg
  160. +12 −0 Selection/ViewHolder/project.properties
  161. BIN Selection/ViewHolder/res/drawable-hdpi/ic_launcher.png
  162. BIN Selection/ViewHolder/res/drawable-ldpi/ic_launcher.png
  163. BIN Selection/ViewHolder/res/drawable-mdpi/delete.png
  164. BIN Selection/ViewHolder/res/drawable-mdpi/ic_launcher.png
  165. BIN Selection/ViewHolder/res/drawable-mdpi/ok.png
  166. BIN Selection/ViewHolder/res/drawable-xhdpi/ic_launcher.png
  167. +35 −0 Selection/ViewHolder/res/layout/row.xml
  168. +6 −0 Selection/ViewHolder/res/values/strings.xml
  169. +29 −0 Selection/ViewHolder/src/com/commonsware/android/fancylists/five/ViewHolder.java
  170. +70 −0 Selection/ViewHolder/src/com/commonsware/android/fancylists/five/ViewHolderDemo.java
  171. +1 −0 Skeleton/Now/.classpath
  172. BIN Skeleton/Now/res/drawable-hdpi/ic_launcher.png
  173. BIN Skeleton/Now/res/drawable-ldpi/ic_launcher.png
  174. BIN Skeleton/Now/res/drawable-mdpi/ic_launcher.png
  175. BIN Skeleton/Now/res/drawable-xhdpi/ic_launcher.png
  176. +8 −0 Styles/NowStyled/.classpath
  177. +33 −0 Styles/NowStyled/.project
  178. +27 −0 Styles/NowStyled/AndroidManifest.xml
  179. +85 −0 Styles/NowStyled/build.xml
  180. +40 −0 Styles/NowStyled/proguard.cfg
  181. +12 −0 Styles/NowStyled/project.properties
  182. BIN Styles/NowStyled/res/drawable-hdpi/ic_launcher.png
  183. BIN Styles/NowStyled/res/drawable-ldpi/ic_launcher.png
  184. BIN Styles/NowStyled/res/drawable-mdpi/ic_launcher.png
  185. BIN Styles/NowStyled/res/drawable-xhdpi/ic_launcher.png
  186. +8 −0 Styles/NowStyled/res/layout/main.xml
  187. +4 −0 Styles/NowStyled/res/values/strings.xml
  188. +7 −0 Styles/NowStyled/res/values/styles.xml
  189. +46 −0 Styles/NowStyled/src/com/commonsware/android/styles/NowStyled.java
  190. +8 −0 WebKit/Browser1/.classpath
  191. +33 −0 WebKit/Browser1/.project
  192. +29 −0 WebKit/Browser1/AndroidManifest.xml
  193. +85 −0 WebKit/Browser1/build.xml
  194. +40 −0 WebKit/Browser1/proguard.cfg
  195. +12 −0 WebKit/Browser1/project.properties
  196. BIN WebKit/Browser1/res/drawable-hdpi/ic_launcher.png
  197. BIN WebKit/Browser1/res/drawable-ldpi/ic_launcher.png
  198. BIN WebKit/Browser1/res/drawable-mdpi/ic_launcher.png
  199. BIN WebKit/Browser1/res/drawable-xhdpi/ic_launcher.png
  200. +6 −0 WebKit/Browser1/res/layout/main.xml
  201. +4 −0 WebKit/Browser1/res/values/strings.xml
  202. +32 −0 WebKit/Browser1/src/com/commonsware/android/browser1/BrowserDemo1.java
  203. +8 −0 WebKit/Browser2/.classpath
  204. +33 −0 WebKit/Browser2/.project
  205. +27 −0 WebKit/Browser2/AndroidManifest.xml
  206. +85 −0 WebKit/Browser2/build.xml
  207. +40 −0 WebKit/Browser2/proguard.cfg
  208. +12 −0 WebKit/Browser2/project.properties
  209. BIN WebKit/Browser2/res/drawable-hdpi/ic_launcher.png
  210. BIN WebKit/Browser2/res/drawable-ldpi/ic_launcher.png
  211. BIN WebKit/Browser2/res/drawable-mdpi/ic_launcher.png
  212. BIN WebKit/Browser2/res/drawable-xhdpi/ic_launcher.png
  213. +6 −0 WebKit/Browser2/res/layout/main.xml
  214. +4 −0 WebKit/Browser2/res/values/strings.xml
  215. +33 −0 WebKit/Browser2/src/com/commonsware/android/browser2/BrowserDemo2.java
  216. +8 −0 WebKit/Browser3/.classpath
  217. +33 −0 WebKit/Browser3/.project
  218. +27 −0 WebKit/Browser3/AndroidManifest.xml
  219. +85 −0 WebKit/Browser3/build.xml
  220. +40 −0 WebKit/Browser3/proguard.cfg
  221. +12 −0 WebKit/Browser3/project.properties
  222. BIN WebKit/Browser3/res/drawable-hdpi/ic_launcher.png
  223. BIN WebKit/Browser3/res/drawable-ldpi/ic_launcher.png
  224. BIN WebKit/Browser3/res/drawable-mdpi/ic_launcher.png
  225. BIN WebKit/Browser3/res/drawable-xhdpi/ic_launcher.png
  226. +6 −0 WebKit/Browser3/res/layout/main.xml
  227. +4 −0 WebKit/Browser3/res/values/strings.xml
  228. +56 −0 WebKit/Browser3/src/com/commonsware/android/webkit/BrowserDemo3.java
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ActionBarDemo</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.commonsware.android.inflation">
+
+ <supports-screens
+ android:anyDensity="true"
+ android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="true"/>
+
+ <uses-sdk
+ android:minSdkVersion="4"
+ android:targetSdkVersion="11"/>
+
+ <application
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/Theme.Sherlock"
+ android:uiOptions="splitActionBarWhenNarrow">
+ <activity
+ android:name=".ActionBarDemoActivity"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="InflationDemo" 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 into
+ Version Control Systems. -->
+ <loadproperties srcFile="local.properties" />
+
+ <!-- The ant.properties file can be created by you. It is only edited by the
+ 'android' tool to add properties to it.
+ This is the place to change some Ant specific build properties.
+ Here are some properties you may want to change/update:
+
+ source.dir
+ The name of the source directory. Default is 'src'.
+ out.dir
+ The name of the output directory. Default is 'bin'.
+
+ For other overridable properties, look at the beginning of the rules
+ files in the SDK, at tools/ant/build.xml
+
+ 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 into Version Control Systems.
+
+ -->
+ <property file="ant.properties" />
+
+ <!-- The project.properties file is created and updated by the 'android'
+ tool, as well as ADT.
+
+ This contains project specific properties such as project target, and library
+ dependencies. Lower level build properties are stored in ant.properties
+ (or in .classpath for Eclipse projects).
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems. -->
+ <loadproperties srcFile="project.properties" />
+
+ <!-- quick check on sdk.dir -->
+ <fail
+ message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
+ unless="sdk.dir"
+ />
+
+
+<!-- extension targets. Uncomment the ones where you want to do custom work
+ in between standard targets -->
+<!--
+ <target name="-pre-build">
+ </target>
+ <target name="-pre-compile">
+ </target>
+
+ /* This is typically used for code obfuscation.
+ Compiled code location: ${out.classes.absolute.dir}
+ If this is not done in place, override ${out.dex.input.absolute.dir} */
+ <target name="-post-compile">
+ </target>
+-->
+
+ <!-- Import the actual build file.
+
+ To customize existing targets, there are two options:
+ - Customize only one target:
+ - copy/paste the target into this file, *before* the
+ <import> task.
+ - customize it to your needs.
+ - Customize the whole content of build.xml
+ - copy/paste the content of the rules files (minus the top node)
+ into this file, replacing the <import> task.
+ - customize to your needs.
+
+ ***********************
+ ****** IMPORTANT ******
+ ***********************
+ In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+ in order to avoid having your file be overridden by tools such as "android update project"
+ -->
+ <!-- version-tag: 1 -->
+ <import file="${sdk.dir}/tools/ant/build.xml" />
+
+</project>
@@ -0,0 +1,13 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-14
+sdk-folder=/opt/android-sdk-linux_x86-1.1_r1
+android.library.reference.1=../../../../../projects/3rdParty/ActionBarSherlock-4.0.1/library
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Word:"
+ android:textAppearance="@android:style/TextAppearance.Medium"/>
+
+ <EditText
+ android:id="@+id/title"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="4dip"
+ android:layout_marginTop="4dip"
+ android:imeActionId="1337"
+ android:imeOptions="actionDone"
+ android:inputType="text"
+ android:width="160sp"/>
+
+</LinearLayout>
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:id="@+id/add"
+ android:icon="@android:drawable/ic_menu_add"
+ android:showAsAction="ifRoom"
+ android:title="@string/add" android:actionLayout="@layout/add"/>
+ <item
+ android:id="@+id/reset"
+ android:icon="@android:drawable/ic_menu_revert"
+ android:showAsAction="never"
+ android:title="@string/reset"/>
+
+</menu>
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Action Bar Demo</string>
+ <string name="add">Add</string>
+ <string name="reset">Reset</string>
+</resources>
@@ -0,0 +1,102 @@
+/***
+ Copyright (c) 2008-2012 CommonsWare, LLC
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ use this file except in compliance with the License. You may obtain a copy
+ of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ From _The Busy Coder's Guide to Android Development_
+ http://commonsware.com/Android
+ */
+
+package com.commonsware.android.inflation;
+
+import java.util.ArrayList;
+import android.os.Bundle;
+import android.view.KeyEvent;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.TextView;
+import com.actionbarsherlock.app.SherlockListActivity;
+import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuInflater;
+import com.actionbarsherlock.view.MenuItem;
+
+public class ActionBarDemoActivity extends SherlockListActivity
+ implements TextView.OnEditorActionListener {
+ private static final String[] items= { "lorem", "ipsum", "dolor",
+ "sit", "amet", "consectetuer", "adipiscing", "elit", "morbi",
+ "vel", "ligula", "vitae", "arcu", "aliquet", "mollis", "etiam",
+ "vel", "erat", "placerat", "ante", "porttitor", "sodales",
+ "pellentesque", "augue", "purus" };
+ private ArrayList<String> words=null;
+ private ArrayAdapter<String> adapter=null;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ initAdapter();
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ new MenuInflater(this).inflate(R.menu.actions, menu);
+
+ configureActionItem(menu);
+
+ return(super.onCreateOptionsMenu(menu));
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == R.id.reset) {
+ initAdapter();
+ return(true);
+ }
+
+ return(super.onOptionsItemSelected(item));
+ }
+
+ @Override
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+ if (event == null || event.getAction() == KeyEvent.ACTION_UP) {
+ adapter.add(v.getText().toString());
+ v.setText("");
+
+ InputMethodManager imm=
+ (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
+
+ imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
+ }
+
+ return(true);
+ }
+
+ private void configureActionItem(Menu menu) {
+ EditText add=
+ (EditText)menu.findItem(R.id.add).getActionView()
+ .findViewById(R.id.title);
+
+ add.setOnEditorActionListener(this);
+ }
+
+ private void initAdapter() {
+ words=new ArrayList<String>();
+
+ for (String s : items) {
+ words.add(s);
+ }
+
+ adapter=
+ new ArrayAdapter<String>(this,
+ android.R.layout.simple_list_item_1,
+ words);
+
+ setListAdapter(adapter);
+ }
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -8,6 +8,6 @@
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Button"/>
+ android:text="@string/button"/>
</LinearLayout>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="hello">Hello World, ButtonDemoActivity!</string>
+ <string name="button">Button</string>
<string name="app_name">ButtonDemo</string>
</resources>
@@ -1,19 +1,25 @@
<?xml version="1.0"?>
-<manifest package="com.commonsware.android.checkbox"
- xmlns:android="http://schemas.android.com/apk/res/android">
-
- <supports-screens android:anyDensity="true"
- android:largeScreens="true"
- android:normalScreens="true"
- android:smallScreens="true" />
- <uses-sdk android:minSdkVersion="4"/>
- <application android:icon="@drawable/cw">
- <activity android:label="CheckBoxDemo"
- android:name=".CheckBoxDemo">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.commonsware.android.checkbox">
+
+ <supports-screens
+ android:anyDensity="true"
+ android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="true"/>
+
+ <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4"/>
+
+ <application android:icon="@drawable/ic_launcher">
+ <activity
+ android:name=".CheckBoxDemo"
+ android:label="CheckBoxDemo">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 6b33c89

Please sign in to comment.