LightCycle

Additional

Language
Java
Version
1.8.0 (Aug 7, 2020)
Created
Oct 2, 2014
Updated
Apr 9, 2023
Owner
SoundCloud (soundcloud)
Contributors
Jamie McDonald (jdamcd)
Matthias Käppler (mttkay)
Riccardo Ciovati (rciovati)
Fernando Cejas (android10)
Michael England (michaelengland)
Dorian Cussen (doridori)
Vadim Kotov (vkotovv)
Niko Yuwono (NikoYuwono)
Marvin Ramin (Mauin)
Guillaume Lung (glung)
SC-Mobile-CI (sc-mobile-ci)
Pavel Zagalsky (pzagalsky)
12
Activity
Badge
Generate
Download
Source code

Advertisement

LightCycle

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.

Examples

Build integration

Gradle:

ext.lightCycleVersion=<LATEST_VERSION>

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

buildscript {
  dependencies {
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
  }
}

apply plugin: 'com.neenbedankt.android-apt'

ext.lightCycleVersion=<LATEST_VERSION>

dependencies {
  compile "com.soundcloud.lightcycle:lightcycle-lib:$lightCycleVersion"
  apt "com.soundcloud.lightcycle:lightcycle-processor:$lightCycleVersion"
}