├── .gitignore ├── AndroidManifest.xml ├── README ├── build.properties ├── build.xml ├── default.properties ├── libs ├── gson-1.7.1.jar ├── guice-2.0-no_aop.jar └── roboguice-1.1.2.jar ├── proguard.cfg ├── res ├── drawable-es-hdpi │ └── icon.png ├── drawable-hdpi │ ├── clip_2.png │ ├── goods.png │ ├── groupon_logo.png │ ├── icon.png │ ├── square_clip.png │ ├── square_overlay.png │ ├── user_placeholder.png │ ├── vip_half_160.png │ ├── vip_half_240.png │ └── vip_half_320.png ├── drawable-ldpi │ └── icon.png ├── drawable-mdpi │ ├── getaway_ad.png │ ├── icon.png │ └── now_ad.png ├── drawable │ ├── count_bubble.xml │ ├── dark_button.xml │ ├── dark_button_dn.xml │ ├── dark_button_up.xml │ ├── drop_shadow.9.png │ ├── drop_shadow_root.xml │ ├── promo_bg.xml │ └── rounded_corners_white.xml ├── layout │ └── main.xml ├── values-de │ └── strings.xml ├── values-es │ └── strings.xml └── values │ ├── attrs.xml │ └── strings.xml └── src └── com └── example ├── ExampleApplication.java ├── ExampleModule.java ├── MainActivity.java ├── mappers ├── IJsonMapper.java └── JsonMapper.java ├── models └── Foo.java └── view ├── MaskedView.java └── RoundedCornerImage.java /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | gen/ 3 | out/ 4 | .DS_Store 5 | *.iws 6 | *.ipr 7 | *.iml 8 | *.ipr 9 | *.swp 10 | .idea/workspace.xml 11 | local.properties 12 | *.metadata 13 | .git/ 14 | cached-robolectric-classes.jar 15 | .settings 16 | .project 17 | .classpath 18 | target/ 19 | tmp/ 20 | .idea 21 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This repository houses various code samples for posts that are found on blog.donnfelker.com. 2 | 3 | Some examples include: 4 | 5 | - Rounded Corners with a drop shadow for LinearLayout 6 | - Count Bubble 7 | - GSON Mapping 8 | - and more -------------------------------------------------------------------------------- /build.properties: -------------------------------------------------------------------------------- 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 | 18 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 42 | 54 | 55 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /default.properties: -------------------------------------------------------------------------------- 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 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | -------------------------------------------------------------------------------- /libs/gson-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/libs/gson-1.7.1.jar -------------------------------------------------------------------------------- /libs/guice-2.0-no_aop.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/libs/guice-2.0-no_aop.jar -------------------------------------------------------------------------------- /libs/roboguice-1.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/libs/roboguice-1.1.2.jar -------------------------------------------------------------------------------- /proguard.cfg: -------------------------------------------------------------------------------- 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 ; 19 | } 20 | 21 | -keepclasseswithmembernames class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembernames class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers enum * { 30 | public static **[] values(); 31 | public static ** valueOf(java.lang.String); 32 | } 33 | 34 | -keep class * implements android.os.Parcelable { 35 | public static final android.os.Parcelable$Creator *; 36 | } 37 | -------------------------------------------------------------------------------- /res/drawable-es-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-es-hdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-hdpi/clip_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-hdpi/clip_2.png -------------------------------------------------------------------------------- /res/drawable-hdpi/goods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-hdpi/goods.png -------------------------------------------------------------------------------- /res/drawable-hdpi/groupon_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-hdpi/groupon_logo.png -------------------------------------------------------------------------------- /res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-hdpi/square_clip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-hdpi/square_clip.png -------------------------------------------------------------------------------- /res/drawable-hdpi/square_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-hdpi/square_overlay.png -------------------------------------------------------------------------------- /res/drawable-hdpi/user_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-hdpi/user_placeholder.png -------------------------------------------------------------------------------- /res/drawable-hdpi/vip_half_160.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-hdpi/vip_half_160.png -------------------------------------------------------------------------------- /res/drawable-hdpi/vip_half_240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-hdpi/vip_half_240.png -------------------------------------------------------------------------------- /res/drawable-hdpi/vip_half_320.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-hdpi/vip_half_320.png -------------------------------------------------------------------------------- /res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /res/drawable-mdpi/getaway_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-mdpi/getaway_ad.png -------------------------------------------------------------------------------- /res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-mdpi/now_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable-mdpi/now_ad.png -------------------------------------------------------------------------------- /res/drawable/count_bubble.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /res/drawable/dark_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 14 | 18 | -------------------------------------------------------------------------------- /res/drawable/dark_button_dn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /res/drawable/dark_button_up.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /res/drawable/drop_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donnfelker/AndroidCodeExamples/5b1b12e3b8f4a7814ef941dc9e739df1b1842cdb/res/drawable/drop_shadow.9.png -------------------------------------------------------------------------------- /res/drawable/drop_shadow_root.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /res/drawable/promo_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /res/drawable/rounded_corners_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 16 | 17 | 27 | 28 | 34 | 35 | 39 | 40 | 47 | 48 | 55 | 56 | 63 | 64 | 65 | 66 | 73 | 74 | 75 | 76 | 77 | 78 | 82 | 83 |