aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentContract.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-12-28 20:19:18 -0500
committerAllan Wang <me@allanwang.ca>2018-12-28 20:19:18 -0500
commite5e83736d3feff8ac9cc4ae38fad0fa827a6b21d (patch)
tree248e2886613e6eb30ae2e4a1196da2a484371aee /app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentContract.kt
parentc970d707105bbb614a630a1ac7340d6044e8fee1 (diff)
downloadfrost-e5e83736d3feff8ac9cc4ae38fad0fa827a6b21d.tar.gz
frost-e5e83736d3feff8ac9cc4ae38fad0fa827a6b21d.tar.bz2
frost-e5e83736d3feff8ac9cc4ae38fad0fa827a6b21d.zip
Switch remaining primary observables
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentContract.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentContract.kt12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentContract.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentContract.kt
index eaef17e5..10c612c5 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentContract.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentContract.kt
@@ -22,7 +22,7 @@ import com.pitchedapps.frost.contracts.FrostContentParent
import com.pitchedapps.frost.contracts.MainActivityContract
import com.pitchedapps.frost.contracts.MainFabContract
import com.pitchedapps.frost.views.FrostRecyclerView
-import io.reactivex.disposables.Disposable
+import kotlinx.coroutines.channels.ReceiveChannel
/**
* Created by Allan Wang on 2017-11-07.
@@ -34,8 +34,9 @@ interface FragmentContract : FrostContentContainer {
/**
* Defines whether the fragment is valid in the viewpager
- * Or if it needs to be recreated
- * May be called from any thread to toggle status
+ * or if it needs to be recreated
+ * May be called from any thread to toggle status.
+ * Note that calls beyond the fragment lifecycle will be ignored
*/
var valid: Boolean
@@ -75,9 +76,10 @@ interface FragmentContract : FrostContentContainer {
/**
* Call whenever a fragment is attached so that it may listen
- * to activity emissions
+ * to activity emissions.
+ * Returns a means of closing the listener, which can be called from [detachMainObservable]
*/
- fun attachMainObservable(contract: MainActivityContract): Disposable
+ fun attachMainObservable(contract: MainActivityContract): ReceiveChannel<Int>
/**
* Call when fragment is detached so that any existing