From a52ae96b32ec1cdd6535733a7deafed9860c819b Mon Sep 17 00:00:00 2001 From: Mantas Palaima Date: Sun, 27 Dec 2015 16:24:05 +0200 Subject: [PATCH] Refactoring All resources with dd prefixes Use provided invested of compile for external dependencies --- app/build.gradle | 6 +- .../app/DebugDrawerApplication.java | 3 +- .../debugdrawer/app/DebugViewActivity.java | 42 ++-- .../palaima/debugdrawer/app/ImageAdapter.java | 10 +- .../palaima/debugdrawer/app/MainActivity.java | 46 ++-- .../main/res/layout/activity_debugview.xml | 2 +- build.gradle | 2 +- debugdrawer-actions/build.gradle | 1 - .../debugdrawer/actions/ActionsModule.java | 5 +- .../debugdrawer/actions/ButtonAction.java | 2 +- .../debugdrawer/actions/SpinnerAction.java | 4 +- .../debugdrawer/actions/SwitchAction.java | 9 +- ...xml => dd_debug_drawer_module_actions.xml} | 0 ...ug_drawer_module_actions_spinner_item.xml} | 0 .../src/main/res/values/colors.xml | 4 - .../src/main/res/values/dimens.xml | 8 +- ....9.png => dd_debug_drawer_header_bg.9.png} | Bin ....9.png => dd_debug_drawer_header_bg.9.png} | Bin ....9.png => dd_debug_drawer_header_bg.9.png} | Bin .../src/main/res/values/styles.xml | 2 +- .../debugdrawer/commons/BuildModule.java | 8 +- .../debugdrawer/commons/DeviceModule.java | 14 +- .../debugdrawer/commons/NetworkModule.java | 8 +- .../debugdrawer/commons/SettingsModule.java | 26 +-- ...g => dd_ic_battery_unknown_white_24dp.png} | Bin ...e_24dp.png => dd_ic_delete_white_24dp.png} | Bin ...ng => dd_ic_developer_mode_white_24dp.png} | Bin ....png => dd_ic_info_outline_white_24dp.png} | Bin ...p.png => dd_ic_location_on_white_24dp.png} | Bin ...24dp.png => dd_ic_settings_white_24dp.png} | Bin ...g => dd_ic_battery_unknown_white_24dp.png} | Bin ...e_24dp.png => dd_ic_delete_white_24dp.png} | Bin ...ng => dd_ic_developer_mode_white_24dp.png} | Bin ....png => dd_ic_info_outline_white_24dp.png} | Bin ...p.png => dd_ic_location_on_white_24dp.png} | Bin ...24dp.png => dd_ic_settings_white_24dp.png} | Bin ...g => dd_ic_battery_unknown_white_24dp.png} | Bin ...e_24dp.png => dd_ic_delete_white_24dp.png} | Bin ...ng => dd_ic_developer_mode_white_24dp.png} | Bin ....png => dd_ic_info_outline_white_24dp.png} | Bin ...p.png => dd_ic_location_on_white_24dp.png} | Bin ...24dp.png => dd_ic_settings_white_24dp.png} | Bin ...g => dd_ic_battery_unknown_white_24dp.png} | Bin ...e_24dp.png => dd_ic_delete_white_24dp.png} | Bin ...ng => dd_ic_developer_mode_white_24dp.png} | Bin ....png => dd_ic_info_outline_white_24dp.png} | Bin ...p.png => dd_ic_location_on_white_24dp.png} | Bin ...24dp.png => dd_ic_settings_white_24dp.png} | Bin ...g => dd_ic_battery_unknown_white_24dp.png} | Bin ...e_24dp.png => dd_ic_delete_white_24dp.png} | Bin ...ng => dd_ic_developer_mode_white_24dp.png} | Bin ....png => dd_ic_info_outline_white_24dp.png} | Bin ...p.png => dd_ic_location_on_white_24dp.png} | Bin ...24dp.png => dd_ic_settings_white_24dp.png} | Bin ...d.xml => dd_debug_drawer_module_build.xml} | 6 +- ....xml => dd_debug_drawer_module_device.xml} | 12 +- ...xml => dd_debug_drawer_module_network.xml} | 6 +- ...ml => dd_debug_drawer_module_settings.xml} | 36 +-- debugdrawer-fps/build.gradle | 3 +- .../io/palaima/debugdrawer/fps/FpsModule.java | 23 +- ...m_fps.xml => dd_debug_drawer_item_fps.xml} | 2 +- debugdrawer-location/build.gradle | 2 +- .../debugdrawer/location/LocationModule.java | 63 ++++-- ...hite_24dp.png => dd_ic_map_white_24dp.png} | Bin ...hite_24dp.png => dd_ic_map_white_24dp.png} | Bin ...hite_24dp.png => dd_ic_map_white_24dp.png} | Bin ...hite_24dp.png => dd_ic_map_white_24dp.png} | Bin ...hite_24dp.png => dd_ic_map_white_24dp.png} | Bin ...ml => dd_debug_drawer_module_location.xml} | 14 +- .../src/main/res/values/strings.xml | 12 +- .../src/main/res/values/colors.xml | 10 - debugdrawer-no-op/build.gradle | 1 + .../io/palaima/debugdrawer/DebugDrawer.java | 14 ++ debugdrawer-okhttp/build.gradle | 3 +- .../debugdrawer/okhttp/OkHttpModule.java | 60 +++-- ....xml => dd_debug_drawer_module_okhttp.xml} | 10 +- debugdrawer-picasso/build.gradle | 3 +- .../debugdrawer/picasso/PicassoModule.java | 98 ++++---- ...o.xml => dd_debug_drawer_item_picasso.xml} | 20 +- debugdrawer-scalpel/build.gradle | 3 +- .../debugdrawer/scalpel/ScalpelModule.java | 39 +++- ...l.xml => dd_debug_drawer_item_scalpel.xml} | 6 +- .../.gitignore | 0 .../build.gradle | 4 +- .../gradle.properties | 0 .../src/main/AndroidManifest.xml | 2 +- .../debugdrawer/timber/TimberModule.java | 10 +- .../debugdrawer/timber}/data/LumberYard.java | 50 ++++- .../debugdrawer/timber}/model/LogEntry.java | 30 +-- .../debugdrawer/timber}/ui/LogAdapter.java | 24 +- .../debugdrawer/timber}/ui/LogDialog.java | 23 +- .../debugdrawer/timber}/util/Intents.java | 2 +- .../res/layout/dd_debug_drawer_module_log.xml | 4 +- .../src/main/res/layout/dd_item_log_entry.xml | 18 +- .../src/main/res/values/colors.xml | 10 + .../palaima/debugdrawer/view/DebugView.java | 26 +-- .../io/palaima/debugdrawer/DebugDrawer.java | 210 ++++++++++-------- .../io/palaima/debugdrawer/util/UIUtils.java | 2 +- .../view/ScrimInsetsFrameLayout.java | 68 +++--- .../debug_drawer_header_bg.9.png | Bin 149 -> 0 bytes .../ic_battery_unknown_white_24dp.png | Bin 263 -> 0 bytes .../drawable-hdpi/ic_delete_white_24dp.png | Bin 161 -> 0 bytes .../ic_developer_mode_white_24dp.png | Bin 300 -> 0 bytes .../ic_info_outline_white_24dp.png | Bin 485 -> 0 bytes .../ic_location_on_white_24dp.png | Bin 371 -> 0 bytes .../drawable-hdpi/ic_settings_white_24dp.png | Bin 460 -> 0 bytes .../debug_drawer_header_bg.9.png | Bin 147 -> 0 bytes .../ic_battery_unknown_white_24dp.png | Bin 189 -> 0 bytes .../drawable-mdpi/ic_delete_white_24dp.png | Bin 115 -> 0 bytes .../ic_developer_mode_white_24dp.png | Bin 217 -> 0 bytes .../ic_info_outline_white_24dp.png | Bin 320 -> 0 bytes .../ic_location_on_white_24dp.png | Bin 265 -> 0 bytes .../drawable-mdpi/ic_settings_white_24dp.png | Bin 326 -> 0 bytes .../debug_drawer_header_bg.9.png | Bin 151 -> 0 bytes .../ic_battery_unknown_white_24dp.png | Bin 311 -> 0 bytes .../drawable-xhdpi/ic_delete_white_24dp.png | Bin 151 -> 0 bytes .../ic_developer_mode_white_24dp.png | Bin 410 -> 0 bytes .../ic_info_outline_white_24dp.png | Bin 655 -> 0 bytes .../ic_location_on_white_24dp.png | Bin 456 -> 0 bytes .../drawable-xhdpi/ic_settings_white_24dp.png | Bin 562 -> 0 bytes .../ic_battery_unknown_white_24dp.png | Bin 428 -> 0 bytes .../drawable-xxhdpi/ic_delete_white_24dp.png | Bin 194 -> 0 bytes .../ic_developer_mode_white_24dp.png | Bin 461 -> 0 bytes .../ic_info_outline_white_24dp.png | Bin 953 -> 0 bytes .../ic_location_on_white_24dp.png | Bin 675 -> 0 bytes .../ic_settings_white_24dp.png | Bin 843 -> 0 bytes .../ic_battery_unknown_white_24dp.png | Bin 572 -> 0 bytes .../drawable-xxxhdpi/ic_delete_white_24dp.png | Bin 243 -> 0 bytes .../ic_developer_mode_white_24dp.png | Bin 667 -> 0 bytes .../ic_info_outline_white_24dp.png | Bin 1279 -> 0 bytes .../ic_location_on_white_24dp.png | Bin 869 -> 0 bytes .../ic_settings_white_24dp.png | Bin 1074 -> 0 bytes .../{debug_drawer.xml => dd_debug_drawer.xml} | 6 +- ..._slider.xml => dd_debug_drawer_slider.xml} | 8 +- .../res/layout/debug_drawer_module_build.xml | 54 ----- .../res/layout/debug_drawer_module_device.xml | 91 -------- .../layout/debug_drawer_module_divider.xml | 16 -- .../layout/debug_drawer_module_network.xml | 51 ----- .../layout/debug_drawer_module_settings.xml | 103 --------- debugdrawer/src/main/res/values/attrs.xml | 4 +- debugdrawer/src/main/res/values/dimens.xml | 8 +- debugdrawer/src/main/res/values/styles.xml | 31 --- settings.gradle | 2 +- 143 files changed, 648 insertions(+), 857 deletions(-) rename debugdrawer-actions/src/main/res/layout/{debug_drawer_module_actions.xml => dd_debug_drawer_module_actions.xml} (100%) rename debugdrawer-actions/src/main/res/layout/{debug_drawer_module_actions_spinner_item.xml => dd_debug_drawer_module_actions_spinner_item.xml} (100%) delete mode 100644 debugdrawer-actions/src/main/res/values/colors.xml rename debugdrawer-base/src/main/res/drawable-hdpi/{debug_drawer_header_bg.9.png => dd_debug_drawer_header_bg.9.png} (100%) rename debugdrawer-base/src/main/res/drawable-mdpi/{debug_drawer_header_bg.9.png => dd_debug_drawer_header_bg.9.png} (100%) rename debugdrawer-base/src/main/res/drawable-xhdpi/{debug_drawer_header_bg.9.png => dd_debug_drawer_header_bg.9.png} (100%) rename debugdrawer-commons/src/main/res/drawable-hdpi/{ic_battery_unknown_white_24dp.png => dd_ic_battery_unknown_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-hdpi/{ic_delete_white_24dp.png => dd_ic_delete_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-hdpi/{ic_developer_mode_white_24dp.png => dd_ic_developer_mode_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-hdpi/{ic_info_outline_white_24dp.png => dd_ic_info_outline_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-hdpi/{ic_location_on_white_24dp.png => dd_ic_location_on_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-hdpi/{ic_settings_white_24dp.png => dd_ic_settings_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-mdpi/{ic_battery_unknown_white_24dp.png => dd_ic_battery_unknown_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-mdpi/{ic_delete_white_24dp.png => dd_ic_delete_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-mdpi/{ic_developer_mode_white_24dp.png => dd_ic_developer_mode_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-mdpi/{ic_info_outline_white_24dp.png => dd_ic_info_outline_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-mdpi/{ic_location_on_white_24dp.png => dd_ic_location_on_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-mdpi/{ic_settings_white_24dp.png => dd_ic_settings_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xhdpi/{ic_battery_unknown_white_24dp.png => dd_ic_battery_unknown_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xhdpi/{ic_delete_white_24dp.png => dd_ic_delete_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xhdpi/{ic_developer_mode_white_24dp.png => dd_ic_developer_mode_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xhdpi/{ic_info_outline_white_24dp.png => dd_ic_info_outline_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xhdpi/{ic_location_on_white_24dp.png => dd_ic_location_on_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xhdpi/{ic_settings_white_24dp.png => dd_ic_settings_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxhdpi/{ic_battery_unknown_white_24dp.png => dd_ic_battery_unknown_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxhdpi/{ic_delete_white_24dp.png => dd_ic_delete_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxhdpi/{ic_developer_mode_white_24dp.png => dd_ic_developer_mode_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxhdpi/{ic_info_outline_white_24dp.png => dd_ic_info_outline_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxhdpi/{ic_location_on_white_24dp.png => dd_ic_location_on_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxhdpi/{ic_settings_white_24dp.png => dd_ic_settings_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxxhdpi/{ic_battery_unknown_white_24dp.png => dd_ic_battery_unknown_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxxhdpi/{ic_delete_white_24dp.png => dd_ic_delete_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxxhdpi/{ic_developer_mode_white_24dp.png => dd_ic_developer_mode_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxxhdpi/{ic_info_outline_white_24dp.png => dd_ic_info_outline_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxxhdpi/{ic_location_on_white_24dp.png => dd_ic_location_on_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/drawable-xxxhdpi/{ic_settings_white_24dp.png => dd_ic_settings_white_24dp.png} (100%) rename debugdrawer-commons/src/main/res/layout/{debug_drawer_module_build.xml => dd_debug_drawer_module_build.xml} (92%) rename debugdrawer-commons/src/main/res/layout/{debug_drawer_module_device.xml => dd_debug_drawer_module_device.xml} (90%) rename debugdrawer-commons/src/main/res/layout/{debug_drawer_module_network.xml => dd_debug_drawer_module_network.xml} (90%) rename debugdrawer-commons/src/main/res/layout/{debug_drawer_module_settings.xml => dd_debug_drawer_module_settings.xml} (72%) rename debugdrawer-fps/src/main/res/layout/{debug_drawer_item_fps.xml => dd_debug_drawer_item_fps.xml} (95%) rename debugdrawer-location/src/main/res/drawable-hdpi/{ic_map_white_24dp.png => dd_ic_map_white_24dp.png} (100%) rename debugdrawer-location/src/main/res/drawable-mdpi/{ic_map_white_24dp.png => dd_ic_map_white_24dp.png} (100%) rename debugdrawer-location/src/main/res/drawable-xhdpi/{ic_map_white_24dp.png => dd_ic_map_white_24dp.png} (100%) rename debugdrawer-location/src/main/res/drawable-xxhdpi/{ic_map_white_24dp.png => dd_ic_map_white_24dp.png} (100%) rename debugdrawer-location/src/main/res/drawable-xxxhdpi/{ic_map_white_24dp.png => dd_ic_map_white_24dp.png} (100%) rename debugdrawer-location/src/main/res/layout/{debug_drawer_module_location.xml => dd_debug_drawer_module_location.xml} (88%) delete mode 100644 debugdrawer-log/src/main/res/values/colors.xml rename debugdrawer-okhttp/src/main/res/layout/{debug_drawer_module_okhttp.xml => dd_debug_drawer_module_okhttp.xml} (88%) rename debugdrawer-picasso/src/main/res/layout/{debug_drawer_item_picasso.xml => dd_debug_drawer_item_picasso.xml} (88%) rename debugdrawer-scalpel/src/main/res/layout/{debug_drawer_item_scalpel.xml => dd_debug_drawer_item_scalpel.xml} (91%) rename {debugdrawer-log => debugdrawer-timber}/.gitignore (100%) rename {debugdrawer-log => debugdrawer-timber}/build.gradle (92%) rename {debugdrawer-log => debugdrawer-timber}/gradle.properties (100%) rename {debugdrawer-log => debugdrawer-timber}/src/main/AndroidManifest.xml (74%) rename debugdrawer-log/src/main/java/io/palaima/debugdrawer/log/LogModule.java => debugdrawer-timber/src/main/java/io/palaima/debugdrawer/timber/TimberModule.java (70%) rename {debugdrawer-log/src/main/java/io/palaima/debugdrawer/log => debugdrawer-timber/src/main/java/io/palaima/debugdrawer/timber}/data/LumberYard.java (76%) rename {debugdrawer-log/src/main/java/io/palaima/debugdrawer/log => debugdrawer-timber/src/main/java/io/palaima/debugdrawer/timber}/model/LogEntry.java (60%) rename {debugdrawer-log/src/main/java/io/palaima/debugdrawer/log => debugdrawer-timber/src/main/java/io/palaima/debugdrawer/timber}/ui/LogAdapter.java (82%) rename {debugdrawer-log/src/main/java/io/palaima/debugdrawer/log => debugdrawer-timber/src/main/java/io/palaima/debugdrawer/timber}/ui/LogDialog.java (82%) rename {debugdrawer-log/src/main/java/io/palaima/debugdrawer/log => debugdrawer-timber/src/main/java/io/palaima/debugdrawer/timber}/util/Intents.java (96%) rename debugdrawer-log/src/main/res/layout/debug_drawer_module_log.xml => debugdrawer-timber/src/main/res/layout/dd_debug_drawer_module_log.xml (90%) rename debugdrawer-log/src/main/res/layout/item_log_entry.xml => debugdrawer-timber/src/main/res/layout/dd_item_log_entry.xml (73%) create mode 100644 debugdrawer-timber/src/main/res/values/colors.xml delete mode 100644 debugdrawer/src/main/res/drawable-hdpi/debug_drawer_header_bg.9.png delete mode 100644 debugdrawer/src/main/res/drawable-hdpi/ic_battery_unknown_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-hdpi/ic_delete_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-hdpi/ic_developer_mode_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-hdpi/ic_info_outline_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-hdpi/ic_location_on_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-hdpi/ic_settings_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-mdpi/debug_drawer_header_bg.9.png delete mode 100644 debugdrawer/src/main/res/drawable-mdpi/ic_battery_unknown_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-mdpi/ic_delete_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-mdpi/ic_developer_mode_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-mdpi/ic_info_outline_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-mdpi/ic_location_on_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-mdpi/ic_settings_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xhdpi/debug_drawer_header_bg.9.png delete mode 100644 debugdrawer/src/main/res/drawable-xhdpi/ic_battery_unknown_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xhdpi/ic_delete_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xhdpi/ic_developer_mode_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xhdpi/ic_info_outline_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xhdpi/ic_location_on_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xhdpi/ic_settings_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxhdpi/ic_battery_unknown_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxhdpi/ic_delete_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxhdpi/ic_developer_mode_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxhdpi/ic_info_outline_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxhdpi/ic_location_on_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxhdpi/ic_settings_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxxhdpi/ic_battery_unknown_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxxhdpi/ic_delete_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxxhdpi/ic_developer_mode_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxxhdpi/ic_info_outline_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxxhdpi/ic_location_on_white_24dp.png delete mode 100644 debugdrawer/src/main/res/drawable-xxxhdpi/ic_settings_white_24dp.png rename debugdrawer/src/main/res/layout/{debug_drawer.xml => dd_debug_drawer.xml} (83%) rename debugdrawer/src/main/res/layout/{debug_drawer_slider.xml => dd_debug_drawer_slider.xml} (70%) delete mode 100644 debugdrawer/src/main/res/layout/debug_drawer_module_build.xml delete mode 100644 debugdrawer/src/main/res/layout/debug_drawer_module_device.xml delete mode 100644 debugdrawer/src/main/res/layout/debug_drawer_module_divider.xml delete mode 100644 debugdrawer/src/main/res/layout/debug_drawer_module_network.xml delete mode 100644 debugdrawer/src/main/res/layout/debug_drawer_module_settings.xml delete mode 100644 debugdrawer/src/main/res/values/styles.xml diff --git a/app/build.gradle b/app/build.gradle index 185fdf6..787405b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,6 +39,8 @@ dependencies { compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.squareup.okhttp:okhttp:2.5.0' compile 'jp.wasabeef:takt:1.0.2' + compile 'com.jakewharton.timber:timber:4.1.0' + compile 'com.jakewharton.scalpel:scalpel:1.1.2' compile 'com.google.android.gms:play-services-location:8.3.0' /*debugCompile 'io.palaima.debugdrawer:debugdrawer:0.6.0' @@ -75,13 +77,13 @@ dependencies { debugCompile project(':debugdrawer-view') compile project(':debugdrawer-base') compile project(':debugdrawer-commons') + compile project(':debugdrawer-actions') compile project(':debugdrawer-picasso') compile project(':debugdrawer-okhttp') compile project(':debugdrawer-scalpel') compile project(':debugdrawer-location') - compile project(':debugdrawer-log') + compile project(':debugdrawer-timber') compile project(':debugdrawer-fps') - compile project(':debugdrawer-actions') debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1' diff --git a/app/src/main/java/io/palaima/debugdrawer/app/DebugDrawerApplication.java b/app/src/main/java/io/palaima/debugdrawer/app/DebugDrawerApplication.java index 5529973..da73dd9 100644 --- a/app/src/main/java/io/palaima/debugdrawer/app/DebugDrawerApplication.java +++ b/app/src/main/java/io/palaima/debugdrawer/app/DebugDrawerApplication.java @@ -4,7 +4,7 @@ import com.squareup.leakcanary.LeakCanary; -import io.palaima.debugdrawer.log.data.LumberYard; +import io.palaima.debugdrawer.timber.data.LumberYard; import timber.log.Timber; @@ -13,6 +13,7 @@ * @since 01/07/15 */ public class DebugDrawerApplication extends Application { + @Override public void onCreate() { super.onCreate(); diff --git a/app/src/main/java/io/palaima/debugdrawer/app/DebugViewActivity.java b/app/src/main/java/io/palaima/debugdrawer/app/DebugViewActivity.java index ff67dd5..abb1dd8 100644 --- a/app/src/main/java/io/palaima/debugdrawer/app/DebugViewActivity.java +++ b/app/src/main/java/io/palaima/debugdrawer/app/DebugViewActivity.java @@ -27,31 +27,31 @@ import io.palaima.debugdrawer.commons.SettingsModule; import io.palaima.debugdrawer.fps.FpsModule; import io.palaima.debugdrawer.location.LocationModule; -import io.palaima.debugdrawer.log.LogModule; import io.palaima.debugdrawer.okhttp.OkHttpModule; import io.palaima.debugdrawer.picasso.PicassoModule; import io.palaima.debugdrawer.scalpel.ScalpelModule; +import io.palaima.debugdrawer.timber.TimberModule; import io.palaima.debugdrawer.view.DebugView; import jp.wasabeef.takt.Takt; import timber.log.Timber; public class DebugViewActivity extends AppCompatActivity { - private Toolbar mToolbar; + private Toolbar toolbar; - private DebugView mDebugView; + private DebugView debugView; - private Picasso mPicasso; + private Picasso picasso; - private OkHttpClient mOkHttpClient; + private OkHttpClient okHttpClient; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_debugview); - mOkHttpClient = createOkHttpClient(this.getApplication()); - mPicasso = new Picasso.Builder(this) - .downloader(new OkHttpDownloader(mOkHttpClient)) + okHttpClient = createOkHttpClient(this.getApplication()); + picasso = new Picasso.Builder(this) + .downloader(new OkHttpDownloader(okHttpClient)) .listener(new Picasso.Listener() { @Override public void onImageLoadFailed(Picasso picasso, Uri uri, Exception e) { @@ -85,16 +85,16 @@ public void onClick() { } ); - mDebugView = (DebugView) findViewById(R.id.debug_view); + debugView = (DebugView) findViewById(R.id.debug_view); - mDebugView.modules( + debugView.modules( new ActionsModule(switchAction, buttonAction, spinnerAction), new FpsModule(Takt.stock(getApplication())), new LocationModule(this), new ScalpelModule(this), - new LogModule(), - new OkHttpModule(mOkHttpClient), - new PicassoModule(mPicasso), + new TimberModule(), + new OkHttpModule(okHttpClient), + new PicassoModule(picasso), new DeviceModule(this), new BuildModule(this), new NetworkModule(this), @@ -115,32 +115,32 @@ private void showDummyLog() { @Override protected void onResume() { super.onResume(); - mDebugView.onResume(); + debugView.onResume(); } @Override protected void onPause() { super.onPause(); - mDebugView.onPause(); + debugView.onPause(); } @Override protected void onStart() { super.onStart(); - mDebugView.onStart(); + debugView.onStart(); } @Override protected void onStop() { super.onStop(); - mDebugView.onStop(); + debugView.onStop(); } protected Toolbar setupToolBar() { - mToolbar = (Toolbar) findViewById(R.id.mainToolbar); - if (mToolbar != null) { - setSupportActionBar(mToolbar); + toolbar = (Toolbar) findViewById(R.id.mainToolbar); + if (toolbar != null) { + setSupportActionBar(toolbar); } - return mToolbar; + return toolbar; } private static final int DISK_CACHE_SIZE = 50 * 1024 * 1024; // 50 MB diff --git a/app/src/main/java/io/palaima/debugdrawer/app/ImageAdapter.java b/app/src/main/java/io/palaima/debugdrawer/app/ImageAdapter.java index 8d6af60..361da4f 100644 --- a/app/src/main/java/io/palaima/debugdrawer/app/ImageAdapter.java +++ b/app/src/main/java/io/palaima/debugdrawer/app/ImageAdapter.java @@ -1,7 +1,5 @@ package io.palaima.debugdrawer.app; -import com.squareup.picasso.Picasso; - import android.content.Context; import android.view.LayoutInflater; import android.view.View; @@ -9,15 +7,17 @@ import android.widget.ArrayAdapter; import android.widget.ImageView; +import com.squareup.picasso.Picasso; + import java.util.List; public class ImageAdapter extends ArrayAdapter { - private final Picasso mPicasso; + private final Picasso picasso; public ImageAdapter(Context context, List images, Picasso picasso) { super(context, 0, images); - mPicasso = picasso; + this.picasso = picasso; } @Override @@ -26,7 +26,7 @@ public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.image_item, parent, false); } - mPicasso.load(url).into((ImageView)convertView.findViewById(R.id.image)); + picasso.load(url).into((ImageView)convertView.findViewById(R.id.image)); return convertView; } } diff --git a/app/src/main/java/io/palaima/debugdrawer/app/MainActivity.java b/app/src/main/java/io/palaima/debugdrawer/app/MainActivity.java index 0e9f3af..bfd03c5 100644 --- a/app/src/main/java/io/palaima/debugdrawer/app/MainActivity.java +++ b/app/src/main/java/io/palaima/debugdrawer/app/MainActivity.java @@ -29,35 +29,35 @@ import io.palaima.debugdrawer.actions.SpinnerAction; import io.palaima.debugdrawer.actions.SwitchAction; import io.palaima.debugdrawer.commons.BuildModule; -import io.palaima.debugdrawer.fps.FpsModule; -import io.palaima.debugdrawer.location.LocationModule; -import io.palaima.debugdrawer.log.LogModule; import io.palaima.debugdrawer.commons.DeviceModule; import io.palaima.debugdrawer.commons.NetworkModule; import io.palaima.debugdrawer.commons.SettingsModule; +import io.palaima.debugdrawer.fps.FpsModule; +import io.palaima.debugdrawer.location.LocationModule; import io.palaima.debugdrawer.okhttp.OkHttpModule; import io.palaima.debugdrawer.picasso.PicassoModule; import io.palaima.debugdrawer.scalpel.ScalpelModule; +import io.palaima.debugdrawer.timber.TimberModule; import jp.wasabeef.takt.Takt; import timber.log.Timber; public class MainActivity extends AppCompatActivity { - private Toolbar mToolbar; + private Toolbar toolbar; - private DebugDrawer mDebugDrawer; + private DebugDrawer debugDrawer; - private Picasso mPicasso; + private Picasso picasso; - private OkHttpClient mOkHttpClient; + private OkHttpClient okHttpClient; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - mOkHttpClient = createOkHttpClient(this.getApplication()); - mPicasso = new Picasso.Builder(this) - .downloader(new OkHttpDownloader(mOkHttpClient)) + okHttpClient = createOkHttpClient(this.getApplication()); + picasso = new Picasso.Builder(this) + .downloader(new OkHttpDownloader(okHttpClient)) .listener(new Picasso.Listener() { @Override public void onImageLoadFailed(Picasso picasso, Uri uri, Exception e) { @@ -97,14 +97,14 @@ public void onClick() { } ); - mDebugDrawer = new DebugDrawer.Builder(this).modules( + debugDrawer = new DebugDrawer.Builder(this).modules( new ActionsModule(switchAction, buttonAction, spinnerAction), new FpsModule(Takt.stock(getApplication())), new LocationModule(this), new ScalpelModule(this), - new LogModule(), - new OkHttpModule(mOkHttpClient), - new PicassoModule(mPicasso), + new TimberModule(), + new OkHttpModule(okHttpClient), + new PicassoModule(picasso), new DeviceModule(this), new BuildModule(this), new NetworkModule(this), @@ -119,7 +119,7 @@ public void onClick() { } ListView listView = (ListView) findViewById(R.id.image_list); - listView.setAdapter(new ImageAdapter(this, images, mPicasso)); + listView.setAdapter(new ImageAdapter(this, images, picasso)); } private void showDummyLog() { @@ -134,23 +134,23 @@ private void showDummyLog() { @Override protected void onStart() { super.onStart(); - mDebugDrawer.onStart(); + debugDrawer.onStart(); } @Override protected void onResume() { super.onResume(); - mDebugDrawer.onResume(); + debugDrawer.onResume(); } @Override protected void onPause() { super.onPause(); - mDebugDrawer.onPause(); + debugDrawer.onPause(); } @Override protected void onStop() { super.onStop(); - mDebugDrawer.onStop(); + debugDrawer.onStop(); } @Override @@ -177,11 +177,11 @@ public boolean onOptionsItemSelected(MenuItem item) { } protected Toolbar setupToolBar() { - mToolbar = (Toolbar) findViewById(R.id.mainToolbar); - if (mToolbar != null) { - setSupportActionBar(mToolbar); + toolbar = (Toolbar) findViewById(R.id.mainToolbar); + if (toolbar != null) { + setSupportActionBar(toolbar); } - return mToolbar; + return toolbar; } private static final int DISK_CACHE_SIZE = 50 * 1024 * 1024; // 50 MB diff --git a/app/src/main/res/layout/activity_debugview.xml b/app/src/main/res/layout/activity_debugview.xml index e13b8f0..1b0974c 100644 --- a/app/src/main/res/layout/activity_debugview.xml +++ b/app/src/main/res/layout/activity_debugview.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context=".MainActivity"> + tools:context=".DebugViewActivity"> diff --git a/build.gradle b/build.gradle index bb0178b..03a8a16 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.0.0-alpha2' + classpath 'com.android.tools.build:gradle:2.0.0-alpha3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/debugdrawer-actions/build.gradle b/debugdrawer-actions/build.gradle index 11caf4b..8818c3b 100644 --- a/debugdrawer-actions/build.gradle +++ b/debugdrawer-actions/build.gradle @@ -19,7 +19,6 @@ android { } dependencies { - compile 'com.android.support:support-v4:23.1.1' compile project(':debugdrawer-base') } diff --git a/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/ActionsModule.java b/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/ActionsModule.java index 6ac2b4b..480f863 100644 --- a/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/ActionsModule.java +++ b/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/ActionsModule.java @@ -1,7 +1,6 @@ package io.palaima.debugdrawer.actions; import android.support.annotation.NonNull; -import android.support.v4.content.ContextCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -26,11 +25,11 @@ public ActionsModule(Action... actions) { @NonNull @Override public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) { - LinearLayout view = (LinearLayout) inflater.inflate(R.layout.debug_drawer_module_actions, parent, false); + LinearLayout view = (LinearLayout) inflater.inflate(R.layout.dd_debug_drawer_module_actions, parent, false); if (actions.isEmpty()) { TextView noActionsLabel = new TextView(parent.getContext()); - noActionsLabel.setTextColor(ContextCompat.getColor(parent.getContext(), R.color.white)); + noActionsLabel.setTextColor(parent.getResources().getColor(android.R.color.white)); noActionsLabel.setText("No actions added"); view.addView(noActionsLabel); } else { diff --git a/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/ButtonAction.java b/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/ButtonAction.java index e55c1a6..63edee3 100644 --- a/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/ButtonAction.java +++ b/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/ButtonAction.java @@ -24,7 +24,7 @@ public View getView(LinearLayout linearLayout) { Resources resources = context.getResources(); LinearLayout.LayoutParams buttonLayoutParams = new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT); - buttonLayoutParams.topMargin = resources.getDimensionPixelOffset(R.dimen.padding_small); + buttonLayoutParams.topMargin = resources.getDimensionPixelOffset(R.dimen.dd_padding_small); Button button = new Button(context); button.setLayoutParams(buttonLayoutParams); diff --git a/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/SpinnerAction.java b/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/SpinnerAction.java index 0a72a75..549de0a 100644 --- a/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/SpinnerAction.java +++ b/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/SpinnerAction.java @@ -41,7 +41,7 @@ public View getView(LinearLayout view) { Resources resources = context.getResources(); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT); - layoutParams.topMargin = resources.getDimensionPixelOffset(R.dimen.padding_small); + layoutParams.topMargin = resources.getDimensionPixelOffset(R.dimen.dd_padding_small); Spinner spinner = new Spinner(context); spinner.setLayoutParams(layoutParams); @@ -58,7 +58,7 @@ public View getView(LinearLayout view) { } }); - ArrayAdapter adapter = new ArrayAdapter<>(context, R.layout.debug_drawer_module_actions_spinner_item, titles); + ArrayAdapter adapter = new ArrayAdapter<>(context, R.layout.dd_debug_drawer_module_actions_spinner_item, titles); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); diff --git a/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/SwitchAction.java b/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/SwitchAction.java index a2e7b10..69ffc67 100644 --- a/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/SwitchAction.java +++ b/debugdrawer-actions/src/main/java/io/palaima/debugdrawer/actions/SwitchAction.java @@ -3,7 +3,6 @@ import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources; -import android.support.v4.content.ContextCompat; import android.util.TypedValue; import android.view.Gravity; import android.view.View; @@ -35,20 +34,20 @@ public View getView(LinearLayout linearLayout) { Resources resources = context.getResources(); LinearLayout.LayoutParams viewGroupLayoutParams = new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT); - viewGroupLayoutParams.topMargin = resources.getDimensionPixelOffset(R.dimen.padding_small); + viewGroupLayoutParams.topMargin = resources.getDimensionPixelOffset(R.dimen.dd_padding_small); LinearLayout viewGroup = new LinearLayout(context); viewGroup.setLayoutParams(viewGroupLayoutParams); viewGroup.setOrientation(LinearLayout.HORIZONTAL); LinearLayout.LayoutParams textViewLayoutParams = new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT); - textViewLayoutParams.rightMargin = resources.getDimensionPixelSize(R.dimen.spacing_big); + textViewLayoutParams.rightMargin = resources.getDimensionPixelSize(R.dimen.dd_spacing_big); TextView textView = new TextView(context); textView.setLayoutParams(textViewLayoutParams); textView.setText(name); - textView.setTextColor(ContextCompat.getColor(context, R.color.white)); - textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.font_normal)); + textView.setTextColor(context.getResources().getColor(android.R.color.white)); + textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.dd_font_normal)); textView.setGravity(Gravity.CENTER_VERTICAL); switchButton = new Switch(context); diff --git a/debugdrawer-actions/src/main/res/layout/debug_drawer_module_actions.xml b/debugdrawer-actions/src/main/res/layout/dd_debug_drawer_module_actions.xml similarity index 100% rename from debugdrawer-actions/src/main/res/layout/debug_drawer_module_actions.xml rename to debugdrawer-actions/src/main/res/layout/dd_debug_drawer_module_actions.xml diff --git a/debugdrawer-actions/src/main/res/layout/debug_drawer_module_actions_spinner_item.xml b/debugdrawer-actions/src/main/res/layout/dd_debug_drawer_module_actions_spinner_item.xml similarity index 100% rename from debugdrawer-actions/src/main/res/layout/debug_drawer_module_actions_spinner_item.xml rename to debugdrawer-actions/src/main/res/layout/dd_debug_drawer_module_actions_spinner_item.xml diff --git a/debugdrawer-actions/src/main/res/values/colors.xml b/debugdrawer-actions/src/main/res/values/colors.xml deleted file mode 100644 index a180061..0000000 --- a/debugdrawer-actions/src/main/res/values/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - @android:color/white - \ No newline at end of file diff --git a/debugdrawer-actions/src/main/res/values/dimens.xml b/debugdrawer-actions/src/main/res/values/dimens.xml index 6d84a8b..f07e1df 100644 --- a/debugdrawer-actions/src/main/res/values/dimens.xml +++ b/debugdrawer-actions/src/main/res/values/dimens.xml @@ -1,8 +1,6 @@ - 16dp - - 4dp - - 16sp + 16dp + 4dp + 16sp \ No newline at end of file diff --git a/debugdrawer-base/src/main/res/drawable-hdpi/debug_drawer_header_bg.9.png b/debugdrawer-base/src/main/res/drawable-hdpi/dd_debug_drawer_header_bg.9.png similarity index 100% rename from debugdrawer-base/src/main/res/drawable-hdpi/debug_drawer_header_bg.9.png rename to debugdrawer-base/src/main/res/drawable-hdpi/dd_debug_drawer_header_bg.9.png diff --git a/debugdrawer-base/src/main/res/drawable-mdpi/debug_drawer_header_bg.9.png b/debugdrawer-base/src/main/res/drawable-mdpi/dd_debug_drawer_header_bg.9.png similarity index 100% rename from debugdrawer-base/src/main/res/drawable-mdpi/debug_drawer_header_bg.9.png rename to debugdrawer-base/src/main/res/drawable-mdpi/dd_debug_drawer_header_bg.9.png diff --git a/debugdrawer-base/src/main/res/drawable-xhdpi/debug_drawer_header_bg.9.png b/debugdrawer-base/src/main/res/drawable-xhdpi/dd_debug_drawer_header_bg.9.png similarity index 100% rename from debugdrawer-base/src/main/res/drawable-xhdpi/debug_drawer_header_bg.9.png rename to debugdrawer-base/src/main/res/drawable-xhdpi/dd_debug_drawer_header_bg.9.png diff --git a/debugdrawer-base/src/main/res/values/styles.xml b/debugdrawer-base/src/main/res/values/styles.xml index 99f9f8b..f299020 100644 --- a/debugdrawer-base/src/main/res/values/styles.xml +++ b/debugdrawer-base/src/main/res/values/styles.xml @@ -11,7 +11,7 @@ 13sp 8dp 2dp - @drawable/debug_drawer_header_bg + @drawable/dd_debug_drawer_header_bg - - - - - - \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index ce63669..57b81f0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app', ':debugdrawer', ':debugdrawer-picasso', ':debugdrawer-okhttp', ':debugdrawer-scalpel', ':debugdrawer-location', ':debugdrawer-log', ':debugdrawer-fps', ':debugdrawer-actions', ':debugdrawer-base', ':debugdrawer-commons', ':debugdrawer-view', ':debugdrawer-no-op', ':debugdrawer-view-no-op' +include ':app', ':debugdrawer', ':debugdrawer-picasso', ':debugdrawer-okhttp', ':debugdrawer-scalpel', ':debugdrawer-location', ':debugdrawer-timber', ':debugdrawer-fps', ':debugdrawer-actions', ':debugdrawer-base', ':debugdrawer-commons', ':debugdrawer-view', ':debugdrawer-no-op', ':debugdrawer-view-no-op'