Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 11 commits
  • 176 files changed
  • 0 comments
  • 1 contributor

Showing 176 changed files with 4,302 additions and 73 deletions. Show diff stats Hide diff stats

  1. 2  ActionBar/ActionBarDemo/AndroidManifest.xml
  2. 2  ActionBar/ListNav/AndroidManifest.xml
  3. 8  ActionBar/Overlay/.classpath
  4. 33  ActionBar/Overlay/.project
  5. 18  ActionBar/Overlay/AndroidManifest.xml
  6. 85  ActionBar/Overlay/build.xml
  7. 20  ActionBar/Overlay/proguard-project.txt
  8. 3  ActionBar/Overlay/project.properties
  9. BIN  ActionBar/Overlay/res/drawable-hdpi/ic_launcher.png
  10. BIN  ActionBar/Overlay/res/drawable-ldpi/ic_launcher.png
  11. BIN  ActionBar/Overlay/res/drawable-mdpi/ic_launcher.png
  12. BIN  ActionBar/Overlay/res/drawable-xhdpi/ic_launcher.png
  13. 7  ActionBar/Overlay/res/drawable/action_bar_background.xml
  14. 25  ActionBar/Overlay/res/layout/add.xml
  15. 22  ActionBar/Overlay/res/menu/actions.xml
  16. 7  ActionBar/Overlay/res/values/strings.xml
  17. 112  ActionBar/Overlay/src/com/commonsware/android/inflation/ActionBarDemoActivity.java
  18. 8  ActionBar/Share/.classpath
  19. 33  ActionBar/Share/.project
  20. 18  ActionBar/Share/AndroidManifest.xml
  21. 85  ActionBar/Share/build.xml
  22. 20  ActionBar/Share/proguard-project.txt
  23. 3  ActionBar/Share/project.properties
  24. BIN  ActionBar/Share/res/drawable-hdpi/ic_launcher.png
  25. BIN  ActionBar/Share/res/drawable-ldpi/ic_launcher.png
  26. BIN  ActionBar/Share/res/drawable-mdpi/ic_launcher.png
  27. BIN  ActionBar/Share/res/drawable-xhdpi/ic_launcher.png
  28. 6  ActionBar/Share/res/layout/activity_main.xml
  29. 9  ActionBar/Share/res/menu/actions.xml
  30. 5  ActionBar/Share/res/values/strings.xml
  31. 82  ActionBar/Share/src/com/commonsware/android/sap/MainActivity.java
  32. 2  ActionBar/TabFragmentDemo/AndroidManifest.xml
  33. 2  ActionMode/Manual/AndroidManifest.xml
  34. 8  AppWidget/Resize/.classpath
  35. 33  AppWidget/Resize/.project
  36. 45  AppWidget/Resize/AndroidManifest.xml
  37. 17  AppWidget/Resize/ant.properties
  38. 85  AppWidget/Resize/build.xml
  39. 40  AppWidget/Resize/proguard.cfg
  40. 11  AppWidget/Resize/project.properties
  41. BIN  AppWidget/Resize/res/drawable-hdpi/ic_launcher.png
  42. BIN  AppWidget/Resize/res/drawable-ldpi/ic_launcher.png
  43. BIN  AppWidget/Resize/res/drawable-mdpi/ic_launcher.png
  44. BIN  AppWidget/Resize/res/drawable-nodpi/widget_frame.9.png
  45. BIN  AppWidget/Resize/res/drawable-xhdpi/ic_launcher.png
  46. 18  AppWidget/Resize/res/layout/widget.xml
  47. 4  AppWidget/Resize/res/values/strings.xml
  48. 8  AppWidget/Resize/res/xml/widget_provider.xml
  49. 17  AppWidget/Resize/src/com/commonsware/android/appwidget/resize/ActivationActivity.java
  50. 44  AppWidget/Resize/src/com/commonsware/android/appwidget/resize/AppWidget.java
  51. 8  AppWidget/TwoOrThreeDice/.classpath
  52. 33  AppWidget/TwoOrThreeDice/.project
  53. 43  AppWidget/TwoOrThreeDice/AndroidManifest.xml
  54. 17  AppWidget/TwoOrThreeDice/ant.properties
  55. 85  AppWidget/TwoOrThreeDice/build.xml
  56. 255  AppWidget/TwoOrThreeDice/dado_1.svg
  57. 494  AppWidget/TwoOrThreeDice/dado_2.svg
  58. 298  AppWidget/TwoOrThreeDice/dado_3.svg
  59. 321  AppWidget/TwoOrThreeDice/dado_4.svg
  60. 507  AppWidget/TwoOrThreeDice/dado_5.svg
  61. 370  AppWidget/TwoOrThreeDice/dado_6.svg
  62. 40  AppWidget/TwoOrThreeDice/proguard.cfg
  63. 11  AppWidget/TwoOrThreeDice/project.properties
  64. BIN  AppWidget/TwoOrThreeDice/res/drawable-hdpi/die_1.png
  65. BIN  AppWidget/TwoOrThreeDice/res/drawable-hdpi/die_2.png
  66. BIN  AppWidget/TwoOrThreeDice/res/drawable-hdpi/die_3.png
  67. BIN  AppWidget/TwoOrThreeDice/res/drawable-hdpi/die_4.png
  68. BIN  AppWidget/TwoOrThreeDice/res/drawable-hdpi/die_5.png
  69. BIN  AppWidget/TwoOrThreeDice/res/drawable-hdpi/die_6.png
  70. BIN  AppWidget/TwoOrThreeDice/res/drawable-hdpi/ic_launcher.png
  71. BIN  AppWidget/TwoOrThreeDice/res/drawable-ldpi/die_1.png
  72. BIN  AppWidget/TwoOrThreeDice/res/drawable-ldpi/die_2.png
  73. BIN  AppWidget/TwoOrThreeDice/res/drawable-ldpi/die_3.png
  74. BIN  AppWidget/TwoOrThreeDice/res/drawable-ldpi/die_4.png
  75. BIN  AppWidget/TwoOrThreeDice/res/drawable-ldpi/die_5.png
  76. BIN  AppWidget/TwoOrThreeDice/res/drawable-ldpi/die_6.png
  77. BIN  AppWidget/TwoOrThreeDice/res/drawable-ldpi/ic_launcher.png
  78. BIN  AppWidget/TwoOrThreeDice/res/drawable-mdpi/cw.png
  79. BIN  AppWidget/TwoOrThreeDice/res/drawable-mdpi/die_1.png
  80. BIN  AppWidget/TwoOrThreeDice/res/drawable-mdpi/die_2.png
  81. BIN  AppWidget/TwoOrThreeDice/res/drawable-mdpi/die_3.png
  82. BIN  AppWidget/TwoOrThreeDice/res/drawable-mdpi/die_4.png
  83. BIN  AppWidget/TwoOrThreeDice/res/drawable-mdpi/die_5.png
  84. BIN  AppWidget/TwoOrThreeDice/res/drawable-mdpi/die_6.png
  85. BIN  AppWidget/TwoOrThreeDice/res/drawable-mdpi/ic_launcher.png
  86. BIN  AppWidget/TwoOrThreeDice/res/drawable-xhdpi/die_1.png
  87. BIN  AppWidget/TwoOrThreeDice/res/drawable-xhdpi/die_2.png
  88. BIN  AppWidget/TwoOrThreeDice/res/drawable-xhdpi/die_3.png
  89. BIN  AppWidget/TwoOrThreeDice/res/drawable-xhdpi/die_4.png
  90. BIN  AppWidget/TwoOrThreeDice/res/drawable-xhdpi/die_5.png
  91. BIN  AppWidget/TwoOrThreeDice/res/drawable-xhdpi/die_6.png
  92. BIN  AppWidget/TwoOrThreeDice/res/drawable-xhdpi/ic_launcher.png
  93. BIN  AppWidget/TwoOrThreeDice/res/drawable/widget_frame.9.png
  94. 8  AppWidget/TwoOrThreeDice/res/layout/invisible.xml
  95. 33  AppWidget/TwoOrThreeDice/res/layout/lockscreen.xml
  96. 25  AppWidget/TwoOrThreeDice/res/layout/widget.xml
  97. 4  AppWidget/TwoOrThreeDice/res/values/strings.xml
  98. 8  AppWidget/TwoOrThreeDice/res/xml/widget_provider.xml
  99. 95  AppWidget/TwoOrThreeDice/src/com/commonsware/android/appwidget/dice/AppWidget.java
  100. 17  AppWidget/TwoOrThreeDice/src/com/commonsware/android/appwidget/dice/PairOfDiceActivity.java
  101. 5  Camera/Picture/AndroidManifest.xml
  102. 6  ConfigChange/Fragments/AndroidManifest.xml
  103. 2  Database/Constants/AndroidManifest.xml
  104. BIN  Database/ConstantsSecure/libs/armeabi/libdatabase_sqlcipher.so
  105. BIN  Database/ConstantsSecure/libs/armeabi/libsqlcipher_android.so
  106. BIN  Database/ConstantsSecure/libs/armeabi/libstlport_shared.so
  107. BIN  Database/ConstantsSecure/libs/sqlcipher.jar
  108. BIN  Database/ConstantsSecure/libs/x86/libdatabase_sqlcipher.so
  109. BIN  Database/ConstantsSecure/libs/x86/libsqlcipher_android.so
  110. BIN  Database/ConstantsSecure/libs/x86/libstlport_shared.so
  111. BIN  Database/PasswordBox/libs/armeabi/libdatabase_sqlcipher.so
  112. BIN  Database/PasswordBox/libs/armeabi/libsqlcipher_android.so
  113. BIN  Database/PasswordBox/libs/armeabi/libstlport_shared.so
  114. BIN  Database/PasswordBox/libs/sqlcipher.jar
  115. BIN  Database/PasswordBox/libs/x86/libdatabase_sqlcipher.so
  116. BIN  Database/PasswordBox/libs/x86/libsqlcipher_android.so
  117. BIN  Database/PasswordBox/libs/x86/libstlport_shared.so
  118. 2  Database/SQLCipherPassphrase/AndroidManifest.xml
  119. BIN  Database/SQLCipherPassphrase/libs/armeabi/libdatabase_sqlcipher.so
  120. BIN  Database/SQLCipherPassphrase/libs/armeabi/libsqlcipher_android.so
  121. BIN  Database/SQLCipherPassphrase/libs/armeabi/libstlport_shared.so
  122. BIN  Database/SQLCipherPassphrase/libs/sqlcipher.jar
  123. BIN  Database/SQLCipherPassphrase/libs/x86/libdatabase_sqlcipher.so
  124. BIN  Database/SQLCipherPassphrase/libs/x86/libsqlcipher_android.so
  125. BIN  Database/SQLCipherPassphrase/libs/x86/libstlport_shared.so
  126. 2  Drawable/ScaleClip/AndroidManifest.xml
  127. 2  Files/ReadWrite/AndroidManifest.xml
  128. 2  Focus/Sampler/AndroidManifest.xml
  129. 2  Fragments/ActionBar/AndroidManifest.xml
  130. 2  Fragments/Dynamic/AndroidManifest.xml
  131. 2  Fragments/Static/AndroidManifest.xml
  132. 2  GridLayout/Sampler/AndroidManifest.xml
  133. 2  Intents/OnBattery/AndroidManifest.xml
  134. 2  Internet/Download/AndroidManifest.xml
  135. 7  Internet/Weather/AndroidManifest.xml
  136. 6  LargeScreen/EU4You/AndroidManifest.xml
  137. 4  Maps/NooYawkFragments/AndroidManifest.xml
  138. 12  Maps/NooYawkFragments/res/menu/options.xml
  139. 8  MapsV2/Camera/.classpath
  140. 33  MapsV2/Camera/.project
  141. 46  MapsV2/Camera/AndroidManifest.xml
  142. BIN  MapsV2/Camera/libs/android-support-v4.jar
  143. 20  MapsV2/Camera/proguard-project.txt
  144. 16  MapsV2/Camera/project.properties
  145. BIN  MapsV2/Camera/res/drawable-hdpi/ic_launcher.png
  146. BIN  MapsV2/Camera/res/drawable-ldpi/ic_launcher.png
  147. BIN  MapsV2/Camera/res/drawable-mdpi/ic_launcher.png
  148. BIN  MapsV2/Camera/res/drawable-xhdpi/ic_launcher.png
  149. 5  MapsV2/Camera/res/layout/activity_main.xml
  150. 12  MapsV2/Camera/res/layout/legal.xml
  151. 35  MapsV2/Camera/res/layout/popup.xml
  152. 9  MapsV2/Camera/res/menu/activity_main.xml
  153. 21  MapsV2/Camera/res/values/strings.xml
  154. 100  MapsV2/Camera/src/com/commonsware/android/mapsv2/camera/AbstractMapActivity.java
  155. 32  MapsV2/Camera/src/com/commonsware/android/mapsv2/camera/LegalNoticesActivity.java
  156. 158  MapsV2/Camera/src/com/commonsware/android/mapsv2/camera/MainActivity.java
  157. 47  MapsV2/Camera/src/com/commonsware/android/mapsv2/camera/PopupAdapter.java
  158. 2  MapsV2/Location/res/values/strings.xml
  159. 21  MapsV2/Location/src/com/commonsware/android/mapsv2/location/MainActivity.java
  160. 20  MapsV2/NooYawk/src/com/commonsware/android/mapsv2/nooyawk/MainActivity.java
  161. 14  MapsV2/Pager/res/values/strings.xml
  162. 7  MapsV2/Pager/src/com/commonsware/android/mapsv2/pager/MapPageAdapter.java
  163. 58  MapsV2/Pager/src/com/commonsware/android/mapsv2/pager/PageMapFragment.java
  164. 2  Notifications/DownloadNotify/AndroidManifest.xml
  165. 2  Prefs/FragmentsBC/AndroidManifest.xml
  166. 2  Prefs/SingleHeader/AndroidManifest.xml
  167. 2  Prefs/SingleHeader2/AndroidManifest.xml
  168. 2  Progress/ActionBar/AndroidManifest.xml
  169. 2  Sensor/List/AndroidManifest.xml
  170. 2  Service/Downloader/AndroidManifest.xml
  171. 2  Service/FakePlayer/AndroidManifest.xml
  172. 2  Testing/JUnit/AndroidManifest.xml
  173. 6  Threads/AsyncTask/AndroidManifest.xml
  174. 2  ViewPager/Fragments/AndroidManifest.xml
  175. 2  ViewPager/Indicator/AndroidManifest.xml
  176. 2  ViewPager/TabPager/AndroidManifest.xml
