https://github.com/prolificinteractive/birdo
Prolific's android wrapper around the UI code that is often needed for displaying debug menus.
https://github.com/prolificinteractive/birdo
android debug kotlin
Last synced: about 1 month ago
JSON representation
Prolific's android wrapper around the UI code that is often needed for displaying debug menus.
- Host: GitHub
- URL: https://github.com/prolificinteractive/birdo
- Owner: prolificinteractive
- License: mit
- Created: 2018-07-19T21:07:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-25T15:51:49.000Z (almost 7 years ago)
- Last Synced: 2025-03-14T01:46:23.776Z (over 1 year ago)
- Topics: android, debug, kotlin
- Language: Kotlin
- Homepage:
- Size: 292 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Birdo
[](https://travis-ci.org/prolificinteractive/Birdo) [](https://jitpack.io/#prolificinteractive/birdo)
Prolific's wrapper for debugging their application.
Birdo is based on DebugDrawer (https://github.com/palaima/DebugDrawer).
## Installation
Step 1. Add the JitPack repository to your build file
```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
Step 2. Add the dependency
```groovy
dependencies {
implementation 'com.github.prolificinteractive:birdo:${birdoVersion}'
}
```
## Usage
```kotlin
class App : Application() {
override fun onCreate() {
super.onCreate()
// Add this to your application class. Detect shakes and launch the default Birdo view.
ShakerDetector(this, BirdoInitializer(this))
}
}
```
## Customization
### Detectors
The detectors are utility classes that will launch Birdo upon a certain set of predefined user actions.
#### ShakerDetector
The shaker detector is simply relying on shakes movement to launch Birdo. To use it, simply initialize the detector in your application class, like so:
```kotlin
class App : Application() {
override fun onCreate() {
super.onCreate()
// Add this to your application class. Detect shakes and launch the default Birdo view.
ShakerDetector(this, BirdoInitializer(this))
}
}
```
#### VolumeDownDetector
The volume down detector is looking for the user pressing 3 times volume down. To use it, you should add the detector to your base activity:
```kotlin
open abstract class BaseActivity : AppCompatActivity() {
private lateinit var keyUpDetector: KeyUpDetector
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
keyUpDetector = VolumeDownDetector(BirdoInitializer(this))
}
override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
keyUpDetector.onKeyUp(this, keyCode, event)
return super.onKeyUp(keyCode, event)
}
}
```
Feel free to implement your own version of KeyUpDetector with your own combination of keys.
#### Your Own
You can also simply launch Birdo your way:
```kotlin
val birdoInitializer = BirdoInitializer(this)
button.setOnClickListener { birdoInitializer.start(this) }
```
### Custom Birdo Modules
Birdo comes with a set of predefined modules. You can always customize Birdo by providing your own implementation to the BirdoInitializer.
For example:
```kotlin
ShakerDetector(this, BirdoInitializer(this, MyBirdoActivity::class.java))
```
Extending of BirdoActivity allows you to provide your Picasso or OkHttpClient instance, and provide your own custom modules.
## Contributing to Birdo
To report a bug or enhancement request, feel free to file an issue under the respective heading.
If you wish to contribute to the project, fork this repo and submit a pull request. Code contributions should follow the standards specified in the [Prolific Android Style Guide](https://github.com/prolificinteractive/android-code-styles).
## License

Copyright (c) 2019 Prolific Interactive
Birdo is maintained and sponsored by Prolific Interactive. It may be redistributed under the terms specified in the [LICENSE] file.
[LICENSE]: ./LICENSE