Skip to content

Added code syntax highlighting to Readme #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
88 changes: 44 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,46 +25,46 @@ Including in your project
Currently the library is only distributed through Maven central repository.

Gradle:

repositories {
mavenCentral()
}

dependencies {
compile 'co.lemonlabs:slidingdebugmenu:0.1.0'
}

```groovy
repositories {
mavenCentral()
}

dependencies {
compile 'co.lemonlabs:slidingdebugmenu:0.1.0'
}
```
Maven:

<dependency>
<groupId>co.lemonlabs</groupId>
<artifactId>slidingdebugmenu</artifactId>
<version>0.1.0</version>
</dependency>

```xml
<dependency>
<groupId>co.lemonlabs</groupId>
<artifactId>slidingdebugmenu</artifactId>
<version>0.1.0</version>
</dependency>
```
Usage
-----

The library supports Android 2.3+ and is currently only compatible with ActionBarCompat.

To use the default settings simply add this to your Activity's onCreate()

menu = SlidingDebugMenu.attach(this)

```java
menu = SlidingDebugMenu.attach(this)
```
and add lifecycle callbacks in your onStop() and onStart().

@Override
public void onStop() {
menu.onStop();
super.onStop();
}

@Override
public void onStart() {
super.onStart();
menu.onStart();
}

```java
@Override
public void onStop() {
menu.onStop();
super.onStop();
}

@Override
public void onStart() {
super.onStart();
menu.onStart();
}
```
Customization
-------------

Expand All @@ -73,24 +73,24 @@ you should override onStart() and onStop() if your module depends on the lifecyc
broadcast receivers, an EventBus, etc.

To attach a custom module to the debug drawer you can use one of:

menu = SlidingDebugMenu.attach(this)
menu.addModule(MenuModule module, boolean callOnStart)
menu.addModule(int position, MenuModule module, boolean callOnStart)

```java
menu = SlidingDebugMenu.attach(this)
menu.addModule(MenuModule module, boolean callOnStart)
menu.addModule(int position, MenuModule module, boolean callOnStart)
```
after attaching the drawer to an activity. Modules added this way will not persist after configuration changes or
reinitialization of the menu.

OR

Use a static module editor before attaching it to the activity.

SlidingDebugMenu.edit()
.add(CustomModule.class)
.remove(BuildModule.class)
.commit();
SlidingDebugMenu.attach(this)

```java
SlidingDebugMenu.edit()
.add(CustomModule.class)
.remove(BuildModule.class)
.commit();
SlidingDebugMenu.attach(this)
```
Using this method will automatically reinitialize every module on reinitialization and they could be shared between
multiple activities.

Expand Down