2  ActionBar/ActionBarDemo/AndroidManifest.xml
@@ -10,7 +10,7 @@
10 10
 
11 11
 	<uses-sdk
12 12
 		android:minSdkVersion="7"
13  
-		android:targetSdkVersion="11"/>
  13
+		android:targetSdkVersion="14"/>
14 14
 
15 15
 	<application
16 16
 		android:icon="@drawable/ic_launcher"
2  ActionBar/ListNav/AndroidManifest.xml
@@ -10,7 +10,7 @@
10 10
 
11 11
 	<uses-sdk
12 12
 		android:minSdkVersion="8"
13  
-		android:targetSdkVersion="11"/>
  13
+		android:targetSdkVersion="14"/>
14 14
 
15 15
 	<application
16 16
 		android:icon="@drawable/ic_launcher"
8  ActionBar/Overlay/.classpath
... ...
@@ -0,0 +1,8 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<classpath>
  3
+	<classpathentry kind="src" path="src"/>
  4
+	<classpathentry kind="src" path="gen"/>
  5
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
  6
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
  7
+	<classpathentry kind="output" path="bin/classes"/>
  8
+</classpath>
33  ActionBar/Overlay/.project
... ...
@@ -0,0 +1,33 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<projectDescription>
  3
+	<name>ActionBarOverlayDemo</name>
  4
