-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For applications, it allows presenters (LightCycles) to use views - w…
…hich can be implemented by Fragment or Activity classes. - Dispatcher: dispatch the Android life cycle (Activity, SupportFragment, Fragment) to LightCycles. - Host: the activity/fragment as viewed by the light cycle. It can be a view. - LightCycle: notified of the life cycle with the Host as a parameter. #48
- Loading branch information
Showing
33 changed files
with
406 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...al-world/src/main/java/com/soundcloud/lightcycle/sample/real_world/ApplicationModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...s/real-world/src/main/java/com/soundcloud/lightcycle/sample/real_world/home/HomeView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.soundcloud.lightcycle.sample.real_world.home; | ||
|
||
import com.soundcloud.lightcycle.sample.real_world.tracker.Screen; | ||
|
||
import android.support.annotation.StringRes; | ||
|
||
interface HomeView extends Screen { | ||
|
||
void sayHello(@StringRes int message); | ||
|
||
void showDescription(String title, String message); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...-world/src/main/java/com/soundcloud/lightcycle/sample/real_world/license/LicenseView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.soundcloud.lightcycle.sample.real_world.license; | ||
|
||
interface LicenseView { | ||
void showLicense(String text); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,4 @@ | |
|
||
public interface Screen { | ||
String getScreenName(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 11 additions & 12 deletions
23
lightcycle-api/src/main/java/com/soundcloud/lightcycle/ActivityLightCycle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
package com.soundcloud.lightcycle; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.view.MenuItem; | ||
|
||
public interface ActivityLightCycle<T extends Activity> { | ||
void onCreate(T activity, Bundle bundle); | ||
void onNewIntent(T activity, Intent intent); | ||
void onStart(T activity); | ||
void onResume(T activity); | ||
boolean onOptionsItemSelected(T activity, MenuItem item); | ||
void onPause(T activity); | ||
void onStop(T activity); | ||
void onSaveInstanceState(T activity, Bundle bundle); | ||
void onRestoreInstanceState(T activity, Bundle bundle); | ||
void onDestroy(T activity); | ||
public interface ActivityLightCycle<T> { | ||
void onCreate(T host, Bundle bundle); | ||
void onNewIntent(T host, Intent intent); | ||
void onStart(T host); | ||
void onResume(T host); | ||
boolean onOptionsItemSelected(T host, MenuItem item); | ||
void onPause(T host); | ||
void onStop(T host); | ||
void onSaveInstanceState(T host, Bundle bundle); | ||
void onRestoreInstanceState(T host, Bundle bundle); | ||
void onDestroy(T host); | ||
} |
Oops, something went wrong.