├── .gitignore ├── .travis.yml ├── LICENSE.txt ├── README.md ├── art ├── 1.fw.png ├── 2.fw.png ├── 3.fw.png ├── 4.fw.png ├── 5.fw.png ├── device_frame.png ├── feature.fw.png ├── generated │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── DFG_2014-03-29-11-06-29.png │ └── DFG_2014-03-29-11-06-31.png └── promo.fw.png ├── build.gradle ├── checkstyle.xml ├── deploy.sh ├── deploy_website.sh ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystore ├── proguard-rules.txt ├── src ├── debug │ ├── java │ │ └── com │ │ │ └── f2prateek │ │ │ └── dfg │ │ │ ├── DebugDFGApplicationModule.java │ │ │ ├── Modules.java │ │ │ ├── prefs │ │ │ ├── DebugPreferencesModule.java │ │ │ └── debug │ │ │ │ ├── AnimationSpeed.java │ │ │ │ ├── PicassoDebugging.java │ │ │ │ ├── PixelGridEnabled.java │ │ │ │ ├── PixelRatioEnabled.java │ │ │ │ ├── ScalpelEnabled.java │ │ │ │ ├── ScalpelWireframeEnabled.java │ │ │ │ └── SeenDebugDrawer.java │ │ │ └── ui │ │ │ ├── DebugUiModule.java │ │ │ ├── SocketActivityHierarchyServer.java │ │ │ └── debug │ │ │ ├── AnimationSpeedAdapter.java │ │ │ ├── ContextualDebugActions.java │ │ │ ├── DebugAppContainer.java │ │ │ └── HierarchyTreeChangeListener.java │ └── res │ │ ├── drawable-hdpi │ │ ├── debug_drawer_icon_edit.png │ │ ├── debug_drawer_shadow.9.png │ │ └── header_bg.9.png │ │ ├── drawable-mdpi │ │ ├── debug_drawer_icon_edit.png │ │ ├── debug_drawer_shadow.9.png │ │ └── header_bg.9.png │ │ ├── drawable-xhdpi │ │ ├── debug_drawer_icon_edit.png │ │ ├── debug_drawer_shadow.9.png │ │ └── header_bg.9.png │ │ ├── drawable-xxhdpi │ │ └── debug_drawer_icon_edit.png │ │ ├── layout │ │ ├── debug_activity_frame.xml │ │ ├── debug_drawer_content.xml │ │ └── debug_drawer_contextual_action.xml │ │ └── values │ │ ├── debug_strings.xml │ │ ├── debug_styles.xml │ │ └── titles.xml ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── f2prateek │ │ │ └── dfg │ │ │ ├── AnalyticsKey.java │ │ │ ├── AppConstants.java │ │ │ ├── DFGApplication.java │ │ │ ├── DFGApplicationModule.java │ │ │ ├── DeviceModule.java │ │ │ ├── DeviceProvider.java │ │ │ ├── Events.java │ │ │ ├── ForApplication.java │ │ │ ├── Utils.java │ │ │ ├── core │ │ │ ├── AbstractGenerateFrameService.java │ │ │ ├── DeviceFrameGenerator.java │ │ │ ├── GenerateFrameService.java │ │ │ └── GenerateMultipleFramesService.java │ │ │ ├── model │ │ │ ├── Bounds.java │ │ │ ├── Device.java │ │ │ └── Orientation.java │ │ │ ├── prefs │ │ │ ├── BackgroundBlurRadius.java │ │ │ ├── BackgroundColorOption.java │ │ │ ├── BackgroundPaddingPercentage.java │ │ │ ├── BlurBackgroundEnabled.java │ │ │ ├── ColorBackgroundEnabled.java │ │ │ ├── CustomBackgroundColor.java │ │ │ ├── DefaultDevice.java │ │ │ ├── FirstRun.java │ │ │ ├── GlareEnabled.java │ │ │ ├── PreferencesModule.java │ │ │ └── ShadowEnabled.java │ │ │ └── ui │ │ │ ├── ActivityHierarchyServer.java │ │ │ ├── AppContainer.java │ │ │ ├── BackgroundColorOptionAdapter.java │ │ │ ├── BindableAdapter.java │ │ │ ├── DeviceFragmentPagerAdapter.java │ │ │ ├── EnumAdapter.java │ │ │ ├── UiModule.java │ │ │ ├── activities │ │ │ ├── BaseActivity.java │ │ │ ├── MainActivity.java │ │ │ └── ReceiverActivity.java │ │ │ ├── fragments │ │ │ ├── AboutFragment.java │ │ │ ├── BaseFragment.java │ │ │ └── DeviceFragment.java │ │ │ └── widgets │ │ │ └── ForegroundImageView.java │ └── res │ │ ├── drawable-hdpi │ │ ├── app_icon.png │ │ ├── header_bg.9.png │ │ ├── ic_action_error.png │ │ ├── ic_action_info.png │ │ ├── ic_action_share.png │ │ ├── ic_action_star.png │ │ ├── ic_action_star_10.png │ │ ├── ic_action_star_selected.png │ │ └── ic_stat_app_notification.png │ │ ├── drawable-mdpi │ │ ├── app_icon.png │ │ ├── header_bg.9.png │ │ ├── ic_action_error.png │ │ ├── ic_action_info.png │ │ ├── ic_action_rate.png │ │ ├── ic_action_share.png │ │ ├── ic_action_star.png │ │ ├── ic_action_star_selected.png │ │ └── ic_stat_app_notification.png │ │ ├── drawable-nodpi │ │ ├── galaxy_nexus_land_back.png │ │ ├── galaxy_nexus_land_glare.png │ │ ├── galaxy_nexus_land_shadow.png │ │ ├── galaxy_nexus_port_back.png │ │ ├── galaxy_nexus_port_glare.png │ │ ├── galaxy_nexus_port_shadow.png │ │ ├── galaxy_nexus_thumb.png │ │ ├── htc_m7_land_back.png │ │ ├── htc_m7_land_glare.png │ │ ├── htc_m7_land_shadow.png │ │ ├── htc_m7_port_back.png │ │ ├── htc_m7_port_glare.png │ │ ├── htc_m7_port_shadow.png │ │ ├── htc_m7_thumb.png │ │ ├── htc_one_x_land_back.png │ │ ├── htc_one_x_land_glare.png │ │ ├── htc_one_x_land_shadow.png │ │ ├── htc_one_x_port_back.png │ │ ├── htc_one_x_port_glare.png │ │ ├── htc_one_x_port_shadow.png │ │ ├── htc_one_x_thumb.png │ │ ├── motox_land_back.png │ │ ├── motox_land_glare.png │ │ ├── motox_land_shadow.png │ │ ├── motox_port_back.png │ │ ├── motox_port_glare.png │ │ ├── motox_port_shadow.png │ │ ├── motox_thumb.png │ │ ├── nexus_10_land_back.png │ │ ├── nexus_10_land_glare.png │ │ ├── nexus_10_land_shadow.png │ │ ├── nexus_10_port_back.png │ │ ├── nexus_10_port_glare.png │ │ ├── nexus_10_port_shadow.png │ │ ├── nexus_10_thumb.png │ │ ├── nexus_4_land_back.png │ │ ├── nexus_4_land_glare.png │ │ ├── nexus_4_land_shadow.png │ │ ├── nexus_4_port_back.png │ │ ├── nexus_4_port_glare.png │ │ ├── nexus_4_port_shadow.png │ │ ├── nexus_4_thumb.png │ │ ├── nexus_5_land_back.png │ │ ├── nexus_5_land_glare.png │ │ ├── nexus_5_land_shadow.png │ │ ├── nexus_5_port_back.png │ │ ├── nexus_5_port_glare.png │ │ ├── nexus_5_port_shadow.png │ │ ├── nexus_5_thumb.png │ │ ├── nexus_5x_land_back.png │ │ ├── nexus_5x_land_glare.png │ │ ├── nexus_5x_land_shadow.png │ │ ├── nexus_5x_port_back.png │ │ ├── nexus_5x_port_glare.png │ │ ├── nexus_5x_port_shadow.png │ │ ├── nexus_5x_thumb.png │ │ ├── nexus_6_land_back.png │ │ ├── nexus_6_land_glare.png │ │ ├── nexus_6_land_shadow.png │ │ ├── nexus_6_port_back.png │ │ ├── nexus_6_port_glare.png │ │ ├── nexus_6_port_shadow.png │ │ ├── nexus_6_thumb.png │ │ ├── nexus_6p_land_back.png │ │ ├── nexus_6p_land_glare.png │ │ ├── nexus_6p_land_shadow.png │ │ ├── nexus_6p_port_back.png │ │ ├── nexus_6p_port_glare.png │ │ ├── nexus_6p_port_shadow.png │ │ ├── nexus_6p_thumb.png │ │ ├── nexus_7_2013_land_back.png │ │ ├── nexus_7_2013_land_glare.png │ │ ├── nexus_7_2013_land_shadow.png │ │ ├── nexus_7_2013_port_back.png │ │ ├── nexus_7_2013_port_glare.png │ │ ├── nexus_7_2013_port_shadow.png │ │ ├── nexus_7_2013_thumb.png │ │ ├── nexus_7_land_back.png │ │ ├── nexus_7_land_glare.png │ │ ├── nexus_7_land_shadow.png │ │ ├── nexus_7_port_back.png │ │ ├── nexus_7_port_glare.png │ │ ├── nexus_7_port_shadow.png │ │ ├── nexus_7_thumb.png │ │ ├── nexus_s_land_back.png │ │ ├── nexus_s_land_glare.png │ │ ├── nexus_s_land_shadow.png │ │ ├── nexus_s_port_back.png │ │ ├── nexus_s_port_glare.png │ │ ├── nexus_s_port_shadow.png │ │ ├── nexus_s_thumb.png │ │ ├── redmi_land_back.png │ │ ├── redmi_land_glare.png │ │ ├── redmi_land_shadow.png │ │ ├── redmi_port_back.png │ │ ├── redmi_port_glare.png │ │ ├── redmi_port_shadow.png │ │ ├── redmi_thumb.png │ │ ├── samsung_galaxy_note_land_back.png │ │ ├── samsung_galaxy_note_land_glare.png │ │ ├── samsung_galaxy_note_land_shadow.png │ │ ├── samsung_galaxy_note_port_back.png │ │ ├── samsung_galaxy_note_port_glare.png │ │ ├── samsung_galaxy_note_port_shadow.png │ │ ├── samsung_galaxy_note_thumb.png │ │ ├── samsung_galaxy_s3_land_back.png │ │ ├── samsung_galaxy_s3_land_glare.png │ │ ├── samsung_galaxy_s3_land_shadow.png │ │ ├── samsung_galaxy_s3_port_back.png │ │ ├── samsung_galaxy_s3_port_glare.png │ │ ├── samsung_galaxy_s3_port_shadow.png │ │ ├── samsung_galaxy_s3_thumb.png │ │ ├── samsung_galaxy_tab_2_7inch_land_back.png │ │ ├── samsung_galaxy_tab_2_7inch_land_glare.png │ │ ├── samsung_galaxy_tab_2_7inch_land_shadow.png │ │ ├── samsung_galaxy_tab_2_7inch_port_back.png │ │ ├── samsung_galaxy_tab_2_7inch_port_glare.png │ │ ├── samsung_galaxy_tab_2_7inch_port_shadow.png │ │ ├── samsung_galaxy_tab_2_7inch_thumb.png │ │ ├── xiaomi_mi2s_land_back.png │ │ ├── xiaomi_mi2s_land_glare.png │ │ ├── xiaomi_mi2s_land_shadow.png │ │ ├── xiaomi_mi2s_port_back.png │ │ ├── xiaomi_mi2s_port_glare.png │ │ ├── xiaomi_mi2s_port_shadow.png │ │ ├── xiaomi_mi2s_thumb.png │ │ ├── xiaomi_mi3_land_back.png │ │ ├── xiaomi_mi3_land_glare.png │ │ ├── xiaomi_mi3_land_shadow.png │ │ ├── xiaomi_mi3_port_back.png │ │ ├── xiaomi_mi3_port_glare.png │ │ ├── xiaomi_mi3_port_shadow.png │ │ ├── xiaomi_mi3_thumb.png │ │ ├── xiaomi_mi4b_land_back.png │ │ ├── xiaomi_mi4b_land_glare.png │ │ ├── xiaomi_mi4b_land_shadow.png │ │ ├── xiaomi_mi4b_port_back.png │ │ ├── xiaomi_mi4b_port_glare.png │ │ ├── xiaomi_mi4b_port_shadow.png │ │ ├── xiaomi_mi4b_thumb.png │ │ ├── xiaomi_mi4w_land_back.png │ │ ├── xiaomi_mi4w_land_glare.png │ │ ├── xiaomi_mi4w_land_shadow.png │ │ ├── xiaomi_mi4w_port_back.png │ │ ├── xiaomi_mi4w_port_glare.png │ │ ├── xiaomi_mi4w_port_shadow.png │ │ ├── xiaomi_mi4w_thumb.png │ │ ├── xiaomi_mi5_land_back.png │ │ ├── xiaomi_mi5_land_glare.png │ │ ├── xiaomi_mi5_land_shadow.png │ │ ├── xiaomi_mi5_port_back.png │ │ ├── xiaomi_mi5_port_glare.png │ │ ├── xiaomi_mi5_port_shadow.png │ │ ├── xiaomi_mi5_thumb.png │ │ ├── xiaomi_mi5s_land_back.png │ │ ├── xiaomi_mi5s_land_glare.png │ │ ├── xiaomi_mi5s_land_shadow.png │ │ ├── xiaomi_mi5s_port_back.png │ │ ├── xiaomi_mi5s_port_glare.png │ │ ├── xiaomi_mi5s_port_shadow.png │ │ ├── xiaomi_mi5s_thumb.png │ │ ├── xiaomi_mi6_land_back.png │ │ ├── xiaomi_mi6_land_glare.png │ │ ├── xiaomi_mi6_land_shadow.png │ │ ├── xiaomi_mi6_port_back.png │ │ ├── xiaomi_mi6_port_glare.png │ │ ├── xiaomi_mi6_port_shadow.png │ │ ├── xiaomi_mi6_thumb.png │ │ ├── xiaomi_mi6b_land_back.png │ │ ├── xiaomi_mi6b_land_glare.png │ │ ├── xiaomi_mi6b_land_shadow.png │ │ ├── xiaomi_mi6b_port_back.png │ │ ├── xiaomi_mi6b_port_glare.png │ │ ├── xiaomi_mi6b_port_shadow.png │ │ ├── xiaomi_mi6b_thumb.png │ │ ├── xiaomi_minoteb_land_back.png │ │ ├── xiaomi_minoteb_land_glare.png │ │ ├── xiaomi_minoteb_land_shadow.png │ │ ├── xiaomi_minoteb_port_back.png │ │ ├── xiaomi_minoteb_port_glare.png │ │ ├── xiaomi_minoteb_port_shadow.png │ │ ├── xiaomi_minoteb_thumb.png │ │ ├── xiaomi_minotew_land_back.png │ │ ├── xiaomi_minotew_land_glare.png │ │ ├── xiaomi_minotew_land_shadow.png │ │ ├── xiaomi_minotew_port_back.png │ │ ├── xiaomi_minotew_port_glare.png │ │ ├── xiaomi_minotew_port_shadow.png │ │ ├── xiaomi_minotew_thumb.png │ │ ├── xiaomi_mipad_land_back.png │ │ ├── xiaomi_mipad_land_glare.png │ │ ├── xiaomi_mipad_land_shadow.png │ │ ├── xiaomi_mipad_port_back.png │ │ ├── xiaomi_mipad_port_glare.png │ │ ├── xiaomi_mipad_port_shadow.png │ │ ├── xiaomi_mipad_thumb.png │ │ ├── xiaomi_note_land_back.png │ │ ├── xiaomi_note_land_glare.png │ │ ├── xiaomi_note_land_shadow.png │ │ ├── xiaomi_note_port_back.png │ │ ├── xiaomi_note_port_glare.png │ │ ├── xiaomi_note_port_shadow.png │ │ ├── xiaomi_note_thumb.png │ │ ├── xoom_land_back.png │ │ ├── xoom_land_glare.png │ │ ├── xoom_land_shadow.png │ │ ├── xoom_port_back.png │ │ ├── xoom_port_glare.png │ │ ├── xoom_port_shadow.png │ │ ├── xoom_thumb.png │ │ ├── xperia_z1_land_back.png │ │ ├── xperia_z1_land_glare.png │ │ ├── xperia_z1_land_shadow.png │ │ ├── xperia_z1_port_back.png │ │ ├── xperia_z1_port_glare.png │ │ ├── xperia_z1_port_shadow.png │ │ └── xperia_z1_thumb.png │ │ ├── drawable-xhdpi │ │ ├── app_icon.png │ │ ├── header_bg.9.png │ │ ├── ic_action_error.png │ │ ├── ic_action_info.png │ │ ├── ic_action_share.png │ │ ├── ic_action_star.png │ │ ├── ic_action_star_10.png │ │ ├── ic_action_star_selected.png │ │ └── ic_stat_app_notification.png │ │ ├── drawable-xxhdpi │ │ ├── app_icon.png │ │ ├── ic_action_star_10.png │ │ └── ic_stat_app_notification.png │ │ ├── drawable │ │ └── app_icon_256.png │ │ ├── layout-land │ │ └── fragment_device.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── fragment_about.xml │ │ └── fragment_device.xml │ │ ├── menu │ │ └── activity_main.xml │ │ ├── values-cs │ │ └── strings.xml │ │ ├── values-sk │ │ └── strings.xml │ │ ├── values-v16 │ │ └── styles.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ ├── styles.xml │ │ └── theme.xml └── release │ ├── java │ └── com │ │ └── f2prateek │ │ └── dfg │ │ └── Modules.java │ └── res │ └── values │ └── titles.xml └── website ├── index.html └── static ├── app-theme.css ├── app.css ├── bootstrap-combined.min.css ├── bootstrap.min.js ├── html5shiv.min.js ├── icon-github.png ├── icon.png ├── jquery.smooth-scroll.min.js ├── prettify.js └── screenshot.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by http://gitignore.io 2 | 3 | ### Android ### 4 | # built application files 5 | *.apk 6 | *.ap_ 7 | 8 | # files for the dex VM 9 | *.dex 10 | 11 | # Java class files 12 | *.class 13 | 14 | # generated files 15 | bin/ 16 | gen/ 17 | 18 | # Local configuration file (sdk path, etc) 19 | local.properties 20 | 21 | # Eclipse project files 22 | .classpath 23 | .project 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Proguard folder generated by Intellij 29 | proguard_logs/ 30 | 31 | # Intellij project files 32 | *.iml 33 | *.ipr 34 | *.iws 35 | .idea/ 36 | 37 | adt-bundle-windows-x86_64/ 38 | 39 | ### Java ### 40 | *.class 41 | 42 | # Package Files # 43 | *.war 44 | *.ear 45 | 46 | ### Gradle ### 47 | # Exclude Folder List # 48 | .gradle/ 49 | build/ 50 | .gradletasknamecache 51 | 52 | ### Spoon ### 53 | target/ 54 | 55 | ### IntelliJ ### 56 | *.iml 57 | *.ipr 58 | *.iws 59 | .idea/ 60 | 61 | ### OSX ### 62 | .DS_Store 63 | .AppleDouble 64 | .LSOverride 65 | Icon 66 | 67 | 68 | # Thumbnails 69 | ._* 70 | 71 | # Files that might appear on external disk 72 | .Spotlight-V100 73 | .Trashes 74 | 75 | ### Windows ### 76 | # Windows image file caches 77 | Thumbs.db 78 | ehthumbs.db 79 | 80 | # Folder config file 81 | Desktop.ini 82 | 83 | # Recycle Bin used on file shares 84 | $RECYCLE.BIN/ 85 | 86 | ### Eclipse ### 87 | *.pydevproject 88 | .project 89 | .metadata 90 | bin/** 91 | tmp/** 92 | tmp/**/* 93 | *.tmp 94 | *.bak 95 | *.swp 96 | *~.nib 97 | local.properties 98 | .classpath 99 | .settings/ 100 | .loadpath 101 | 102 | # External tool builders 103 | .externalToolBuilders/ 104 | 105 | # Locally stored "Eclipse launch configurations" 106 | *.launch 107 | 108 | # CDT-specific 109 | .cproject 110 | 111 | # PDT-specific 112 | .buildpath 113 | 114 | #Sensitive data 115 | app/keystore 116 | crashlytics.properties 117 | signing.properties 118 | com_crashlytics_export_strings.xml -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | 3 | android: 4 | components: 5 | - build-tools-23.0.1 6 | - extra-android-m2repository 7 | - extra-google-m2repository 8 | - android-22 9 | licenses: 10 | - android-sdk-license-5be876d5 11 | 12 | jdk: 13 | # - oraclejdk7 14 | - oraclejdk8 15 | 16 | script: 17 | - ./gradlew clean check 18 | 19 | branches: 20 | except: 21 | - gh-pages 22 | 23 | notifications: 24 | email: false 25 | 26 | sudo: false 27 | 28 | cache: 29 | directories: 30 | - $HOME/.gradle -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Device Frame Generator 2 | ======================= 3 | 4 | Wrap your app screenshots in real device artwork. For more information, see the [website](http://f2prateek.com/device-frame-generator). 5 | 6 | Adding Devices 7 | -------------- 8 | 9 | To add new devices, you'll need to add 7 images in the [`app/src/main/res/drawable-nodpi`](https://github.com/f2prateek/device-frame-generator/tree/master/app/src/main/res/drawable-nodpi): 10 | * `device_land_back` 11 | * `device_land_glare` 12 | * `device_land_shadow` 13 | * `device_port_back` 14 | * `device_port_glare` 15 | * `device_port_shadow` 16 | * `device_thumb` 17 | 18 | All these should be in the png format and named as above - with `device` replaced with a key that will identify this set of frames. 19 | Once that's done, simply add the metadata in [`DeviceModule.java`](https://github.com/f2prateek/device-frame-generator/blob/master/app/src/main/java/com/f2prateek/dfg/DeviceModule.java) located at `app/src/main/java/com/f2prateek/dfg/DeviceModule.java`. 20 | Here's what an example for the Nexus 5 would look like. 21 | 22 | ```java 23 | @Provides(type = SET) Device provideNexus5() { 24 | return new Device.Builder().setId("nexus_5") 25 | .setName("Nexus 5") 26 | .setUrl("http://www.google.com/nexus/5/") 27 | .setPhysicalSize(5.43f) 28 | .setDensity("XXHDPI") 29 | .setLandOffset(436, 306) 30 | .setPortOffset(306, 436) 31 | .setPortSize(1080, 1920) 32 | .setRealSize(1080, 1920) 33 | .addProductId("hammerhead") 34 | .build(); 35 | } 36 | ``` 37 | 38 | You can see what the metadata fields mean at [`Device.java`](https://github.com/f2prateek/device-frame-generator/blob/master/app/src/main/java/com/f2prateek/dfg/model/Device.java#L27) 39 | 40 | Building 41 | --------- 42 | Simply execute `./gradlew clean build`. 43 | 44 | [![Build Status](https://travis-ci.org/f2prateek/device-frame-generator.png)](https://travis-ci.org/f2prateek/device-frame-generator) 45 | 46 | [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Device%20Frame%20Generator-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1493) 47 | -------------------------------------------------------------------------------- /art/1.fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/1.fw.png -------------------------------------------------------------------------------- /art/2.fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/2.fw.png -------------------------------------------------------------------------------- /art/3.fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/3.fw.png -------------------------------------------------------------------------------- /art/4.fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/4.fw.png -------------------------------------------------------------------------------- /art/5.fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/5.fw.png -------------------------------------------------------------------------------- /art/device_frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/device_frame.png -------------------------------------------------------------------------------- /art/feature.fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/feature.fw.png -------------------------------------------------------------------------------- /art/generated/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/generated/1.png -------------------------------------------------------------------------------- /art/generated/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/generated/2.png -------------------------------------------------------------------------------- /art/generated/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/generated/3.png -------------------------------------------------------------------------------- /art/generated/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/generated/4.png -------------------------------------------------------------------------------- /art/generated/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/generated/5.png -------------------------------------------------------------------------------- /art/generated/DFG_2014-03-29-11-06-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/generated/DFG_2014-03-29-11-06-29.png -------------------------------------------------------------------------------- /art/generated/DFG_2014-03-29-11-06-31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/generated/DFG_2014-03-29-11-06-31.png -------------------------------------------------------------------------------- /art/promo.fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/art/promo.fw.png -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # MANUAL : Bump version numbers in manifest, update build tools in build.gradle 4 | ./gradlew clean check spoon 5 | 6 | ./gradlew clean build 7 | 8 | # Generate a changelog 9 | github-changes -o f2prateek -r android-device-frame-generator -a -d commits 10 | 11 | # Deploy website 12 | ./deploy_website.sh 13 | 14 | # MANUAL : Upload apk to Google Play 15 | -------------------------------------------------------------------------------- /deploy_website.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | REPO="git@github.com:f2prateek/android-device-frame-generator.git" 6 | 7 | DIR=temp-clone 8 | 9 | # Delete any existing temporary website clone 10 | rm -rf $DIR 11 | 12 | # Clone the current repo into temp folder 13 | git clone $REPO $DIR 14 | 15 | # Move working directory into temp folder 16 | cd $DIR 17 | 18 | # Checkout and track the gh-pages branch 19 | git checkout -t origin/gh-pages 20 | 21 | # Delete everything 22 | rm -rf * 23 | 24 | # Copy website files from real repo 25 | cp -R ../website/* . 26 | 27 | # Stage all files in git and create a commit 28 | git add . 29 | git add -u 30 | git commit -m "Website at $(date)" 31 | 32 | # Push the new files up to GitHub 33 | git push origin gh-pages 34 | 35 | # Delete our temp folder 36 | cd .. 37 | rm -rf $DIR 38 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Dec 25 00:52:03 PST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/keystore -------------------------------------------------------------------------------- /proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/22.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | -keep class javax.inject.* 20 | 21 | -dontwarn com.squareup.okhttp.** 22 | 23 | -dontwarn dagger.internal.codegen.** 24 | -keepclassmembers,allowobfuscation class * { 25 | @javax.inject.* *; 26 | @dagger.* *; 27 | (); 28 | } 29 | -keep class dagger.* { *; } 30 | -keep class javax.inject.* { *; } 31 | -keep class * extends dagger.internal.Binding 32 | -keep class * extends dagger.internal.ModuleAdapter 33 | -keep class * extends dagger.internal.StaticInjection 34 | 35 | -keepclassmembers class ** { 36 | @com.squareup.otto.Subscribe public *; 37 | @com.squareup.otto.Produce public *; 38 | } 39 | 40 | -dontwarn butterknife.internal.** 41 | -keep class **$$ViewInjector { *; } 42 | -keepnames class * { @butterknife.InjectView *;} 43 | 44 | -dontwarn com.f2prateek.dart.internal.** 45 | -keep class **$$ExtraInjector { *; } 46 | -keepnames class * { @com.f2prateek.dart.InjectView *;} -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/DebugDFGApplicationModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg; 18 | 19 | import android.content.Context; 20 | import com.f2prateek.dfg.prefs.DebugPreferencesModule; 21 | import com.f2prateek.dfg.ui.DebugUiModule; 22 | import com.segment.analytics.Analytics; 23 | import dagger.Module; 24 | import dagger.Provides; 25 | import javax.inject.Singleton; 26 | 27 | @Module( 28 | addsTo = DFGApplicationModule.class, 29 | includes = { 30 | DebugUiModule.class, DebugPreferencesModule.class 31 | }, 32 | overrides = true // 33 | ) 34 | public final class DebugDFGApplicationModule { 35 | 36 | @Provides @Singleton @AnalyticsKey String provideAnalyticsKey() { 37 | return "5UsMbFwbXy"; 38 | } 39 | 40 | @Provides @Singleton // 41 | Analytics provideAnalytics(@ForApplication Context context, @AnalyticsKey String key) { 42 | return new Analytics.Builder(context, key).logLevel(Analytics.LogLevel.BASIC).build(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/Modules.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg; 18 | 19 | public class Modules { 20 | static Object[] list(final DFGApplication application) { 21 | return new Object[] { 22 | new DFGApplicationModule(application), new DebugDFGApplicationModule() 23 | }; 24 | } 25 | } -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/prefs/DebugPreferencesModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg.prefs; 18 | 19 | import com.f2prateek.dfg.prefs.debug.AnimationSpeed; 20 | import com.f2prateek.dfg.prefs.debug.PicassoDebugging; 21 | import com.f2prateek.dfg.prefs.debug.PixelGridEnabled; 22 | import com.f2prateek.dfg.prefs.debug.PixelRatioEnabled; 23 | import com.f2prateek.dfg.prefs.debug.ScalpelEnabled; 24 | import com.f2prateek.dfg.prefs.debug.ScalpelWireframeEnabled; 25 | import com.f2prateek.dfg.prefs.debug.SeenDebugDrawer; 26 | import com.f2prateek.rx.preferences.Preference; 27 | import com.f2prateek.rx.preferences.RxSharedPreferences; 28 | import dagger.Module; 29 | import dagger.Provides; 30 | import javax.inject.Singleton; 31 | 32 | @Module(complete = false, library = true) public class DebugPreferencesModule { 33 | private static final int DEFAULT_ANIMATION_SPEED = 1; // 1x (normal) speed. 34 | private static final boolean DEFAULT_PICASSO_DEBUGGING = false; // Debug indicators displayed 35 | private static final boolean DEFAULT_PIXEL_GRID_ENABLED = false; // No pixel grid overlay. 36 | private static final boolean DEFAULT_PIXEL_RATIO_ENABLED = false; // No pixel ratio overlay. 37 | private static final boolean DEFAULT_SCALPEL_ENABLED = false; // No crazy 3D view tree. 38 | private static final boolean DEFAULT_SCALPEL_WIREFRAME_ENABLED = false; // Draw views by default. 39 | private static final boolean DEFAULT_SEEN_DEBUG_DRAWER = false; // Show debug drawer first time. 40 | 41 | @Provides @Singleton @AnimationSpeed // 42 | Preference provideAnimationSpeed(RxSharedPreferences preferences) { 43 | return preferences.getInteger("debug_animation_speed", DEFAULT_ANIMATION_SPEED); 44 | } 45 | 46 | @Provides @Singleton @PicassoDebugging // 47 | Preference providePicassoDebugging(RxSharedPreferences preferences) { 48 | return preferences.getBoolean("debug_picasso_debugging", DEFAULT_PICASSO_DEBUGGING); 49 | } 50 | 51 | @Provides @Singleton @PixelGridEnabled // 52 | Preference providePixelGridEnabled(RxSharedPreferences preferences) { 53 | return preferences.getBoolean("debug_pixel_grid_enabled", DEFAULT_PIXEL_GRID_ENABLED); 54 | } 55 | 56 | @Provides @Singleton @PixelRatioEnabled // 57 | Preference providePixelRatioEnabled(RxSharedPreferences preferences) { 58 | return preferences.getBoolean("debug_pixel_ratio_enabled", DEFAULT_PIXEL_RATIO_ENABLED); 59 | } 60 | 61 | @Provides @Singleton @SeenDebugDrawer // 62 | Preference provideSeenDebugDrawer(RxSharedPreferences preferences) { 63 | return preferences.getBoolean("debug_seen_debug_drawer", DEFAULT_SEEN_DEBUG_DRAWER); 64 | } 65 | 66 | @Provides @Singleton @ScalpelEnabled // 67 | Preference provideScalpelEnabled(RxSharedPreferences preferences) { 68 | return preferences.getBoolean("debug_scalpel_enabled", DEFAULT_SCALPEL_ENABLED); 69 | } 70 | 71 | @Provides @Singleton @ScalpelWireframeEnabled // 72 | Preference provideScalpelWireframeEnabled(RxSharedPreferences preferences) { 73 | return preferences.getBoolean("debug_scalpel_wireframe_drawer", 74 | DEFAULT_SCALPEL_WIREFRAME_ENABLED); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/prefs/debug/AnimationSpeed.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg.prefs.debug; 18 | 19 | import java.lang.annotation.Retention; 20 | import javax.inject.Qualifier; 21 | 22 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 23 | 24 | @Qualifier @Retention(RUNTIME) 25 | public @interface AnimationSpeed { 26 | } 27 | -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/prefs/debug/PicassoDebugging.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg.prefs.debug; 18 | 19 | import java.lang.annotation.Retention; 20 | import javax.inject.Qualifier; 21 | 22 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 23 | 24 | @Qualifier @Retention(RUNTIME) 25 | public @interface PicassoDebugging { 26 | } 27 | -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/prefs/debug/PixelGridEnabled.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg.prefs.debug; 18 | 19 | import java.lang.annotation.Retention; 20 | import javax.inject.Qualifier; 21 | 22 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 23 | 24 | @Qualifier @Retention(RUNTIME) 25 | public @interface PixelGridEnabled { 26 | } 27 | -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/prefs/debug/PixelRatioEnabled.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg.prefs.debug; 18 | 19 | import java.lang.annotation.Retention; 20 | import javax.inject.Qualifier; 21 | 22 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 23 | 24 | @Qualifier @Retention(RUNTIME) 25 | public @interface PixelRatioEnabled { 26 | } 27 | -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/prefs/debug/ScalpelEnabled.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg.prefs.debug; 18 | 19 | import java.lang.annotation.Retention; 20 | import javax.inject.Qualifier; 21 | 22 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 23 | 24 | @Qualifier @Retention(RUNTIME) 25 | public @interface ScalpelEnabled { 26 | } 27 | -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/prefs/debug/ScalpelWireframeEnabled.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg.prefs.debug; 18 | 19 | import java.lang.annotation.Retention; 20 | import javax.inject.Qualifier; 21 | 22 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 23 | 24 | @Qualifier @Retention(RUNTIME) 25 | public @interface ScalpelWireframeEnabled { 26 | } 27 | -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/prefs/debug/SeenDebugDrawer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg.prefs.debug; 18 | 19 | import java.lang.annotation.Retention; 20 | import javax.inject.Qualifier; 21 | 22 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 23 | 24 | @Qualifier @Retention(RUNTIME) 25 | public @interface SeenDebugDrawer { 26 | } 27 | -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/ui/DebugUiModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg.ui; 18 | 19 | import com.f2prateek.dfg.ui.debug.DebugAppContainer; 20 | import dagger.Module; 21 | import dagger.Provides; 22 | import javax.inject.Singleton; 23 | 24 | @Module( 25 | injects = DebugAppContainer.class, 26 | complete = false, 27 | library = true, 28 | overrides = true) 29 | public class DebugUiModule { 30 | @Provides @Singleton AppContainer provideAppContainer(DebugAppContainer debugAppContainer) { 31 | return debugAppContainer; 32 | } 33 | 34 | @Provides @Singleton ActivityHierarchyServer provideActivityHierarchyServer() { 35 | return new SocketActivityHierarchyServer(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/ui/debug/AnimationSpeedAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg.ui.debug; 18 | 19 | import android.content.Context; 20 | import android.view.LayoutInflater; 21 | import android.view.View; 22 | import android.view.ViewGroup; 23 | import android.widget.TextView; 24 | import com.f2prateek.dfg.ui.BindableAdapter; 25 | 26 | import static butterknife.ButterKnife.findById; 27 | 28 | class AnimationSpeedAdapter extends BindableAdapter { 29 | private static final int[] VALUES = { 30 | 1, 2, 3, 5, 10 31 | }; 32 | 33 | public static int getPositionForValue(int value) { 34 | for (int i = 0; i < VALUES.length; i++) { 35 | if (VALUES[i] == value) { 36 | return i; 37 | } 38 | } 39 | return 0; // Default to 1x if something changes. 40 | } 41 | 42 | AnimationSpeedAdapter(Context context) { 43 | super(context); 44 | } 45 | 46 | @Override public int getCount() { 47 | return VALUES.length; 48 | } 49 | 50 | @Override public Integer getItem(int position) { 51 | return VALUES[position]; 52 | } 53 | 54 | @Override public long getItemId(int position) { 55 | return position; 56 | } 57 | 58 | @Override public View newView(LayoutInflater inflater, int position, ViewGroup container) { 59 | return inflater.inflate(android.R.layout.simple_spinner_item, container, false); 60 | } 61 | 62 | @Override public void bindView(Integer item, int position, View view) { 63 | TextView tv = findById(view, android.R.id.text1); 64 | if (item == 1) { 65 | tv.setText("Normal"); 66 | } else { 67 | tv.setText(item + "x slower"); 68 | } 69 | } 70 | 71 | @Override 72 | public View newDropDownView(LayoutInflater inflater, int position, ViewGroup container) { 73 | return inflater.inflate(android.R.layout.simple_spinner_dropdown_item, container, false); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/debug/java/com/f2prateek/dfg/ui/debug/HierarchyTreeChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Prateek Srivastava (@f2prateek) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.f2prateek.dfg.ui.debug; 18 | 19 | import android.view.View; 20 | import android.view.ViewGroup; 21 | 22 | /** 23 | * A {@link android.view.ViewGroup.OnHierarchyChangeListener hierarchy change listener} which 24 | * recursively 25 | * monitors an entire tree of views. 26 | */ 27 | public final class HierarchyTreeChangeListener implements ViewGroup.OnHierarchyChangeListener { 28 | /** 29 | * Wrap a regular 30 | * {@link android.view.ViewGroup.OnHierarchyChangeListener hierarchy change listener} with one 31 | * that monitors an entire tree of views. 32 | */ 33 | public static HierarchyTreeChangeListener wrap(ViewGroup.OnHierarchyChangeListener delegate) { 34 | return new HierarchyTreeChangeListener(delegate); 35 | } 36 | 37 | private final ViewGroup.OnHierarchyChangeListener delegate; 38 | 39 | private HierarchyTreeChangeListener(ViewGroup.OnHierarchyChangeListener delegate) { 40 | if (delegate == null) { 41 | throw new NullPointerException("Delegate must not be null."); 42 | } 43 | this.delegate = delegate; 44 | } 45 | 46 | @Override public void onChildViewAdded(View parent, View child) { 47 | delegate.onChildViewAdded(parent, child); 48 | 49 | if (child instanceof ViewGroup) { 50 | ViewGroup childGroup = (ViewGroup) child; 51 | childGroup.setOnHierarchyChangeListener(this); 52 | for (int i = 0; i < childGroup.getChildCount(); i++) { 53 | onChildViewAdded(childGroup, childGroup.getChildAt(i)); 54 | } 55 | } 56 | } 57 | 58 | @Override public void onChildViewRemoved(View parent, View child) { 59 | if (child instanceof ViewGroup) { 60 | ViewGroup childGroup = (ViewGroup) child; 61 | for (int i = 0; i < childGroup.getChildCount(); i++) { 62 | onChildViewRemoved(childGroup, childGroup.getChildAt(i)); 63 | } 64 | childGroup.setOnHierarchyChangeListener(null); 65 | } 66 | 67 | delegate.onChildViewRemoved(parent, child); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/debug/res/drawable-hdpi/debug_drawer_icon_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/src/debug/res/drawable-hdpi/debug_drawer_icon_edit.png -------------------------------------------------------------------------------- /src/debug/res/drawable-hdpi/debug_drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/src/debug/res/drawable-hdpi/debug_drawer_shadow.9.png -------------------------------------------------------------------------------- /src/debug/res/drawable-hdpi/header_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/src/debug/res/drawable-hdpi/header_bg.9.png -------------------------------------------------------------------------------- /src/debug/res/drawable-mdpi/debug_drawer_icon_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/src/debug/res/drawable-mdpi/debug_drawer_icon_edit.png -------------------------------------------------------------------------------- /src/debug/res/drawable-mdpi/debug_drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/src/debug/res/drawable-mdpi/debug_drawer_shadow.9.png -------------------------------------------------------------------------------- /src/debug/res/drawable-mdpi/header_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/src/debug/res/drawable-mdpi/header_bg.9.png -------------------------------------------------------------------------------- /src/debug/res/drawable-xhdpi/debug_drawer_icon_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/src/debug/res/drawable-xhdpi/debug_drawer_icon_edit.png -------------------------------------------------------------------------------- /src/debug/res/drawable-xhdpi/debug_drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/src/debug/res/drawable-xhdpi/debug_drawer_shadow.9.png -------------------------------------------------------------------------------- /src/debug/res/drawable-xhdpi/header_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/src/debug/res/drawable-xhdpi/header_bg.9.png -------------------------------------------------------------------------------- /src/debug/res/drawable-xxhdpi/debug_drawer_icon_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f2prateek/device-frame-generator/22d82553a023ee770229bc2b1c85b9623eb7c140/src/debug/res/drawable-xxhdpi/debug_drawer_icon_edit.png -------------------------------------------------------------------------------- /src/debug/res/layout/debug_activity_frame.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 24 | 29 | 34 | 35 | 42 | 43 | -------------------------------------------------------------------------------- /src/debug/res/layout/debug_drawer_contextual_action.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 |