+	<comment></comment>
  5
+	<projects>
  6
+	</projects>
  7
+	<buildSpec>
  8
+		<buildCommand>
  9
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
  10
+			<arguments>
  11
+			</arguments>
  12
+		</buildCommand>
  13
+		<buildCommand>
  14
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
  15
+			<arguments>
  16
+			</arguments>
  17
+		</buildCommand>
  18
+		<buildCommand>
  19
+			<name>org.eclipse.jdt.core.javabuilder</name>
  20
+			<arguments>
  21
+			</arguments>
  22
+		</buildCommand>
  23
+		<buildCommand>
  24
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
  25
+			<arguments>
  26
+			</arguments>
  27
+		</buildCommand>
  28
+	</buildSpec>
  29
+	<natures>
  30
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
  31
+		<nature>org.eclipse.jdt.core.javanature</nature>
  32
+	</natures>
  33
+</projectDescription>
18  ActionBar/Overlay/AndroidManifest.xml
... ...
@@ -0,0 +1,18 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.commonsware.android.inflation">
  3
+
  4
+	<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
  5
+
  6
+	<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="14"/>
  7
+
  8
+	<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/Theme.Sherlock" android:uiOptions="splitActionBarWhenNarrow">
  9
+		<activity android:name=".ActionBarDemoActivity" android:label="@string/app_name">
  10
+			<intent-filter>
  11
+				<action android:name="android.intent.action.MAIN"/>
  12
+
  13
+				<category android:name="android.intent.category.LAUNCHER"/>
  14
+			</intent-filter>
  15
+		</activity>
  16
+	</application>
  17
+
  18
+</manifest>
85  ActionBar/Overlay/build.xml
... ...
@@ -0,0 +1,85 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<project name="InflationDemo" default="help">
  3
+
  4
+    <!-- The local.properties file is created and updated by the 'android' tool.
  5
+         It contains the path to the SDK. It should *NOT* be checked into
  6
+         Version Control Systems. -->
  7
+    <loadproperties srcFile="local.properties" />
  8
+
  9
+    <!-- The ant.properties file can be created by you. It is only edited by the
  10
+         'android' tool to add properties to it.
  11
+         This is the place to change some Ant specific build properties.
  12
+         Here are some properties you may want to change/update:
  13
+
  14
+         source.dir
  15
+             The name of the source directory. Default is 'src'.
  16
+         out.dir
  17
+             The name of the output directory. Default is 'bin'.
  18
+
  19
+         For other overridable properties, look at the beginning of the rules
  20
+         files in the SDK, at tools/ant/build.xml
  21
+
  22
+         Properties related to the SDK location or the project target should
  23
+         be updated using the 'android' tool with the 'update' action.
  24
+
  25
+         This file is an integral part of the build system for your
  26
+         application and should be checked into Version Control Systems.
  27
+
  28
+         -->
  29
+    <property file="ant.properties" />
  30
+
  31
+    <!-- The project.properties file is created and updated by the 'android'
  32
+         tool, as well as ADT.
  33
+
  34
+         This contains project specific properties such as project target, and library
  35
+         dependencies. Lower level build properties are stored in ant.properties
  36
+         (or in .classpath for Eclipse projects).
  37
+
  38
+         This file is an integral part of the build system for your
  39
+         application and should be checked into Version Control Systems. -->
  40
+    <loadproperties srcFile="project.properties" />
  41
+
  42
+    <!-- quick check on sdk.dir -->
  43
+    <fail
  44
+            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
  45
+            unless="sdk.dir"
  46
+    />
  47
+
  48
+
  49
+<!-- extension targets. Uncomment the ones where you want to do custom work
  50
+     in between standard targets -->
  51
+<!--
  52
+    <target name="-pre-build">
  53
+    </target>
  54
+    <target name="-pre-compile">
  55
+    </target>
  56
+
  57
+    /* This is typically used for code obfuscation.
  58
+       Compiled code location: ${out.classes.absolute.dir}
  59
+       If this is not done in place, override ${out.dex.input.absolute.dir} */
  60
+    <target name="-post-compile">
  61
+    </target>
  62
+-->
  63
+
  64
+    <!-- Import the actual build file.
  65
+
  66
+         To customize existing targets, there are two options:
  67
+         - Customize only one target:
  68
+             - copy/paste the target into this file, *before* the
  69
+               <import> task.
  70
+             - customize it to your needs.
  71
+         - Customize the whole content of build.xml
  72
+             - copy/paste the content of the rules files (minus the top node)
  73
+               into this file, replacing the <import> task.
  74
+             - customize to your needs.
  75
+
  76
+         ***********************
  77
+         ****** IMPORTANT ******
  78
+         ***********************
  79
+         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
  80
+         in order to avoid having your file be overridden by tools such as "android update project"
  81
+    -->
  82
+    <!-- version-tag: 1 -->
  83
+    <import file="${sdk.dir}/tools/ant/build.xml" />
  84
+
  85
+</project>
20  ActionBar/Overlay/proguard-project.txt
... ...
@@ -0,0 +1,20 @@
  1
+# To enable ProGuard in your project, edit project.properties
  2
+# to define the proguard.config property as described in that file.
  3
+#
  4
+# Add project specific ProGuard rules here.
  5
+# By default, the flags in this file are appended to flags specified
  6
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
  7
+# You can edit the include path and order by changing the ProGuard
  8
+# include property in project.properties.
  9
+#
  10
+# For more details, see
  11
+#   http://developer.android.com/guide/developing/tools/proguard.html
  12
+
  13
+# Add any project specific keep options here:
  14
