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: about 1 month 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 (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-02-06T16:36:53.000Z (9 months ago)
- Last Synced: 2024-09-27T11:42:42.058Z (about 2 months ago)
- Language: Java
- Homepage: http://soundcloud.github.io/lightcycle/
- Size: 484 KB
- Stars: 705
- Watchers: 132
- 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
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.soundcloud.lightcycle/lightcycle-lib/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.soundcloud.lightcycle/lightcycle-lib) [![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0) [![Platform](https://img.shields.io/badge/platform-android-green.svg)](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"
}
```