Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soundcloud/lightcycle
LightCycle lets self-contained classes respond to Android’s lifecycle events
https://github.com/soundcloud/lightcycle
Last synced: 2 days ago
JSON representation
LightCycle lets self-contained classes respond to Android’s lifecycle events
- Host: GitHub
- URL: https://github.com/soundcloud/lightcycle
- Owner: soundcloud
- License: apache-2.0
- Created: 2014-10-02T11:20:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-02-06T16:36:53.000Z (about 1 year ago)
- Last Synced: 2025-02-10T12:11:31.557Z (9 days ago)
- Language: Java
- Homepage: http://soundcloud.github.io/lightcycle/
- Size: 484 KB
- Stars: 704
- Watchers: 134
- Forks: 55
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# LightCycle
[](https://maven-badges.herokuapp.com/maven-central/com.soundcloud.lightcycle/lightcycle-lib) [](http://www.apache.org/licenses/LICENSE-2.0) [](http://developer.android.com/index.html)
LightCycle is an Android library that helps break logic out of `Activity` and `Fragment` classes into small, self-contained components called LightCycles.
Fields that are annotated `@LightCycle` and implement the LightCycle API within a `LightCycleActivity` or `LightCycleFragment` will be bound to that `Activity` or `Fragment` lifecycle.
For more information please see the [website](http://soundcloud.github.io/lightcycle/).
## Examples
- [basic](https://github.com/soundcloud/lightcycle/tree/master/examples/basic)
- ["real world"](https://github.com/soundcloud/lightcycle/tree/master/examples/real-world)## Build integration
Gradle:
```gradle
ext.lightCycleVersion=dependencies {
compile "com.soundcloud.lightcycle:lightcycle-lib:$lightCycleVersion"
annotationProcessor "com.soundcloud.lightcycle:lightcycle-processor:$lightCycleVersion"
}
```Or if you're using a version of the Android gradle plugin below `2.2.0`
```gradle
buildscript {
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}apply plugin: 'com.neenbedankt.android-apt'
ext.lightCycleVersion=
dependencies {
compile "com.soundcloud.lightcycle:lightcycle-lib:$lightCycleVersion"
apt "com.soundcloud.lightcycle:lightcycle-processor:$lightCycleVersion"
}
```