+
  15
+# If your project uses WebView with JS, uncomment the following
  16
+# and specify the fully qualified class name to the JavaScript interface
  17
+# class:
  18
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  19
+#   public *;
  20
+#}
3  ActionBar/Overlay/project.properties
... ...
@@ -0,0 +1,3 @@
  1
+sdk-folder=/opt/android-sdk-linux_x86-1.1_r1
  2
+target=android-15
  3
+android.library.reference.1=../../external/ActionBarSherlock
BIN  ActionBar/Overlay/res/drawable-hdpi/ic_launcher.png
BIN  ActionBar/Overlay/res/drawable-ldpi/ic_launcher.png
BIN  ActionBar/Overlay/res/drawable-mdpi/ic_launcher.png
BIN  ActionBar/Overlay/res/drawable-xhdpi/ic_launcher.png
7  ActionBar/Overlay/res/drawable/action_bar_background.xml
... ...
@@ -0,0 +1,7 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
  3
+	android:shape="rectangle">
  4
+
  5
+	<solid android:color="#AAFFFFFF"/>
  6
+
  7
+</shape>
25  ActionBar/Overlay/res/layout/add.xml
... ...
@@ -0,0 +1,25 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3
+	android:layout_width="fill_parent"
  4
+	android:layout_height="wrap_content"
  5
+	android:orientation="horizontal">
  6
+
  7
+	<TextView
  8
+		android:layout_width="wrap_content"
  9
+		android:layout_height="wrap_content"
  10
+		android:text="Word:"
  11
+		android:textAppearance="@android:style/TextAppearance.Medium"/>
  12
+
  13
+	<EditText
  14
+		android:id="@+id/title"
  15
+		android:layout_width="0px"
  16
+    android:layout_weight="1"
  17
+    android:layout_height="wrap_content"
  18
+    android:layout_marginLeft="4dip"
  19
+    android:layout_marginTop="4dip"
  20
+    android:imeActionId="1337"
  21
+    android:imeOptions="actionDone"
  22
+    android:inputType="text"
  23
+    android:width="100sp"/>
  24
+
  25
+</LinearLayout>
22  ActionBar/Overlay/res/menu/actions.xml
... ...
@@ -0,0 +1,22 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
  3
+
  4
+	<item
  5
+		android:id="@+id/add"
  6
+		android:actionLayout="@layout/add"
  7
+		android:icon="@android:drawable/ic_menu_add"
  8
+		android:showAsAction="ifRoom"
  9
+		android:title="@string/add"/>
  10
+	<item
  11
+		android:id="@+id/reset"
  12
+		android:icon="@android:drawable/ic_menu_revert"
  13
+		android:showAsAction="always|withText"
  14
+		android:title="@string/reset"/>
  15
+	<item
  16
+		android:id="@+id/about"
  17
+		android:icon="@android:drawable/ic_menu_info_details"
  18
+		android:showAsAction="never"
  19
+		android:title="@string/about">
  20
+	</item>
  21
+
  22
+</menu>
7  ActionBar/Overlay/res/values/strings.xml
... ...
@@ -0,0 +1,7 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<resources>
  3
+    <string name="app_name">Action Bar Demo</string>
  4
+    <string name="add">Add</string>
  5
+    <string name="reset">Reset</string>
  6
+    <string name="about">About</string>
  7
+</resources>
112  ActionBar/Overlay/src/com/commonsware/android/inflation/ActionBarDemoActivity.java
... ...
@@ -0,0 +1,112 @@
  1
+/***
  2
+  Copyright (c) 2008-2012 CommonsWare, LLC
  3
+  Licensed under the Apache License, Version 2.0 (the "License"); you may not
  4
+  use this file except in compliance with the License. You may obtain	a copy
  5
+  of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
  6
+  by applicable law or agreed to in writing, software distributed under the
  7
+  License is distributed on an "AS IS" BASIS,	WITHOUT	WARRANTIES OR CONDITIONS
  8
+  OF ANY KIND, either express or implied. See the License for the specific
  9
+  language governing permissions and limitations under the License.
  10
+	
  11
+  From _The Busy Coder's Guide to Android Development_
  12
+    http://commonsware.com/Android
  13
+ */
  14
+
  15
+package com.commonsware.android.inflation;
  16
+
  17
+import android.graphics.drawable.Drawable;
  18
+import android.os.Bundle;
  19
+import android.view.KeyEvent;
  20
+import android.view.Window;
  21
+import android.view.inputmethod.InputMethodManager;
  22
+import android.widget.ArrayAdapter;
  23
+import android.widget.EditText;
  24
+import android.widget.TextView;
  25
+import java.util.ArrayList;
  26
+import com.actionbarsherlock.app.SherlockListActivity;
  27
+import com.actionbarsherlock.view.Menu;
  28
+import com.actionbarsherlock.view.MenuInflater;
  29
+import com.actionbarsherlock.view.MenuItem;
  30
+
  31
+public class ActionBarDemoActivity extends SherlockListActivity
  32
+    implements TextView.OnEditorActionListener {
  33
+  private static final String[] items= { "lorem", "ipsum", "dolor",
  34
+      "sit", "amet", "consectetuer", "adipiscing", "elit", "morbi",
  35
+      "vel", "ligula", "vitae", "arcu", "aliquet", "mollis", "etiam",
  36
+      "vel", "erat", "placerat", "ante", "porttitor", "sodales",
  37
+      "pellentesque", "augue", "purus" };
  38
+  private ArrayList<String> words=null;
  39
+  private ArrayAdapter<String> adapter=null;
  40
+
  41
+  @Override
  42
+  public void onCreate(Bundle icicle) {
  43
+    super.onCreate(icicle);
  44
+
  45
+    getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
  46
+
  47
+    initAdapter();
  48
+
  49
+    Drawable d=
  50
+        getResources().getDrawable(R.drawable.action_bar_background);
  51
+
  52
+    getSupportActionBar().setBackgroundDrawable(d);
  53
+    getSupportActionBar().setSplitBackgroundDrawable(d);
  54
+  }
  55
+
  56
+  @Override
  57
+  public boolean onCreateOptionsMenu(Menu menu) {
  58
+    new MenuInflater(this).inflate(R.menu.actions, menu);
  59
+
  60
+    configureActionItem(menu);
  61
+
  62
+    return(super.onCreateOptionsMenu(menu));
  63
+  }
  64
+
  65
+  @Override
  66
+  public boolean onOptionsItemSelected(MenuItem item) {
  67
+    if (item.getItemId() == R.id.reset) {
  68
+      initAdapter();
  69
+      return(true);
  70
+    }
  71
+
  72
+    return(super.onOptionsItemSelected(item));
  73
+  }
  74
+
  75
+  @Override
  76
+  public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
  77
+    if (event == null || event.getAction() == KeyEvent.ACTION_UP) {
  78
+      adapter.add(v.getText().toString());
  79
+      v.setText("");
  80
+
  81
+      InputMethodManager imm=
  82
+          (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
  83
+
  84
+      imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
  85
+    }
  86
+
  87
+    return(true);
  88
+  }
  89
+
  90
+  private void configureActionItem(Menu menu) {
  91
+    EditText add=
  92
+        (EditText)menu.findItem(R.id.add).getActionView()
  93
+                      .findViewById(R.id.title);
  94
+
  95
+    add.setOnEditorActionListener(this);
  96
+  }
  97
+
  98
+  private void initAdapter() {
  99
+    words=new ArrayList<String>();
  100
+
  101
+    for (String s : items) {
  102
+      words.add(s);
  103
+    }
  104
+
  105
+    adapter=
  106
+        new ArrayAdapter<String>(this,
  107
+                                 android.R.layout.simple_list_item_1,
  108
+                                 words);
  109
+
  110
+    setListAdapter(adapter);
  111
+  }
  112
+}
8  ActionBar/Share/.classpath
... ...
@@ -0,0 +1,8 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<classpath>
  3
