Skip to content

Commit 49b5992

Browse files
author
Mantas Palaima
authored
Merge pull request #90 from palaima/dev
Release 0.8.0
2 parents 90fa8fc + 02845bc commit 49b5992

File tree

196 files changed

+2590
-1574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+2590
-1574
lines changed

.gitignore

+5-12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ build/
1818

1919
# Local configuration file (sdk path, etc)
2020
local.properties
21+
signing.properties
22+
*.jks
2123

2224
# Proguard folder generated by Eclipse
2325
proguard/
@@ -27,20 +29,11 @@ proguard/
2729

2830
# Android Studio
2931
.idea/
30-
.gradle
31-
/*/local.properties
32-
/*/out
33-
/*/*/build
34-
/*/*/production
3532
*.iml
3633
*.iws
3734
*.ipr
35+
36+
# Misc
3837
*~
3938
*.swp
40-
signing.properties
41-
build/
42-
43-
*.jks
44-
45-
# Mac OS
46-
.DS_STORE
39+
.DS_STORE

LICENSE

-1
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,3 @@ Apache License
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201201
limitations under the License.
202-

README.md

+51-78
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
# Android Debug Drawer
22

3-
[![Join the chat at https://gitter.im/palaima/DebugDrawer](https://badges.gitter.im/palaima/DebugDrawer.svg)](https://gitter.im/palaima/DebugDrawer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4-
53
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Debug%20Drawer-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/1892)
64

75
Faster development with Debug Drawer
86

9-
![](./images/all.png)
7+
![](./images/debug_drawer.gif)
108

119
## Features
1210

13-
Currently 13 modules exist:
14-
1511
`DeviceModule` - common information about your device
1612

1713
![](./images/device.png)
@@ -50,7 +46,7 @@ Currently 13 modules exist:
5046

5147
`TimberModule` - log viewer with sharing feature (requires extra dependency). Thanks [AntonyGolovin](https://github.com/AntonyGolovin) for contributing.
5248

53-
![](./images/log.png)
49+
![](./images/timber.png)
5450

5551
`ActionsModule` - any context dependent action (`ButtonAction`, `SwitchAction`, `SpinnerAction`)
5652

@@ -60,8 +56,15 @@ Currently 13 modules exist:
6056

6157
![](./images/fps.png)
6258

59+
`LogsModule` - Logcat and OkHttp network calls interceptor (requires extra dependency). Credits [Sloy](https://github.com/Sloy)
60+
61+
![](./images/logs.png)
62+
63+
`NetworkQualityModule` - Error/delay rate managing for network calls (requires extra dependency). Credits [Sloy](https://github.com/Sloy)
64+
65+
![](./images/network_quality.png)
66+
6367
## TODO
64-
- Network delay/error adapters
6568
- Take screenshot feature
6669

6770
You are always welcome to suggest modules!
@@ -73,104 +76,103 @@ Add Gradle dependencies:
7376
#### `DebugDrawer`
7477
```gradle
7578
dependencies {
76-
debugCompile 'io.palaima.debugdrawer:debugdrawer:0.7.0'
77-
releaseCompile 'io.palaima.debugdrawer:debugdrawer-no-op:0.7.0'
79+
debugImplementation 'io.palaima.debugdrawer:debugdrawer:0.8.0'
80+
releaseImplementation 'io.palaima.debugdrawer:debugdrawer-no-op:0.8.0'
7881
}
7982
```
8083

8184
#### `DebugView`
8285
```gradle
8386
dependencies {
84-
debugCompile 'io.palaima.debugdrawer:debugdrawer-view:0.7.0'
85-
releaseCompile 'io.palaima.debugdrawer:debugdrawer-view-no-op:0.7.0'
87+
debugImplementation 'io.palaima.debugdrawer:debugdrawer-view:0.8.0'
88+
releaseImplementation 'io.palaima.debugdrawer:debugdrawer-view-no-op:0.8.0'
8689
}
8790
```
8891

8992
`BuildModule`, `DeviceModule`, `SettingsModule`, `NetworkModule`
9093
```gradle
9194
dependencies {
92-
compile 'io.palaima.debugdrawer:debugdrawer-commons:0.7.0'
95+
implementation 'io.palaima.debugdrawer:debugdrawer-commons:0.8.0'
9396
}
9497
```
9598

9699
`ActionsModule` - `ButtonAction`, `SwitchAction`, `SpinnerAction`
97100
```gradle
98101
dependencies {
99-
compile 'io.palaima.debugdrawer:debugdrawer-actions:0.7.0'
102+
implementation 'io.palaima.debugdrawer:debugdrawer-actions:0.8.0'
100103
}
101104
```
102105

103106
`OkHttpModule`, `OkHttp3Module`
104107
[OkHttp](https://github.com/square/okhttp) library required
105108
```gradle
106109
dependencies {
107-
compile 'io.palaima.debugdrawer:debugdrawer-okhttp:0.7.0'
108-
compile 'io.palaima.debugdrawer:debugdrawer-okhttp3:0.7.0'
110+
implementation 'io.palaima.debugdrawer:debugdrawer-okhttp:0.8.0'
111+
implementation 'io.palaima.debugdrawer:debugdrawer-okhttp3:0.8.0'
109112
}
110113
```
111114

112115
`PicassoModule`
113116
[Picasso](https://github.com/square/picasso) library required
114117
```gradle
115118
dependencies {
116-
compile 'io.palaima.debugdrawer:debugdrawer-picasso:0.7.0'
119+
implementation 'io.palaima.debugdrawer:debugdrawer-picasso:0.8.0'
117120
}
118121
```
119122

120123
`GlideModule`
121124
[Glide](https://github.com/bumptech/glide) library required
122125
```gradle
123126
dependencies {
124-
compile 'io.palaima.debugdrawer:debugdrawer-glide:0.7.0'
127+
implementation 'io.palaima.debugdrawer:debugdrawer-glide:0.8.0'
125128
}
126129
```
127130

128131
`ScalpelModule`
129132
[Scalpel](https://github.com/JakeWharton/scalpel) library required
130133
```gradle
131134
dependencies {
132-
compile 'io.palaima.debugdrawer:debugdrawer-scalpel:0.7.0'
135+
implementation 'io.palaima.debugdrawer:debugdrawer-scalpel:0.8.0'
133136
}
134137
```
135138

136139
`LocationModule`
137140
```gradle
138141
dependencies {
139-
compile 'io.palaima.debugdrawer:debugdrawer-location:0.7.0'
142+
implementation 'io.palaima.debugdrawer:debugdrawer-location:0.8.0'
140143
}
141144
```
142145

143146
`TimberModule`
144147
[Timber](https://github.com/JakeWharton/timber) library required
145148
```gradle
146149
dependencies {
147-
compile 'io.palaima.debugdrawer:debugdrawer-timber:0.7.0'
150+
implementation 'io.palaima.debugdrawer:debugdrawer-timber:0.8.0'
148151
}
149152
```
150153

151154
`FpsModule`
152155
[Takt](https://github.com/wasabeef/Takt) library required
153156
```gradle
154157
dependencies {
155-
compile 'io.palaima.debugdrawer:debugdrawer-fps:0.7.0'
158+
implementation 'io.palaima.debugdrawer:debugdrawer-fps:0.8.0'
156159
}
157160
```
158161

159-
You can try the SNAPSHOT version:
160162

163+
`LogsModule`
164+
[Lynx](https://github.com/pedrovgs/Lynx) & [Chuck](https://github.com/jgilfelt/chuck) libraries required
161165
```gradle
162166
dependencies {
163-
debugCompile 'io.palaima.debugdrawer:debugdrawer:0.7.1-SNAPSHOT'
164-
...
167+
implementation 'io.palaima.debugdrawer:debugdrawer-logs:0.8.0'
165168
}
166169
```
167-
Make sure to add the snapshot repository:
168170

171+
`NetworkQualityModule`
172+
[OkHttp](https://github.com/square/okhttp) library required
169173
```gradle
170-
repositories {
171-
maven {
172-
url "https://oss.sonatype.org/content/repositories/snapshots"
173-
}
174+
dependencies {
175+
implementation 'io.palaima.debugdrawer:debugdrawer-network-quality:0.8.0'
174176
}
175177
```
176178

@@ -180,31 +182,31 @@ repositories {
180182

181183
You could use `DebugDrawer` or `DebugView` depending on your needs
182184

183-
#### Example using `DebugDrawer` (For `DebugView` initialization check [DebugViewActivity](https://github.com/palaima/DebugDrawer/blob/master/app/src/main/java/io/palaima/debugdrawer/app/DebugViewActivity.java))
185+
#### Example using `DebugDrawer` (For `DebugView` initialization check [DebugViewActivity](https://github.com/palaima/DebugDrawer/blob/master/app/src/main/java/io/palaima/debugdrawer/app/DebugViewActivity.java))
184186

185187
```java
186188

187189
private DebugDrawer debugDrawer;
188-
190+
189191
@Override
190192
protected void onCreate(Bundle savedInstanceState) {
191193
super.onCreate(savedInstanceState);
192-
...
193-
194+
//...
195+
194196
SwitchAction switchAction = new SwitchAction("Test switch", new SwitchAction.Listener() {
195197
@Override
196198
public void onCheckedChanged(boolean value) {
197199
Toast.makeText(MainActivity.this, "Switch checked", Toast.LENGTH_LONG).show();
198200
}
199201
});
200-
202+
201203
ButtonAction buttonAction = new ButtonAction("Test button", new ButtonAction.Listener() {
202204
@Override
203205
public void onClick() {
204206
Toast.makeText(MainActivity.this, "Button clicked", Toast.LENGTH_LONG).show();
205207
}
206208
});
207-
209+
208210
SpinnerAction<String> spinnerAction = new SpinnerAction<>(
209211
Arrays.asList("First", "Second", "Third"),
210212
new SpinnerAction.OnItemSelectedListener<String>() {
@@ -213,7 +215,7 @@ You could use `DebugDrawer` or `DebugView` depending on your needs
213215
}
214216
}
215217
);
216-
218+
217219
debugDrawer = new DebugDrawer.Builder(this)
218220
.modules(
219221
new ActionsModule(switchAction, buttonAction, spinnerAction),
@@ -232,37 +234,8 @@ You could use `DebugDrawer` or `DebugView` depending on your needs
232234
}
233235
```
234236

235-
### 2. Lifecycle
236-
If you use `NetworkModule`, `LocationModule`, `FpsModule` or your own which is hooked with BroadcastReceivers you must call `onStart`/`onStop`, `onResume`/`onPause` in your activity
237+
### 2. `TimberModule`
237238

238-
```java
239-
240-
@Override
241-
protected void onStart() {
242-
super.onStart();
243-
debugDrawer.onStart();
244-
}
245-
246-
@Override
247-
protected void onResume() {
248-
super.onResume();
249-
debugDrawer.onResume();
250-
}
251-
252-
@Override
253-
protected void onPause() {
254-
super.onPause();
255-
debugDrawer.onPause();
256-
}
257-
258-
@Override
259-
protected void onStop() {
260-
super.onStop();
261-
debugDrawer.onStop();
262-
}
263-
```
264-
265-
### 3. `TimberModule`
266239
Don't forget to plant needed log trees in Application class. Tree that is used by `TimberModule` stored in `LumberYard` class.
267240

268241
Application class example:
@@ -273,10 +246,10 @@ Application class example:
273246
@Override
274247
public void onCreate() {
275248
super.onCreate();
276-
249+
277250
LumberYard lumberYard = LumberYard.getInstance(this);
278251
lumberYard.cleanUp();
279-
252+
280253
Timber.plant(lumberYard.tree());
281254
Timber.plant(new Timber.DebugTree());
282255
}
@@ -285,51 +258,51 @@ Application class example:
285258

286259
## Creating and Publishing Your Own Module
287260

288-
Add `compile 'io.palaima.debugdrawer:debugdrawer-base:0.7.0'` to your dependencies
261+
Add `implementation 'io.palaima.debugdrawer:debugdrawer-base:0.8.0'` to your dependencies
289262

290-
Module must implement `DebugModule` interface
263+
Module must implement `DebugModule` interface or extend `DebugModuleAdapter` if you do not need lifecycle hooks
291264

292265
```java
293266

294267
public interface DebugModule {
295-
268+
296269
/**
297270
* Creates module view
298271
*/
299272
@NonNull View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent);
300-
273+
301274
/**
302275
* Override this method if you need to refresh
303276
* some information when drawer is opened
304277
*/
305278
void onOpened();
306-
279+
307280
/**
308281
* Override this method if you need to stop
309282
* some actions when drawer is closed
310283
*/
311284
void onClosed();
312-
285+
313286
/**
314287
* Override this method if you need to start
315288
* some processes
316289
*/
317290
void onResume();
318-
291+
319292
/**
320293
* Override this method if you need to do
321294
* some clean up
322295
*/
323296
void onPause();
324-
297+
325298
/**
326299
* Override this method if you need to start
327300
* some processes that would be killed when
328301
* onStop() is called
329302
* E.g. register receivers
330303
*/
331304
void onStart();
332-
305+
333306
/**
334307
* Override this method if you need to do
335308
* some clean up when activity goes to foreground.
@@ -390,4 +363,4 @@ License
390363
distributed under the License is distributed on an "AS IS" BASIS,
391364
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
392365
See the License for the specific language governing permissions and
393-
limitations under the License.
366+
limitations under the License.

0 commit comments

Comments
 (0)