Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0b7b61d
Use 24h format for log timestamp and log filename
egor-n Feb 15, 2016
d082ca9
Set FLAG_ACTIVITY_NEW_TASK flag in SettingsModule
egor-n Feb 15, 2016
c0db87c
Merge pull request #48 from egor-n/patch-1
Feb 15, 2016
a331bc2
Merge pull request #50 from egor-n/patch-2
Feb 15, 2016
4436182
Fix NullPointerException in LumberYard#cleanUp
egor-n Feb 26, 2016
39da3ac
Merge pull request #54 from egor-n/patch-1
Feb 26, 2016
695542e
reduce DebugDrawer-no-op memory footprint
Jun 15, 2016
f26e36e
add adapter class for DebugModule to make implementations without run…
Jun 15, 2016
bf0f74b
convert modules with lot of empty overrides to adapter usage
Jun 15, 2016
250691b
Update dependencies
Jul 2, 2016
a5101ad
Merge pull request #64 from 0legg/feature/lighten-no-op
Jul 2, 2016
e0dac2d
Fix whitespace error and update .gitignore
Jul 2, 2016
036ff9b
Merge branch 'dev' of https://github.com/palaima/DebugDrawer into dev
Jul 2, 2016
46c6468
Drop allowBackup from library
Jul 2, 2016
8e895ff
Mobile network toggle invisible for API 17 and above
Jul 2, 2016
fb0dfca
Check for bluetooth permission before accessing bluetooth state
Jul 2, 2016
c3e41a0
Delete unused import
Jul 2, 2016
a29a797
Update Gradle wrapper to 2.14
friederbluemle Jul 5, 2016
2fc3a0a
Update build tools to 24.0.0
friederbluemle Jul 5, 2016
c2ddeff
Merge pull request #68 from friederbluemle/update-project
Jul 19, 2016
e7248cd
Merge pull request #67 from 0legg/feature/debug-module-adapter
Jul 19, 2016
08cdf44
Added the possibility to set an initial selected position on SpinnerA…
Aug 1, 2016
2d535c0
Merge pull request #69 from joseluisametller/initial_selected_positio…
Aug 16, 2016
eca7573
Do not keep context directly in modules
Aug 16, 2016
6d5efd9
Add clear cache button to okhttp3 module
Aug 16, 2016
1cbe61b
Update dependencies
Aug 16, 2016
b75f9a3
use ActivityLifecycleCallbacks for start,stop,pause and resume events
Sep 11, 2016
d6ffd1b
Fix NetworkController memory leak
Jan 29, 2017
60d3a96
Update project dependencies
Jan 29, 2017
7a2202e
Merge branch 'dev' into feature/lifecyclecallbacks
Jan 29, 2017
1a15fe8
Merge pull request #71 from remcomokveld/feature/lifecyclecallbacks
Jan 29, 2017
2cd5d26
DebugDrawer no longer needs to call activity’s lifecycle methods
Jan 29, 2017
7a3792d
Major Update (#87)
Jan 5, 2018
6856e2d
Setup publishing artifacts via bintray
Jan 5, 2018
1011e85
Merge pull request #88 from palaima/feature/setup-bintray
Jan 5, 2018
27f6aa2
Update android maven gradle plugin
Jan 5, 2018
65e1396
Release 0.8.0
Jan 5, 2018
02845bc
Merge pull request #89 from palaima/release/0.8.0
Jan 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ build/

# Local configuration file (sdk path, etc)
local.properties
signing.properties
*.jks

# Proguard folder generated by Eclipse
proguard/
Expand All @@ -27,20 +29,11 @@ proguard/

# Android Studio
.idea/
.gradle
/*/local.properties
/*/out
/*/*/build
/*/*/production
*.iml
*.iws
*.ipr

# Misc
*~
*.swp
signing.properties
build/

*.jks

# Mac OS
.DS_STORE
.DS_STORE
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,3 @@ Apache License
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

129 changes: 51 additions & 78 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# Android Debug Drawer

[![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)

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Debug%20Drawer-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/1892)

Faster development with Debug Drawer

![](./images/all.png)
![](./images/debug_drawer.gif)

## Features

Currently 13 modules exist:

`DeviceModule` - common information about your device

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

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

![](./images/log.png)
![](./images/timber.png)

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

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

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

`LogsModule` - Logcat and OkHttp network calls interceptor (requires extra dependency). Credits [Sloy](https://github.com/Sloy)

![](./images/logs.png)

`NetworkQualityModule` - Error/delay rate managing for network calls (requires extra dependency). Credits [Sloy](https://github.com/Sloy)

![](./images/network_quality.png)

## TODO
- Network delay/error adapters
- Take screenshot feature

You are always welcome to suggest modules!
Expand All @@ -73,104 +76,103 @@ Add Gradle dependencies:
#### `DebugDrawer`
```gradle
dependencies {
debugCompile 'io.palaima.debugdrawer:debugdrawer:0.7.0'
releaseCompile 'io.palaima.debugdrawer:debugdrawer-no-op:0.7.0'
debugImplementation 'io.palaima.debugdrawer:debugdrawer:0.8.0'
releaseImplementation 'io.palaima.debugdrawer:debugdrawer-no-op:0.8.0'
}
```

#### `DebugView`
```gradle
dependencies {
debugCompile 'io.palaima.debugdrawer:debugdrawer-view:0.7.0'
releaseCompile 'io.palaima.debugdrawer:debugdrawer-view-no-op:0.7.0'
debugImplementation 'io.palaima.debugdrawer:debugdrawer-view:0.8.0'
releaseImplementation 'io.palaima.debugdrawer:debugdrawer-view-no-op:0.8.0'
}
```

`BuildModule`, `DeviceModule`, `SettingsModule`, `NetworkModule`
```gradle
dependencies {
compile 'io.palaima.debugdrawer:debugdrawer-commons:0.7.0'
implementation 'io.palaima.debugdrawer:debugdrawer-commons:0.8.0'
}
```

`ActionsModule` - `ButtonAction`, `SwitchAction`, `SpinnerAction`
```gradle
dependencies {
compile 'io.palaima.debugdrawer:debugdrawer-actions:0.7.0'
implementation 'io.palaima.debugdrawer:debugdrawer-actions:0.8.0'
}
```

`OkHttpModule`, `OkHttp3Module`
[OkHttp](https://github.com/square/okhttp) library required
```gradle
dependencies {
compile 'io.palaima.debugdrawer:debugdrawer-okhttp:0.7.0'
compile 'io.palaima.debugdrawer:debugdrawer-okhttp3:0.7.0'
implementation 'io.palaima.debugdrawer:debugdrawer-okhttp:0.8.0'
implementation 'io.palaima.debugdrawer:debugdrawer-okhttp3:0.8.0'
}
```

`PicassoModule`
[Picasso](https://github.com/square/picasso) library required
```gradle
dependencies {
compile 'io.palaima.debugdrawer:debugdrawer-picasso:0.7.0'
implementation 'io.palaima.debugdrawer:debugdrawer-picasso:0.8.0'
}
```

`GlideModule`
[Glide](https://github.com/bumptech/glide) library required
```gradle
dependencies {
compile 'io.palaima.debugdrawer:debugdrawer-glide:0.7.0'
implementation 'io.palaima.debugdrawer:debugdrawer-glide:0.8.0'
}
```

`ScalpelModule`
[Scalpel](https://github.com/JakeWharton/scalpel) library required
```gradle
dependencies {
compile 'io.palaima.debugdrawer:debugdrawer-scalpel:0.7.0'
implementation 'io.palaima.debugdrawer:debugdrawer-scalpel:0.8.0'
}
```

`LocationModule`
```gradle
dependencies {
compile 'io.palaima.debugdrawer:debugdrawer-location:0.7.0'
implementation 'io.palaima.debugdrawer:debugdrawer-location:0.8.0'
}
```

`TimberModule`
[Timber](https://github.com/JakeWharton/timber) library required
```gradle
dependencies {
compile 'io.palaima.debugdrawer:debugdrawer-timber:0.7.0'
implementation 'io.palaima.debugdrawer:debugdrawer-timber:0.8.0'
}
```

`FpsModule`
[Takt](https://github.com/wasabeef/Takt) library required
```gradle
dependencies {
compile 'io.palaima.debugdrawer:debugdrawer-fps:0.7.0'
implementation 'io.palaima.debugdrawer:debugdrawer-fps:0.8.0'
}
```

You can try the SNAPSHOT version:

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

`NetworkQualityModule`
[OkHttp](https://github.com/square/okhttp) library required
```gradle
repositories {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
dependencies {
implementation 'io.palaima.debugdrawer:debugdrawer-network-quality:0.8.0'
}
```

Expand All @@ -180,31 +182,31 @@ repositories {

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

#### 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))
#### 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))

```java

private DebugDrawer debugDrawer;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...
//...

SwitchAction switchAction = new SwitchAction("Test switch", new SwitchAction.Listener() {
@Override
public void onCheckedChanged(boolean value) {
Toast.makeText(MainActivity.this, "Switch checked", Toast.LENGTH_LONG).show();
}
});

ButtonAction buttonAction = new ButtonAction("Test button", new ButtonAction.Listener() {
@Override
public void onClick() {
Toast.makeText(MainActivity.this, "Button clicked", Toast.LENGTH_LONG).show();
}
});

SpinnerAction<String> spinnerAction = new SpinnerAction<>(
Arrays.asList("First", "Second", "Third"),
new SpinnerAction.OnItemSelectedListener<String>() {
Expand All @@ -213,7 +215,7 @@ You could use `DebugDrawer` or `DebugView` depending on your needs
}
}
);

debugDrawer = new DebugDrawer.Builder(this)
.modules(
new ActionsModule(switchAction, buttonAction, spinnerAction),
Expand All @@ -232,37 +234,8 @@ You could use `DebugDrawer` or `DebugView` depending on your needs
}
```

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

```java

@Override
protected void onStart() {
super.onStart();
debugDrawer.onStart();
}

@Override
protected void onResume() {
super.onResume();
debugDrawer.onResume();
}

@Override
protected void onPause() {
super.onPause();
debugDrawer.onPause();
}

@Override
protected void onStop() {
super.onStop();
debugDrawer.onStop();
}
```

### 3. `TimberModule`
Don't forget to plant needed log trees in Application class. Tree that is used by `TimberModule` stored in `LumberYard` class.

Application class example:
Expand All @@ -273,10 +246,10 @@ Application class example:
@Override
public void onCreate() {
super.onCreate();

LumberYard lumberYard = LumberYard.getInstance(this);
lumberYard.cleanUp();

Timber.plant(lumberYard.tree());
Timber.plant(new Timber.DebugTree());
}
Expand All @@ -285,51 +258,51 @@ Application class example:

## Creating and Publishing Your Own Module

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

Module must implement `DebugModule` interface
Module must implement `DebugModule` interface or extend `DebugModuleAdapter` if you do not need lifecycle hooks

```java

public interface DebugModule {

/**
* Creates module view
*/
@NonNull View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent);

/**
* Override this method if you need to refresh
* some information when drawer is opened
*/
void onOpened();

/**
* Override this method if you need to stop
* some actions when drawer is closed
*/
void onClosed();

/**
* Override this method if you need to start
* some processes
*/
void onResume();

/**
* Override this method if you need to do
* some clean up
*/
void onPause();

/**
* Override this method if you need to start
* some processes that would be killed when
* onStop() is called
* E.g. register receivers
*/
void onStart();

/**
* Override this method if you need to do
* some clean up when activity goes to foreground.
Expand Down Expand Up @@ -390,4 +363,4 @@ License
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
Loading