+	<classpathentry kind="src" path="src"/>
  4
+	<classpathentry kind="src" path="gen"/>
  5
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
  6
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
  7
+	<classpathentry kind="output" path="bin/classes"/>
  8
+</classpath>
33  ActionBar/Share/.project
... ...
@@ -0,0 +1,33 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<projectDescription>
  3
+	<name>ShareActionProvider</name>
  4
+	<comment></comment>
  5
+	<projects>
  6
+	</projects>
  7
+	<buildSpec>
  8
+		<buildCommand>
  9
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
  10
+			<arguments>
  11
+			</arguments>
  12
+		</buildCommand>
  13
+		<buildCommand>
  14
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
  15
+			<arguments>
  16
+			</arguments>
  17
+		</buildCommand>
  18
+		<buildCommand>
  19
+			<name>org.eclipse.jdt.core.javabuilder</name>
  20
+			<arguments>
  21
+			</arguments>
  22
+		</buildCommand>
  23
+		<buildCommand>
  24
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
  25
+			<arguments>
  26
+			</arguments>
  27
+		</buildCommand>
  28
+	</buildSpec>
  29
+	<natures>
  30
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
  31
+		<nature>org.eclipse.jdt.core.javanature</nature>
  32
+	</natures>
  33
+</projectDescription>
18  ActionBar/Share/AndroidManifest.xml
... ...
@@ -0,0 +1,18 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.commonsware.android.sap">
  3
+
  4
+	<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
  5
+
  6
+	<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="14"/>
  7
+
  8
+	<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/Theme.Sherlock" android:uiOptions="splitActionBarWhenNarrow">
  9
+		<activity android:name=".MainActivity" android:label="@string/app_name">
  10
+			<intent-filter>
  11
+				<action android:name="android.intent.action.MAIN"/>
  12
+
  13
+				<category android:name="android.intent.category.LAUNCHER"/>
  14
+			</intent-filter>
  15
+		</activity>
  16
+	</application>
  17
+
  18
+</manifest>
85  ActionBar/Share/build.xml
... ...
@@ -0,0 +1,85 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<project name="InflationDemo" default="help">
  3
+
  4
+    <!-- The local.properties file is created and updated by the 'android' tool.
  5
+         It contains the path to the SDK. It should *NOT* be checked into
  6
+         Version Control Systems. -->
  7
+    <loadproperties srcFile="local.properties" />
  8
+
  9
+    <!-- The ant.properties file can be created by you. It is only edited by the
  10
+         'android' tool to add properties to it.
  11
+         This is the place to change some Ant specific build properties.
  12
+         Here are some properties you may want to change/update:
  13
+
  14
+         source.dir
  15
+             The name of the source directory. Default is 'src'.
  16
+         out.dir
  17
+             The name of the output directory. Default is 'bin'.
  18
+
  19
+         For other overridable properties, look at the beginning of the rules
  20
+         files in the SDK, at tools/ant/build.xml
  21
+
  22
+         Properties related to the SDK location or the project target should
  23
+         be updated using the 'android' tool with the 'update' action.
  24
+
  25
+         This file is an integral part of the build system for your
  26
+         application and should be checked into Version Control Systems.
  27
+
  28
+         -->
  29
+    <property file="ant.properties" />
  30
+
  31
+    <!-- The project.properties file is created and updated by the 'android'
  32
+         tool, as well as ADT.
  33
+
  34
+         This contains project specific properties such as project target, and library
  35
+         dependencies. Lower level build properties are stored in ant.properties
  36
+         (or in .classpath for Eclipse projects).
  37
+
  38
+         This file is an integral part of the build system for your
  39
+         application and should be checked into Version Control Systems. -->
  40
+    <loadproperties srcFile="project.properties" />
  41
+
  42
+    <!-- quick check on sdk.dir -->
  43
+    <fail
  44
+            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
  45
+            unless="sdk.dir"
  46
+    />
  47
+
  48
+
  49
+<!-- extension targets. Uncomment the ones where you want to do custom work
  50
+     in between standard targets -->
  51
+<!--
  52
+    <target name="-pre-build">
  53
+    </target>
  54
+    <target name="-pre-compile">
  55
+    </target>
  56
+
  57
+    /* This is typically used for code obfuscation.
  58
+       Compiled code location: ${out.classes.absolute.dir}
  59
+       If this is not done in place, override ${out.dex.input.absolute.dir} */
  60
+    <target name="-post-compile">
  61
+    </target>
  62
+-->
  63
+
  64
+    <!-- Import the actual build file.
  65
+
  66
+         To customize existing targets, there are two options:
  67
+         - Customize only one target:
  68
+             - copy/paste the target into this file, *before* the
  69
+               <import> task.
  70
+             - customize it to your needs.
  71
+         - Customize the whole content of build.xml
  72
+             - copy/paste the content of the rules files (minus the top node)
  73
+               into this file, replacing the <import> task.
  74
+             - customize to your needs.
  75
+
  76
+         ***********************
  77
+         ****** IMPORTANT ******
  78
+         ***********************
  79
+         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
  80
+         in order to avoid having your file be overridden by tools such as "android update project"
  81
+    -->
  82
+    <!-- version-tag: 1 -->
  83
+    <import file="${sdk.dir}/tools/ant/build.xml" />
  84
+
  85
+</project>
20  ActionBar/Share/proguard-project.txt
... ...
@@ -0,0 +1,20 @@
  1
+# To enable ProGuard in your project, edit project.properties
  2
+# to define the proguard.config property as described in that file.
  3
+#
  4
+# Add project specific ProGuard rules here.
  5
+# By default, the flags in this file are appended to flags specified
  6
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
  7
+# You can edit the include path and order by changing the ProGuard
  8
+# include property in project.properties.
  9
+#
  10
+# For more details, see
  11
+#   http://developer.android.com/guide/developing/tools/proguard.html
  12
+
  13
+# Add any project specific keep options here:
  14
+
  15
+# If your project uses WebView with JS, uncomment the following
  16
+# and specify the fully qualified class name to the JavaScript interface
  17
+# class:
  18
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  19
+#   public *;
  20
+#}
3  ActionBar/Share/project.properties
... ...
@@ -0,0 +1,3 @@
  1
+sdk-folder=/opt/android-sdk-linux_x86-1.1_r1
  2
+target=android-15
  3
+android.library.reference.1=../../external/ActionBarSherlock
BIN  ActionBar/Share/res/drawable-hdpi/ic_launcher.png
BIN  ActionBar/Share/res/drawable-ldpi/ic_launcher.png
BIN  ActionBar/Share/res/drawable-mdpi/ic_launcher.png
BIN  ActionBar/Share/res/drawable-xhdpi/ic_launcher.png
6  ActionBar/Share/res/layout/activity_main.xml
... ...
@@ -0,0 +1,6 @@
  1
+<EditText xmlns:android="http://schemas.android.com/apk/res/android"
  2
+	android:id="@+id/editor"
  3
+	android:layout_width="match_parent"
  4
+	android:layout_height="match_parent"
  5
+	android:gravity="left|top"
  6
+	android:inputType="textMultiLine"/>
9  ActionBar/Share/res/menu/actions.xml
... ...
@@ -0,0 +1,9 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
  3
+
  4
+	<item
  5
+		android:id="@+id/share"
  6
+		android:actionProviderClass="com.actionbarsherlock.widget.ShareActionProvider"
  7
+		android:showAsAction="ifRoom"/>
  8
+
  9
+</menu>
5  ActionBar/Share/res/values/strings.xml
... ...
@@ -0,0 +1,5 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<resources>
  3
+    <string name="app_name">ShareActionProvider Demo</string>
  4
+    <string name="share">Share</string>
  5
+</resources>
82  ActionBar/Share/src/com/commonsware/android/sap/MainActivity.java
... ...
@@ -0,0 +1,82 @@
  1
+/***
  2
+  Copyright (c) 2012 CommonsWare, LLC
  3
+  Licensed under the Apache License, Version 2.0 (the "License"); you may not
  4
+  use this file except in compliance with the License. You may obtain	a copy
  5
+  of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
  6
+  by applicable law or agreed to in writing, software distributed under the
  7
+  License is distributed on an "AS IS" BASIS,	WITHOUT	WARRANTIES OR CONDITIONS
  8
+  OF ANY KIND, either express or implied. See the License for the specific
  9
+  language governing permissions and limitations under the License.
  10
+	
  11
+  From _The Busy Coder's Guide to Android Development_
  12
+    http://commonsware.com/Android
  13
+ */
  14
+
  15
+package com.commonsware.android.sap;
  16
+
  17
+import android.content.Intent;
  18
+import android.os.Bundle;
  19
+import android.text.Editable;
  20
+import android.text.TextWatcher;
  21
+import android.widget.EditText;
  22
+import android.widget.Toast;
  23
+import com.actionbarsherlock.app.SherlockFragmentActivity;
  24
+import com.actionbarsherlock.view.Menu;
  25
+import com.actionbarsherlock.view.MenuInflater;
  26
+import com.actionbarsherlock.widget.ShareActionProvider;
  27
+
  28
+public class MainActivity extends SherlockFragmentActivity implements
  29
+    ShareActionProvider.OnShareTargetSelectedListener, TextWatcher {
  30
+  private ShareActionProvider share=null;
  31
+  private Intent shareIntent=new Intent(Intent.ACTION_SEND);
  32
+  private EditText editor=null;
  33
+
  34
+  @Override
  35
+  public void onCreate(Bundle icicle) {
  36
+    super.onCreate(icicle);
  37
+    setContentView(R.layout.activity_main);
  38
+
  39
+    shareIntent.setType("text/plain");
  40
+    editor=(EditText)findViewById(R.id.editor);
  41
+    editor.addTextChangedListener(this);
  42
+  }
  43
+
  44
+  @Override
  45
+  public boolean onCreateOptionsMenu(Menu menu) {
  46
+    new MenuInflater(this).inflate(R.menu.actions, menu);
  47
+
  48
+    share=
  49
+        (ShareActionProvider)menu.findItem(R.id.share)
  50
+                                 .getActionProvider();
  51
+    share.setOnShareTargetSelectedListener(this);
  52
+
  53
+    return(super.onCreateOptionsMenu(menu));
  54
+  }
  55
+
  56
+  @Override
  57
+  public boolean onShareTargetSelected(ShareActionProvider source,
  58
+                                       Intent intent) {
  59
+    Toast.makeText(this, intent.getComponent().toString(),
  60
+                   Toast.LENGTH_LONG).show();
  61
+
  62
+    return(false);
  63
+  }
  64
+
  65
+  @Override
  66
+  public void afterTextChanged(Editable s) {
  67
+    shareIntent.putExtra(Intent.EXTRA_TEXT, editor.getText());
  68
+    share.setShareIntent(shareIntent);
  69
+  }
  70
+
  71
+  @Override
  72
+  public void beforeTextChanged(CharSequence s, int start, int count,
  73
+                                int after) {
  74
+    // ignored
  75
+  }
  76
+
  77
+  @Override
  78
+  public void onTextChanged(CharSequence s, int start, int before,
  79
+                            int count) {
  80
+    // ignored
  81
+  }
  82
+}
2  ActionBar/TabFragmentDemo/AndroidManifest.xml
@@ -10,7 +10,7 @@
10 10
 
11 11
 	<uses-sdk
12 12
 		android:minSdkVersion="8"
13  
-		android:targetSdkVersion="11"/>
  13
+		android:targetSdkVersion="14"/>
14 14
 
15 15
 	<application
16 16
 		android:icon="@drawable/ic_launcher"
2  ActionMode/Manual/AndroidManifest.xml
@@ -4,7 +4,7 @@
4 4
 
5 5
 	<uses-sdk
6 6
 		android:minSdkVersion="7"
7  
-		android:targetSdkVersion="11"/>
  7
+		android:targetSdkVersion="14"/>
8 8
 
9 9
 	<supports-screens
10 10
 		android:anyDensity="true"
8  AppWidget/Resize/.classpath
... ...
@@ -0,0 +1,8 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<classpath>
  3
+	<classpathentry kind="src" path="src"/>
  4
+	<classpathentry kind="src" path="gen"/>
  5
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
  6
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
  7
+	<classpathentry kind="output" path="bin/classes"/>
  8
+</classpath>
33  AppWidget/Resize/.project
... ...
@@ -0,0 +1,33 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<projectDescription>
  3
+	<name>ResizeAppWidget</name>
  4
+	<comment></comment>
  5
+	<projects>
  6
+	</projects>
  7
+	<buildSpec>
  8
+		<buildCommand>
  9
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
  10
+			<arguments>
  11
+			</arguments>
  12
+		</buildCommand>
  13
+		<buildCommand>
  14
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
  15
+			<arguments>
  16
+			</arguments>
  17
+		</buildCommand>
  18
+		<buildCommand>
  19
+			<name>org.eclipse.jdt.core.javabuilder</name>
  20
+			<arguments>
  21
+			</arguments>
  22
+		</buildCommand>
  23
+		<buildCommand>
  24
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
  25
+			<arguments>
  26
+			</arguments>
  27
+		</buildCommand>
  28
+	</buildSpec>
  29
+	<natures>
  30
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
  31
+		<nature>org.eclipse.jdt.core.javanature</nature>
  32
+	</natures>
  33
+</projectDescription>
45  AppWidget/Resize/AndroidManifest.xml
... ...
@@ -0,0 +1,45 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3
+	package="com.commonsware.android.appwidget.resize"
  4
+	android:versionCode="1"
  5
+	android:versionName="1.0">
  6
+
  7
+	<uses-sdk
  8
+		android:minSdkVersion="16"
  9
+		android:targetSdkVersion="16"/>
  10
+
  11
+	<supports-screens
  12
+		android:largeScreens="true"
  13
+		android:normalScreens="true"
  14
+		android:smallScreens="false"/>
  15
+
  16
+	<application
  17
+		android:allowBackup="false"
  18
+		android:icon="@drawable/ic_launcher"
  19
+		android:label="@string/app_name">
  20
+		<receiver
  21
+			android:name="AppWidget"
  22
+			android:icon="@drawable/ic_launcher"
  23
+			android:label="@string/app_name">
  24
+			<intent-filter>
  25
+				<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
  26
+				<action android:name="android.appwidget.action.APPWIDGET_OPTIONS_CHANGED"/>
  27
+			</intent-filter>
  28
+
  29
+			<meta-data
  30
+				android:name="android.appwidget.provider"
  31
+				android:resource="@xml/widget_provider"/>
  32
+		</receiver>
  33
+
  34
+		<activity
  35
+			android:name="ActivationActivity"
  36
+			android:theme="@android:style/Theme.NoDisplay">
  37
+			<intent-filter>
  38
+				<action android:name="android.intent.action.MAIN"/>
  39
+
  40
+				<category android:name="android.intent.category.LAUNCHER"/>
  41
+			</intent-filter>
  42
+		</activity>
  43
+	</application>
  44
+
  45
+</manifest>
17  AppWidget/Resize/ant.properties
... ...
@@ -0,0 +1,17 @@
  1
+# This file is used to override default values used by the Ant build system.
  2
+#
  3
+# This file must be checked in Version Control Systems, as it is
  4
+# integral to the build system of your project.
  5
+
  6
+# This file is only used by the Ant script.
  7
+
  8
+# You can use this to override default values such as
  9
+#  'source.dir' for the location of your java source folder and
  10
+#  'out.dir' for the location of your output folder.
  11
+
  12
+# You can also use it define how the release builds are signed by declaring
  13
+# the following properties:
  14
+#  'key.store' for the location of your keystore and
  15
+#  'key.alias' for the name of the key to use.
  16
+# The password will be asked during the build when you use the 'release' target.
  17
+
85  AppWidget/Resize/build.xml
... ...
@@ -0,0 +1,85 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<project name="PairOfDiceActivity" default="help">
  3
+
  4
+    <!-- The local.properties file is created and updated by the 'android' tool.
  5
+         It contains the path to the SDK. It should *NOT* be checked into
  6
+         Version Control Systems. -->
  7
+    <loadproperties srcFile="local.properties" />
  8
+
  9
+    <!-- The ant.properties file can be created by you. It is only edited by the
  10
+         'android' tool to add properties to it.
  11
+         This is the place to change some Ant specific build properties.
  12
+         Here are some properties you may want to change/update:
  13
+
  14
+         source.dir
  15
+             The name of the source directory. Default is 'src'.
  16
+         out.dir
  17
+             The name of the output directory. Default is 'bin'.
  18
+
  19
+         For other overridable properties, look at the beginning of the rules
  20
+         files in the SDK, at tools/ant/build.xml
  21
+
  22
+         Properties related to the SDK location or the project target should
  23
+         be updated using the 'android' tool with the 'update' action.
  24
+
  25
+         This file is an integral part of the build system for your
  26
+         application and should be checked into Version Control Systems.
  27
+
  28
+         -->
  29
+    <property file="ant.properties" />
  30
+
  31
+    <!-- The project.properties file is created and updated by the 'android'
  32
+         tool, as well as ADT.
  33
+
  34
+         This contains project specific properties such as project target, and library
  35
+         dependencies. Lower level build properties are stored in ant.properties
  36
+         (or in .classpath for Eclipse projects).
  37
+
  38
+         This file is an integral part of the build system for your
  39
+         application and should be checked into Version Control Systems. -->
  40
+    <loadproperties srcFile="project.properties" />
  41
+
  42
+    <!-- quick check on sdk.dir -->
  43
+    <fail
  44
+            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
  45
+            unless="sdk.dir"
  46
+    />
  47
+
  48
+
  49
+<!-- extension targets. Uncomment the ones where you want to do custom work
  50
+     in between standard targets -->
  51
+<!--
  52
+    <target name="-pre-build">
  53
+    </target>
  54
+    <target name="-pre-compile">
  55
+    </target>
  56
+
  57
+    /* This is typically used for code obfuscation.
  58
+       Compiled code location: ${out.classes.absolute.dir}
  59
+       If this is not done in place, override ${out.dex.input.absolute.dir} */
  60
+    <target name="-post-compile">
  61
+    </target>
  62
+-->
  63
+
  64
+    <!-- Import the actual build file.
  65
+
  66
+         To customize existing targets, there are two options:
  67
+         - Customize only one target:
  68
+             - copy/paste the target into this file, *before* the
  69
+               <import> task.
  70
+             - customize it to your needs.
  71
+         - Customize the whole content of build.xml
  72
+             - copy/paste the content of the rules files (minus the top node)
  73
+               into this file, replacing the <import> task.
  74
+             - customize to your needs.
  75
+
  76
+         ***********************
  77
+         ****** IMPORTANT ******
  78
+         ***********************
  79
+         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
  80
+         in order to avoid having your file be overridden by tools such as "android update project"
  81
+    -->
  82
+    <!-- version-tag: 1 -->
  83
+    <import file="${sdk.dir}/tools/ant/build.xml" />
  84
+
  85
+</project>
40  AppWidget/Resize/proguard.cfg
... ...
@@ -0,0 +1,40 @@
  1
+-optimizationpasses 5
  2
+-dontusemixedcaseclassnames
  3
+-dontskipnonpubliclibraryclasses
  4
+-dontpreverify
  5
+-verbose
  6
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
  7
+
  8
+-keep public class * extends android.app.Activity
  9
+-keep public class * extends android.app.Application
  10
+-keep public class * extends android.app.Service
  11
+-keep public class * extends android.content.BroadcastReceiver
  12
+-keep public class * extends android.content.ContentProvider
  13
+-keep public class * extends android.app.backup.BackupAgentHelper
  14
+-keep public class * extends android.preference.Preference
  15
+-keep public class com.android.vending.licensing.ILicensingService
  16
+
  17
+-keepclasseswithmembernames class * {
  18
+    native <methods>;
  19
+}
  20
+
  21
+-keepclasseswithmembers class * {
  22
+    public <init>(android.content.Context, android.util.AttributeSet);
  23
+}
  24
+
  25
+-keepclasseswithmembers class * {
  26
+    public <init>(android.content.Context, android.util.AttributeSet, int);
  27
+}
  28
+
  29
+-keepclassmembers class * extends android.app.Activity {
  30
+   public void *(android.view.View);
  31
+}
  32
+
  33
+-keepclassmembers enum * {
  34
+    public static **[] values();
  35
+    public static ** valueOf(java.lang.String);
  36
+}
  37
+
  38
+-keep class * implements android.os.Parcelable {
  39
+  public static final android.os.Parcelable$Creator *;
  40
+}
11  AppWidget/Resize/project.properties
... ...
@@ -0,0 +1,11 @@
  1
+# This file is automatically generated by Android Tools.
  2
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
  3
+#
  4
+# This file must be checked in Version Control Systems.
  5
+#
  6
+# To customize properties used by the Ant build system use,
  7
+# "ant.properties", and override values to adapt the script to your
  8
+# project structure.
  9
+
  10
+# Project target.
  11
+target=android-16
BIN  AppWidget/Resize/res/drawable-hdpi/ic_launcher.png
BIN  AppWidget/Resize/res/drawable-ldpi/ic_launcher.png
BIN  AppWidget/Resize/res/drawable-mdpi/ic_launcher.png
BIN  AppWidget/Resize/res/drawable-nodpi/widget_frame.9.png
BIN  AppWidget/Resize/res/drawable-xhdpi/ic_launcher.png
18  AppWidget/Resize/res/layout/widget.xml
... ...
@@ -0,0 +1,18 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3
+	android:id="@+id/background"
  4
+	android:layout_width="match_parent"
  5
+	android:layout_height="match_parent"
  6
+	android:background="@drawable/widget_frame"
  7
+	android:orientation="horizontal">
  8
+
  9
+	<TextView
  10
+		android:id="@+id/size"
  11
+		android:layout_width="wrap_content"
  12
+		android:layout_height="wrap_content"
  13
+		android:layout_centerInParent="true"
  14
+		android:textAppearance="?android:attr/textAppearanceMedium">
  15
+
  16
+	</TextView>
  17
+
  18
+</RelativeLayout>
4  AppWidget/Resize/res/values/strings.xml
... ...
@@ -0,0 +1,4 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<resources>
  3
+    <string name="app_name">Resize App Widget Demo</string>
  4
+</resources>
8  AppWidget/Resize/res/xml/widget_provider.xml
... ...
@@ -0,0 +1,8 @@
  1
+<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
  2
+  android:minWidth="180dip"
  3
+  android:minHeight="110dip"
  4
+  android:minResizeWidth="110dip"
  5
+  android:minResizeHeight="40dip"
  6
+  android:initialLayout="@layout/widget"
  7
+  android:resizeMode="horizontal|vertical"
  8
+/>
17  AppWidget/Resize/src/com/commonsware/android/appwidget/resize/ActivationActivity.java
... ...
@@ -0,0 +1,17 @@
  1
+package com.commonsware.android.appwidget.resize;
  2
+
  3
+import android.app.Activity;
  4
+import android.os.Bundle;
  5
+import android.widget.Toast;
  6
+
  7
+public class ActivationActivity extends Activity {
  8
+  @Override
  9
+  public void onCreate(Bundle savedInstanceState) {
  10
+    super.onCreate(savedInstanceState);
  11
+    
  12
+    Toast.makeText(this, "App widget ready to be added!",
  13
+                   Toast.LENGTH_LONG).show();
  14
+    
  15
+    finish();
  16
+  }
  17
+}
44  AppWidget/Resize/src/com/commonsware/android/appwidget/resize/AppWidget.java
... ...
@@ -0,0 +1,44 @@
  1
+/***
  2
+  Copyright (c) 2012 CommonsWare, LLC
  3
+  Licensed under the Apache License, Version 2.0 (the "License"); you may not
  4
+  use this file except in compliance with the License. You may obtain a copy
  5
+  of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
  6
+  by applicable law or agreed to in writing, software distributed under the
  7
+  License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
  8
+  OF ANY KIND, either express or implied. See the License for the specific
  9
+  language governing permissions and limitations under the License.
  10
+  
  11
+  From _The Busy Coder's Guide to Android Development_
  12
+    http://commonsware.com/Android
  13
+ */
  14
+
  15
+package com.commonsware.android.appwidget.resize;
  16
+
  17
+import android.appwidget.AppWidgetManager;
  18
+import android.appwidget.AppWidgetProvider;
  19
+import android.content.Context;
  20
+import android.os.Bundle;
  21
+import android.widget.RemoteViews;
  22
+import java.util.Locale;
  23
+
  24
+public class AppWidget extends AppWidgetProvider {
  25
+  @Override
  26
+  public void onAppWidgetOptionsChanged(Context ctxt,
  27
+                                        AppWidgetManager mgr,
  28
+                                        int appWidgetId,
  29
+                                        Bundle newOptions) {
  30
+    RemoteViews updateViews=
  31
+        new RemoteViews(ctxt.getPackageName(), R.layout.widget);
  32
+    String msg=
  33
+        String.format(Locale.getDefault(),
  34
+                      "[%d-%d] x [%d-%d]",
  35
+                      newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH),
  36
+                      newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH),
  37
+                      newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT),
  38
+                      newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT));
  39
+
  40
+    updateViews.setTextViewText(R.id.size, msg);
  41
+
  42
+    mgr.updateAppWidget(appWidgetId, updateViews);
  43
+  }
  44
+}
8  AppWidget/TwoOrThreeDice/.classpath
... ...
@@ -0,0 +1,8 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<classpath>
  3
+	<classpathentry kind="src" path="src"/>
  4
+	<classpathentry kind="src" path="gen"/>
  5
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
  6
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
  7
+	<classpathentry kind="output" path="bin/classes"/>
  8
+</classpath>
33  AppWidget/TwoOrThreeDice/.project
... ...
@@ -0,0 +1,33 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<projectDescription>
  3
+	<name>TwoOrThreeDice</name>
  4
+	<comment></comment>
  5
+	<projects>
  6
+	</projects>
  7
+	<buildSpec>
  8
+		<buildCommand>
  9
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
  10
+			<arguments>
  11
+			</arguments>
  12
+		</buildCommand>
  13
+		<buildCommand>
  14
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
  15
+			<arguments>
  16
+			</arguments>
  17
+		</buildCommand>
  18
+		<buildCommand>
  19
+			<name>org.eclipse.jdt.core.javabuilder</name>
  20
+			<arguments>
  21
+			</arguments>
  22
+		</buildCommand>
  23
+		<buildCommand>
  24
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
  25
+			<arguments>
  26
+			</arguments>
  27
+		</buildCommand>
  28
+	</buildSpec>
  29
+	<natures>
  30
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
  31
+		<nature>org.eclipse.jdt.core.javanature</nature>
  32
+	</natures>
  33
+</projectDescription>
43  AppWidget/TwoOrThreeDice/AndroidManifest.xml
... ...
@@ -0,0 +1,43 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3
+	package="com.commonsware.android.appwidget.dice"
  4
+	android:versionCode="1"
  5
+	android:versionName="1.0">
  6
+
  7
+	<uses-sdk
  8
+		android:minSdkVersion="7"
  9
+		android:targetSdkVersion="11"/>
  10
+
  11
+	<supports-screens
  12
+		android:largeScreens="true"
  13
+		android:normalScreens="true"
  14
+		android:smallScreens="false"/>
  15
+
  16
+	<application
  17
+		android:icon="@drawable/ic_launcher"
  18
+		android:label="@string/app_name">
  19
+		<receiver
  20
+			android:name=".AppWidget"
  21
+			android:icon="@drawable/cw"
  22
+			android:label="@string/app_name">
  23
+			<intent-filter>
  24
+				<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>