diff --git a/example/src/main/AndroidManifest.xml b/example/src/main/AndroidManifest.xml index 3ee3c08..55a2691 100644 --- a/example/src/main/AndroidManifest.xml +++ b/example/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - () { - - override fun createInitialState(): CounterState { - return CounterState(counter = 0) - } - - override fun bind(actions: Observable>) { - val incrementAction = actions.ofActionType() - val decrementAction = actions.ofActionType() - - incrementAction - .map { IncrementReducer } - .bindToView() - - decrementAction - .map { DecrementReducer } - .bindToView() - - stateObservable - .getChange { it.counter } - .filter { it % 5 == 0 && it != 0 } - .map { ShowNumberIsDivisibleByFiveToast } - .bindToView() - } -} diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterEvents.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterEvents.kt deleted file mode 100644 index 23c3ff8..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterEvents.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.sumera.koreactor.ui.feature.counter.contract - -import com.sumera.koreactorlib.reactor.data.MviEvent - -sealed class CounterEvents: MviEvent - -object ShowNumberIsDivisibleByFiveToast : CounterEvents() \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterState.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterState.kt deleted file mode 100644 index 7d0f8cb..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterState.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.sumera.koreactor.ui.feature.counter.contract - -import com.sumera.koreactorlib.reactor.data.MviState - -data class CounterState( - val counter: Int -): MviState diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityActivityModule.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityActivityModule.kt deleted file mode 100644 index 172b59f..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityActivityModule.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.sumera.koreactor.ui.feature.infinity - -import android.app.Activity -import com.sumera.koreactor.injection.base.BaseActivityModule -import com.sumera.koreactor.ui.feature.todo.ToDoActivity -import com.sumera.koreactor.injection.PerActivity -import dagger.Binds -import dagger.Module - -@Module(includes = [BaseActivityModule::class]) -abstract class InfinityActivityModule { - - @Binds - @PerActivity - abstract fun activity(toDoActivity: ToDoActivity): Activity -} \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityEvents.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityEvents.kt deleted file mode 100644 index cb93178..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityEvents.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.sumera.koreactor.ui.feature.infinity.contract - -import com.sumera.koreactorlib.reactor.data.MviEvent - -sealed class InfinityEvents : MviEvent - -object NavigateToDetailEvent : InfinityEvents() diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/main/MainReactor.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/main/MainReactor.kt deleted file mode 100644 index dba18dc..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/main/MainReactor.kt +++ /dev/null @@ -1,54 +0,0 @@ -package com.sumera.koreactor.ui.feature.main - -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviAction -import com.sumera.koreactor.ui.feature.main.contract.MainState -import com.sumera.koreactor.ui.feature.main.contract.NavigateToCounterEvent -import com.sumera.koreactor.ui.feature.main.contract.NavigateToInfinityEvent -import com.sumera.koreactor.ui.feature.main.contract.NavigateToSimpleLoadingEvent -import com.sumera.koreactor.ui.feature.main.contract.NavigateToTimerEvent -import com.sumera.koreactor.ui.feature.main.contract.NavigateToToDoEvent -import com.sumera.koreactor.ui.feature.main.contract.OnCounterButtonCLickAction -import com.sumera.koreactor.ui.feature.main.contract.OnInfinityButtonClickAction -import com.sumera.koreactor.ui.feature.main.contract.OnSimpleLoadingButtonClickAction -import com.sumera.koreactor.ui.feature.main.contract.OnTimerButtonClickAction -import com.sumera.koreactor.ui.feature.main.contract.OnToDoButtonClickAction -import com.sumera.koreactor.injection.PerActivity -import io.reactivex.Observable -import javax.inject.Inject - -@PerActivity -class MainReactor @Inject constructor() : MviReactor() { - - override fun createInitialState(): MainState { - return MainState - } - - override fun bind(actions: Observable>) { - val counterAction = actions.ofActionType() - val todoAction = actions.ofActionType() - val infinityAction = actions.ofActionType() - val simpleLoadingAction = actions.ofActionType() - val timerAction = actions.ofActionType() - - counterAction - .map { NavigateToCounterEvent } - .bindToView() - - todoAction - .map { NavigateToToDoEvent } - .bindToView() - - infinityAction - .map { NavigateToInfinityEvent } - .bindToView() - - simpleLoadingAction - .map { NavigateToSimpleLoadingEvent } - .bindToView() - - timerAction - .map { NavigateToTimerEvent } - .bindToView() - } -} diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/main/contract/MainState.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/main/contract/MainState.kt deleted file mode 100644 index 88bd427..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/main/contract/MainState.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.sumera.koreactor.ui.feature.main.contract - -import com.sumera.koreactorlib.reactor.data.MviState - -object MainState : MviState diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingReactor.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingReactor.kt deleted file mode 100644 index d3d11a7..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingReactor.kt +++ /dev/null @@ -1,40 +0,0 @@ -package com.sumera.koreactor.ui.feature.simpleloading - -import com.sumera.koreactorlib.behaviour.ObservableWorker -import com.sumera.koreactorlib.behaviour.implementation.LoadingBehaviour -import com.sumera.koreactorlib.behaviour.messages -import com.sumera.koreactorlib.behaviour.triggers -import com.sumera.koreactor.domain.GetSomeTextDataInteractor -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviAction -import com.sumera.koreactor.ui.feature.simpleloading.contract.RetryClicked -import com.sumera.koreactor.ui.feature.simpleloading.contract.ShowData -import com.sumera.koreactor.ui.feature.simpleloading.contract.ShowError -import com.sumera.koreactor.ui.feature.simpleloading.contract.ShowLoading -import com.sumera.koreactor.ui.feature.simpleloading.contract.SimpleLoadingState -import com.sumera.koreactor.injection.PerActivity -import io.reactivex.Observable -import javax.inject.Inject - -@PerActivity -class SimpleLoadingReactor @Inject constructor( - private val dataLoader: GetSomeTextDataInteractor -) : MviReactor() { - - override fun createInitialState(): SimpleLoadingState { - return SimpleLoadingState(isError = false, isLoading = false, data = null) - } - - override fun bind(actions: Observable>) { - val retryClicks = actions.ofActionType() - - LoadingBehaviour( - triggers = triggers(attachLifecycleObservable, retryClicks), - loadWorker = ObservableWorker{ dataLoader.execute() }, - cancelPrevious = true, - loadingMessage = messages({ ShowLoading }), - errorMessage = messages({ ShowError }), - dataMessage = messages({ ShowData(it) }) - ).bindToView() - } -} \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/contract/SimpleLoadingActions.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/contract/SimpleLoadingActions.kt deleted file mode 100644 index 6cacce2..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/contract/SimpleLoadingActions.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.sumera.koreactor.ui.feature.simpleloading.contract - -import com.sumera.koreactorlib.reactor.data.MviAction - -sealed class SimpleLoadingActions : MviAction - -object RetryClicked : SimpleLoadingActions() \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/contract/SimpleLoadingState.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/contract/SimpleLoadingState.kt deleted file mode 100644 index 0f70082..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/contract/SimpleLoadingState.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.sumera.koreactor.ui.feature.simpleloading.contract - -import com.sumera.koreactorlib.reactor.data.MviState - -data class SimpleLoadingState( - val isLoading: Boolean, - val isError: Boolean, - val data: String? -) : MviState diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/activity/TimerActivity.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/timer/activity/TimerActivity.kt deleted file mode 100644 index ea15f3d..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/activity/TimerActivity.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.sumera.koreactor.ui.feature.timer.activity - -import com.sumera.koreactor.R -import com.sumera.koreactor.ui.base.stateless.StatelessActivity - -class TimerActivity: StatelessActivity() { - - override val layoutRes: Int - get() = R.layout.activity_timer -} diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/contract/TimerActions.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/timer/contract/TimerActions.kt deleted file mode 100644 index 524a3f8..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/contract/TimerActions.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.sumera.koreactor.ui.feature.timer.contract - -import com.sumera.koreactorlib.reactor.data.MviAction - -sealed class TimerAction: MviAction - -object ResetTimerAction: TimerAction() diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/contract/TimerState.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/timer/contract/TimerState.kt deleted file mode 100644 index 30e1368..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/contract/TimerState.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.sumera.koreactor.ui.feature.timer.contract - -import com.sumera.koreactorlib.reactor.data.MviState - -data class TimerState( - val timerValue: Int -): MviState diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoActivityModule.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoActivityModule.kt deleted file mode 100644 index 192b60b..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoActivityModule.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.sumera.koreactor.ui.feature.todo - -import android.app.Activity -import com.sumera.koreactor.injection.PerActivity -import com.sumera.koreactor.injection.base.BaseActivityModule -import com.sumera.koreactor.ui.feature.infinity.InfinityActivity -import dagger.Binds -import dagger.Module - -@Module(includes = [BaseActivityModule::class]) -abstract class ToDoActivityModule { - - @Binds - @PerActivity - abstract fun activity(toDoActivity: InfinityActivity): Activity -} \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/adapter/ToDoItemWrapper.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/todo/adapter/ToDoItemWrapper.kt deleted file mode 100644 index 9bd336c..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/adapter/ToDoItemWrapper.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.sumera.koreactor.ui.feature.todo.adapter - -import com.sumera.koreactor.data.ToDoItem - -data class ToDoItemWrapper( - val toDoItem: ToDoItem, - val isLoading: Boolean, - val isCompleted: Boolean -) \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoState.kt b/example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoState.kt deleted file mode 100644 index 947bc26..0000000 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoState.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.sumera.koreactor.ui.feature.todo.contract - -import com.sumera.koreactorlib.reactor.data.MviState -import com.sumera.koreactor.ui.feature.todo.adapter.ToDoItemWrapper - -data class ToDoState( - val isLoading: Boolean, - val isSwipeLoading: Boolean, - val isError: Boolean, - val infoMessage: String, - val data: List? -) : MviState diff --git a/example/src/main/java/com/sumera/koreactor/App.kt b/example/src/main/java/com/sumera/koreactorexampleapp/App.kt similarity index 85% rename from example/src/main/java/com/sumera/koreactor/App.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/App.kt index 239d889..072bdb3 100644 --- a/example/src/main/java/com/sumera/koreactor/App.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/App.kt @@ -1,8 +1,8 @@ -package com.sumera.koreactor +package com.sumera.koreactorexampleapp import android.app.Activity import android.app.Application -import com.sumera.koreactor.injection.DaggerAppComponent +import com.sumera.koreactorexampleapp.injection.DaggerAppComponent import dagger.android.AndroidInjector import dagger.android.DispatchingAndroidInjector import dagger.android.HasActivityInjector diff --git a/example/src/main/java/com/sumera/koreactor/data/ToDoItem.kt b/example/src/main/java/com/sumera/koreactorexampleapp/data/ToDoItem.kt similarity index 71% rename from example/src/main/java/com/sumera/koreactor/data/ToDoItem.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/data/ToDoItem.kt index d44418d..d13f7a1 100644 --- a/example/src/main/java/com/sumera/koreactor/data/ToDoItem.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/data/ToDoItem.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.data +package com.sumera.koreactorexampleapp.data open class ToDoItem( val id: Int, diff --git a/example/src/main/java/com/sumera/koreactor/domain/GetSomeTextDataInteractor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/domain/GetSomeTextDataInteractor.kt similarity index 72% rename from example/src/main/java/com/sumera/koreactor/domain/GetSomeTextDataInteractor.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/domain/GetSomeTextDataInteractor.kt index 14da2dc..475bd15 100644 --- a/example/src/main/java/com/sumera/koreactor/domain/GetSomeTextDataInteractor.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/domain/GetSomeTextDataInteractor.kt @@ -1,6 +1,6 @@ -package com.sumera.koreactor.domain +package com.sumera.koreactorexampleapp.domain -import com.sumera.koreactor.domain.base.BaseObservableInteractor +import com.sumera.koreactorexampleapp.domain.base.BaseObservableInteractor import io.reactivex.Observable import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactor/domain/GetToDoItemsOnceInteractor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/domain/GetToDoItemsOnceInteractor.kt similarity index 74% rename from example/src/main/java/com/sumera/koreactor/domain/GetToDoItemsOnceInteractor.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/domain/GetToDoItemsOnceInteractor.kt index ccd7b36..4b09929 100644 --- a/example/src/main/java/com/sumera/koreactor/domain/GetToDoItemsOnceInteractor.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/domain/GetToDoItemsOnceInteractor.kt @@ -1,8 +1,8 @@ -package com.sumera.koreactor.domain +package com.sumera.koreactorexampleapp.domain -import com.sumera.koreactor.data.ToDoItem -import com.sumera.koreactor.domain.base.BaseObservableInteractor -import com.sumera.koreactor.ui.feature.todo.adapter.ToDoItemWrapper +import com.sumera.koreactorexampleapp.data.ToDoItem +import com.sumera.koreactorexampleapp.domain.base.BaseObservableInteractor +import com.sumera.koreactorexampleapp.ui.feature.todo.adapter.ToDoItemWrapper import io.reactivex.Observable import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactor/domain/SaveToDoItemInteractor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/domain/SaveToDoItemInteractor.kt similarity index 72% rename from example/src/main/java/com/sumera/koreactor/domain/SaveToDoItemInteractor.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/domain/SaveToDoItemInteractor.kt index 148b60b..fb2883a 100644 --- a/example/src/main/java/com/sumera/koreactor/domain/SaveToDoItemInteractor.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/domain/SaveToDoItemInteractor.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.domain +package com.sumera.koreactorexampleapp.domain -import com.sumera.koreactor.data.ToDoItem -import com.sumera.koreactor.domain.base.BaseObservableInteractor +import com.sumera.koreactorexampleapp.data.ToDoItem +import com.sumera.koreactorexampleapp.domain.base.BaseObservableInteractor import io.reactivex.Observable import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactor/domain/base/BaseCompletableInteractor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseCompletableInteractor.kt similarity index 87% rename from example/src/main/java/com/sumera/koreactor/domain/base/BaseCompletableInteractor.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseCompletableInteractor.kt index c0dfbb1..c6a52ca 100644 --- a/example/src/main/java/com/sumera/koreactor/domain/base/BaseCompletableInteractor.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseCompletableInteractor.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.domain.base +package com.sumera.koreactorexampleapp.domain.base import io.reactivex.Completable import io.reactivex.schedulers.Schedulers diff --git a/example/src/main/java/com/sumera/koreactor/domain/base/BaseFlowableInteractor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseFlowableInteractor.kt similarity index 87% rename from example/src/main/java/com/sumera/koreactor/domain/base/BaseFlowableInteractor.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseFlowableInteractor.kt index 2ece3e9..8b5da28 100644 --- a/example/src/main/java/com/sumera/koreactor/domain/base/BaseFlowableInteractor.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseFlowableInteractor.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.domain.base +package com.sumera.koreactorexampleapp.domain.base import io.reactivex.Flowable import io.reactivex.schedulers.Schedulers diff --git a/example/src/main/java/com/sumera/koreactor/domain/base/BaseObservableInteractor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseObservableInteractor.kt similarity index 86% rename from example/src/main/java/com/sumera/koreactor/domain/base/BaseObservableInteractor.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseObservableInteractor.kt index 6de4494..a247a66 100644 --- a/example/src/main/java/com/sumera/koreactor/domain/base/BaseObservableInteractor.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseObservableInteractor.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.domain.base +package com.sumera.koreactorexampleapp.domain.base import io.reactivex.Observable import io.reactivex.schedulers.Schedulers diff --git a/example/src/main/java/com/sumera/koreactor/domain/base/BaseSingleInteractor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseSingleInteractor.kt similarity index 86% rename from example/src/main/java/com/sumera/koreactor/domain/base/BaseSingleInteractor.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseSingleInteractor.kt index 903da1d..e112557 100644 --- a/example/src/main/java/com/sumera/koreactor/domain/base/BaseSingleInteractor.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/domain/base/BaseSingleInteractor.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.domain.base +package com.sumera.koreactorexampleapp.domain.base import io.reactivex.Single import io.reactivex.schedulers.Schedulers diff --git a/example/src/main/java/com/sumera/koreactor/injection/AppComponent.kt b/example/src/main/java/com/sumera/koreactorexampleapp/injection/AppComponent.kt similarity index 65% rename from example/src/main/java/com/sumera/koreactor/injection/AppComponent.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/injection/AppComponent.kt index cf3a29a..6966be1 100644 --- a/example/src/main/java/com/sumera/koreactor/injection/AppComponent.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/injection/AppComponent.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.injection +package com.sumera.koreactorexampleapp.injection -import com.sumera.koreactor.App -import com.sumera.koreactor.injection.modules.AppModule +import com.sumera.koreactorexampleapp.App +import com.sumera.koreactorexampleapp.injection.modules.AppModule import dagger.Component import dagger.android.AndroidInjector import javax.inject.Singleton diff --git a/example/src/main/java/com/sumera/koreactor/injection/Qualifiers.kt b/example/src/main/java/com/sumera/koreactorexampleapp/injection/Qualifiers.kt similarity index 71% rename from example/src/main/java/com/sumera/koreactor/injection/Qualifiers.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/injection/Qualifiers.kt index 6de9ebc..2a0c38f 100644 --- a/example/src/main/java/com/sumera/koreactor/injection/Qualifiers.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/injection/Qualifiers.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.injection +package com.sumera.koreactorexampleapp.injection import javax.inject.Qualifier diff --git a/example/src/main/java/com/sumera/koreactor/injection/Scopes.kt b/example/src/main/java/com/sumera/koreactorexampleapp/injection/Scopes.kt similarity index 84% rename from example/src/main/java/com/sumera/koreactor/injection/Scopes.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/injection/Scopes.kt index 5adad9b..b112333 100644 --- a/example/src/main/java/com/sumera/koreactor/injection/Scopes.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/injection/Scopes.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.injection +package com.sumera.koreactorexampleapp.injection import javax.inject.Scope diff --git a/example/src/main/java/com/sumera/koreactor/injection/base/BaseActivityModule.kt b/example/src/main/java/com/sumera/koreactorexampleapp/injection/base/BaseActivityModule.kt similarity index 56% rename from example/src/main/java/com/sumera/koreactor/injection/base/BaseActivityModule.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/injection/base/BaseActivityModule.kt index e34480a..ba171eb 100644 --- a/example/src/main/java/com/sumera/koreactor/injection/base/BaseActivityModule.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/injection/base/BaseActivityModule.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.injection.base +package com.sumera.koreactorexampleapp.injection.base import dagger.Module diff --git a/example/src/main/java/com/sumera/koreactor/injection/base/BaseFragmentModule.kt b/example/src/main/java/com/sumera/koreactorexampleapp/injection/base/BaseFragmentModule.kt similarity index 56% rename from example/src/main/java/com/sumera/koreactor/injection/base/BaseFragmentModule.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/injection/base/BaseFragmentModule.kt index 36e3058..31b5f65 100644 --- a/example/src/main/java/com/sumera/koreactor/injection/base/BaseFragmentModule.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/injection/base/BaseFragmentModule.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.injection.base +package com.sumera.koreactorexampleapp.injection.base import dagger.Module diff --git a/example/src/main/java/com/sumera/koreactor/injection/modules/AppModule.kt b/example/src/main/java/com/sumera/koreactorexampleapp/injection/modules/AppModule.kt similarity index 54% rename from example/src/main/java/com/sumera/koreactor/injection/modules/AppModule.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/injection/modules/AppModule.kt index fcc79d6..dcc42b6 100644 --- a/example/src/main/java/com/sumera/koreactor/injection/modules/AppModule.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/injection/modules/AppModule.kt @@ -1,25 +1,25 @@ -package com.sumera.koreactor.injection.modules +package com.sumera.koreactorexampleapp.injection.modules import android.app.Application import android.content.Context -import com.sumera.koreactor.App -import com.sumera.koreactor.injection.ApplicationContext -import com.sumera.koreactor.injection.PerActivity -import com.sumera.koreactor.injection.PerFragment -import com.sumera.koreactor.ui.feature.counter.CounterActivity -import com.sumera.koreactor.ui.feature.counter.CounterActivityModule -import com.sumera.koreactor.ui.feature.infinity.InfinityActivity -import com.sumera.koreactor.ui.feature.infinity.InfinityActivityModule -import com.sumera.koreactor.ui.feature.main.MainActivity -import com.sumera.koreactor.ui.feature.main.MainActivityModule -import com.sumera.koreactor.ui.feature.simpleloading.SimpleLoadingActivity -import com.sumera.koreactor.ui.feature.simpleloading.SimpleLoadingActivityModule -import com.sumera.koreactor.ui.feature.timer.TimerFragment -import com.sumera.koreactor.ui.feature.timer.TimerFragmentModule -import com.sumera.koreactor.ui.feature.timer.activity.TimerActivity -import com.sumera.koreactor.ui.feature.timer.activity.TimerActivityModule -import com.sumera.koreactor.ui.feature.todo.ToDoActivity -import com.sumera.koreactor.ui.feature.todo.ToDoActivityModule +import com.sumera.koreactorexampleapp.App +import com.sumera.koreactorexampleapp.injection.ApplicationContext +import com.sumera.koreactorexampleapp.injection.PerActivity +import com.sumera.koreactorexampleapp.injection.PerFragment +import com.sumera.koreactorexampleapp.ui.feature.counter.CounterActivity +import com.sumera.koreactorexampleapp.ui.feature.counter.CounterActivityModule +import com.sumera.koreactorexampleapp.ui.feature.infinity.InfinityActivity +import com.sumera.koreactorexampleapp.ui.feature.infinity.InfinityActivityModule +import com.sumera.koreactorexampleapp.ui.feature.main.MainActivity +import com.sumera.koreactorexampleapp.ui.feature.main.MainActivityModule +import com.sumera.koreactorexampleapp.ui.feature.simpleloading.SimpleLoadingActivity +import com.sumera.koreactorexampleapp.ui.feature.simpleloading.SimpleLoadingActivityModule +import com.sumera.koreactorexampleapp.ui.feature.timer.TimerFragment +import com.sumera.koreactorexampleapp.ui.feature.timer.TimerFragmentModule +import com.sumera.koreactorexampleapp.ui.feature.timer.activity.TimerActivity +import com.sumera.koreactorexampleapp.ui.feature.timer.activity.TimerActivityModule +import com.sumera.koreactorexampleapp.ui.feature.todo.ToDoActivity +import com.sumera.koreactorexampleapp.ui.feature.todo.ToDoActivityModule import dagger.Binds import dagger.Module import dagger.android.AndroidInjectionModule diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/injection/modules/NetworkModule.kt b/example/src/main/java/com/sumera/koreactorexampleapp/injection/modules/NetworkModule.kt new file mode 100644 index 0000000..b825982 --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/injection/modules/NetworkModule.kt @@ -0,0 +1,8 @@ +package com.sumera.koreactorexampleapp.injection.modules + +import dagger.Module + +@Module +class NetworkModule { + +} diff --git a/example/src/main/java/com/sumera/koreactor/tools/extensions/List.kt b/example/src/main/java/com/sumera/koreactorexampleapp/tools/extensions/List.kt similarity index 78% rename from example/src/main/java/com/sumera/koreactor/tools/extensions/List.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/tools/extensions/List.kt index 92ab8f3..653ee58 100644 --- a/example/src/main/java/com/sumera/koreactor/tools/extensions/List.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/tools/extensions/List.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.tools.extensions +package com.sumera.koreactorexampleapp.tools.extensions inline fun List.replaceWithPredicate(predicate: (T) -> Boolean, transform: (T) -> T) : List { return map { data -> diff --git a/example/src/main/java/com/sumera/koreactor/tools/extensions/View.kt b/example/src/main/java/com/sumera/koreactorexampleapp/tools/extensions/View.kt similarity index 77% rename from example/src/main/java/com/sumera/koreactor/tools/extensions/View.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/tools/extensions/View.kt index 1b33a2a..afa846e 100644 --- a/example/src/main/java/com/sumera/koreactor/tools/extensions/View.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/tools/extensions/View.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.tools.extensions +package com.sumera.koreactorexampleapp.tools.extensions import android.view.View diff --git a/example/src/main/java/com/sumera/koreactor/ui/base/BaseActivity.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/BaseActivity.kt similarity index 82% rename from example/src/main/java/com/sumera/koreactor/ui/base/BaseActivity.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/base/BaseActivity.kt index af4d676..1ae73b9 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/base/BaseActivity.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/BaseActivity.kt @@ -1,9 +1,9 @@ -package com.sumera.koreactor.ui.base +package com.sumera.koreactorexampleapp.ui.base import android.os.Bundle import android.support.v4.app.Fragment -import com.sumera.koreactor.MviAppCompatActivityDelegate -import com.sumera.koreactorlib.reactor.data.MviState +import com.sumera.koreactor.view.implementation.MviAppCompatActivityDelegate +import com.sumera.koreactor.reactor.data.MviState import dagger.android.AndroidInjection import dagger.android.AndroidInjector import dagger.android.DispatchingAndroidInjector diff --git a/example/src/main/java/com/sumera/koreactor/ui/base/BaseFragment.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/BaseFragment.kt similarity index 87% rename from example/src/main/java/com/sumera/koreactor/ui/base/BaseFragment.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/base/BaseFragment.kt index 05431ea..54af96c 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/base/BaseFragment.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/BaseFragment.kt @@ -1,12 +1,12 @@ -package com.sumera.koreactor.ui.base +package com.sumera.koreactorexampleapp.ui.base import android.os.Bundle import android.support.v4.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import com.sumera.koreactor.MviFragmentDelegate -import com.sumera.koreactorlib.reactor.data.MviState +import com.sumera.koreactor.view.implementation.MviFragmentDelegate +import com.sumera.koreactor.reactor.data.MviState import dagger.android.AndroidInjector import dagger.android.DispatchingAndroidInjector import dagger.android.support.AndroidSupportInjection diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/EmptyState.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/EmptyState.kt new file mode 100644 index 0000000..a0e378c --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/EmptyState.kt @@ -0,0 +1,5 @@ +package com.sumera.koreactorexampleapp.ui.base.stateless + +import com.sumera.koreactor.reactor.data.MviState + +object EmptyState: MviState \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactor/ui/base/stateless/StatelessActivity.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/StatelessActivity.kt similarity index 64% rename from example/src/main/java/com/sumera/koreactor/ui/base/stateless/StatelessActivity.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/StatelessActivity.kt index db5ce9a..61cc877 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/base/stateless/StatelessActivity.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/StatelessActivity.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.base.stateless +package com.sumera.koreactorexampleapp.ui.base.stateless -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactor.ui.base.BaseActivity +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactorexampleapp.ui.base.BaseActivity import javax.inject.Inject abstract class StatelessActivity: BaseActivity() { diff --git a/example/src/main/java/com/sumera/koreactor/ui/base/stateless/StatelessReactor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/StatelessReactor.kt similarity index 60% rename from example/src/main/java/com/sumera/koreactor/ui/base/stateless/StatelessReactor.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/StatelessReactor.kt index 0dd588b..d91d280 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/base/stateless/StatelessReactor.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/StatelessReactor.kt @@ -1,8 +1,8 @@ -package com.sumera.koreactor.ui.base.stateless +package com.sumera.koreactorexampleapp.ui.base.stateless -import com.sumera.koreactor.injection.PerActivity -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviAction +import com.sumera.koreactorexampleapp.injection.PerActivity +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviAction import io.reactivex.Observable import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactor/ui/base/stateless/StatelessReactorFactory.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/StatelessReactorFactory.kt similarity index 64% rename from example/src/main/java/com/sumera/koreactor/ui/base/stateless/StatelessReactorFactory.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/StatelessReactorFactory.kt index 5e82e77..78b959f 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/base/stateless/StatelessReactorFactory.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/base/stateless/StatelessReactorFactory.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.base.stateless +package com.sumera.koreactorexampleapp.ui.base.stateless -import com.sumera.koreactor.injection.PerActivity -import com.sumera.koreactorlib.reactor.MviReactorFactory +import com.sumera.koreactorexampleapp.injection.PerActivity +import com.sumera.koreactor.reactor.MviReactorFactory import javax.inject.Inject import javax.inject.Provider diff --git a/example/src/main/java/com/sumera/koreactor/ui/common/PlaceholderLayout.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/common/PlaceholderLayout.kt similarity index 95% rename from example/src/main/java/com/sumera/koreactor/ui/common/PlaceholderLayout.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/common/PlaceholderLayout.kt index 8f3353b..eb1e26c 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/common/PlaceholderLayout.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/common/PlaceholderLayout.kt @@ -1,11 +1,11 @@ -package com.sumera.koreactor.ui.common +package com.sumera.koreactorexampleapp.ui.common import android.content.Context import android.util.AttributeSet import android.view.View import android.widget.FrameLayout import com.jakewharton.rxbinding2.view.clicks -import com.sumera.koreactor.R +import com.sumera.koreactorexampleapp.R import io.reactivex.Observable import kotlinx.android.synthetic.main.view_placeholder_layout.view.* diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/CounterActivity.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterActivity.kt similarity index 65% rename from example/src/main/java/com/sumera/koreactor/ui/feature/counter/CounterActivity.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterActivity.kt index 1b701d8..eb1296c 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/CounterActivity.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterActivity.kt @@ -1,17 +1,17 @@ -package com.sumera.koreactor.ui.feature.counter +package com.sumera.koreactorexampleapp.ui.feature.counter import android.os.Bundle import android.widget.Toast import com.jakewharton.rxbinding2.view.clicks -import com.sumera.koreactor.R -import com.sumera.koreactor.ui.base.BaseActivity -import com.sumera.koreactor.ui.feature.counter.contract.CounterState -import com.sumera.koreactor.ui.feature.counter.contract.DecrementAction -import com.sumera.koreactor.ui.feature.counter.contract.IncrementAction -import com.sumera.koreactor.ui.feature.counter.contract.ShowNumberIsDivisibleByFiveToast -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviEvent -import com.sumera.koreactorlib.util.extension.getChange +import com.sumera.koreactorexampleapp.R +import com.sumera.koreactorexampleapp.ui.base.BaseActivity +import com.sumera.koreactorexampleapp.ui.feature.counter.contract.CounterState +import com.sumera.koreactorexampleapp.ui.feature.counter.contract.DecrementAction +import com.sumera.koreactorexampleapp.ui.feature.counter.contract.IncrementAction +import com.sumera.koreactorexampleapp.ui.feature.counter.contract.ShowNumberIsDivisibleByFiveToast +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactor.util.extension.getChange import io.reactivex.Observable import kotlinx.android.synthetic.main.activity_counter.* import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/CounterActivityModule.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterActivityModule.kt similarity index 56% rename from example/src/main/java/com/sumera/koreactor/ui/feature/counter/CounterActivityModule.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterActivityModule.kt index 5757987..3af0bd0 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/CounterActivityModule.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterActivityModule.kt @@ -1,8 +1,8 @@ -package com.sumera.koreactor.ui.feature.counter +package com.sumera.koreactorexampleapp.ui.feature.counter import android.app.Activity -import com.sumera.koreactor.injection.base.BaseActivityModule -import com.sumera.koreactor.injection.PerActivity +import com.sumera.koreactorexampleapp.injection.base.BaseActivityModule +import com.sumera.koreactorexampleapp.injection.PerActivity import dagger.Binds import dagger.Module diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterReactor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterReactor.kt new file mode 100644 index 0000000..d15662e --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterReactor.kt @@ -0,0 +1,41 @@ +package com.sumera.koreactorexampleapp.ui.feature.counter + +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviAction +import com.sumera.koreactorexampleapp.ui.feature.counter.contract.CounterState +import com.sumera.koreactorexampleapp.ui.feature.counter.contract.DecrementAction +import com.sumera.koreactorexampleapp.ui.feature.counter.contract.DecrementReducer +import com.sumera.koreactorexampleapp.ui.feature.counter.contract.IncrementAction +import com.sumera.koreactorexampleapp.ui.feature.counter.contract.IncrementReducer +import com.sumera.koreactorexampleapp.ui.feature.counter.contract.ShowNumberIsDivisibleByFiveToast +import com.sumera.koreactor.util.extension.getChange +import com.sumera.koreactorexampleapp.injection.PerActivity +import io.reactivex.Observable +import javax.inject.Inject + +@PerActivity +class CounterReactor @Inject constructor(): MviReactor() { + + override fun createInitialState(): CounterState { + return CounterState(counter = 0) + } + + override fun bind(actions: Observable>) { + val incrementAction = actions.ofActionType() + val decrementAction = actions.ofActionType() + + incrementAction + .map { IncrementReducer } + .bindToView() + + decrementAction + .map { DecrementReducer } + .bindToView() + + stateObservable + .getChange { it.counter } + .filter { it % 5 == 0 && it != 0 } + .map { ShowNumberIsDivisibleByFiveToast } + .bindToView() + } +} diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/CounterReactorFactory.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterReactorFactory.kt similarity index 62% rename from example/src/main/java/com/sumera/koreactor/ui/feature/counter/CounterReactorFactory.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterReactorFactory.kt index aeb7104..3c653e0 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/CounterReactorFactory.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/CounterReactorFactory.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.feature.counter +package com.sumera.koreactorexampleapp.ui.feature.counter -import com.sumera.koreactor.injection.PerActivity -import com.sumera.koreactorlib.reactor.MviReactorFactory +import com.sumera.koreactorexampleapp.injection.PerActivity +import com.sumera.koreactor.reactor.MviReactorFactory import javax.inject.Inject import javax.inject.Provider diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterActions.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterActions.kt similarity index 54% rename from example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterActions.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterActions.kt index 683401e..30892ab 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterActions.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterActions.kt @@ -1,6 +1,6 @@ -package com.sumera.koreactor.ui.feature.counter.contract +package com.sumera.koreactorexampleapp.ui.feature.counter.contract -import com.sumera.koreactorlib.reactor.data.MviAction +import com.sumera.koreactor.reactor.data.MviAction sealed class CounterActions : MviAction diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterEvents.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterEvents.kt new file mode 100644 index 0000000..7b00841 --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterEvents.kt @@ -0,0 +1,7 @@ +package com.sumera.koreactorexampleapp.ui.feature.counter.contract + +import com.sumera.koreactor.reactor.data.MviEvent + +sealed class CounterEvents: MviEvent + +object ShowNumberIsDivisibleByFiveToast : CounterEvents() \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterState.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterState.kt new file mode 100644 index 0000000..c454ce8 --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterState.kt @@ -0,0 +1,7 @@ +package com.sumera.koreactorexampleapp.ui.feature.counter.contract + +import com.sumera.koreactor.reactor.data.MviState + +data class CounterState( + val counter: Int +): MviState diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterStateReducers.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterStateReducers.kt similarity index 76% rename from example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterStateReducers.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterStateReducers.kt index 42d4f49..3cf62b7 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/counter/contract/CounterStateReducers.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/counter/contract/CounterStateReducers.kt @@ -1,6 +1,6 @@ -package com.sumera.koreactor.ui.feature.counter.contract +package com.sumera.koreactorexampleapp.ui.feature.counter.contract -import com.sumera.koreactorlib.reactor.data.MviStateReducer +import com.sumera.koreactor.reactor.data.MviStateReducer sealed class CounterStateReducers: MviStateReducer diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityActivity.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityActivity.kt similarity index 66% rename from example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityActivity.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityActivity.kt index 04f6faf..07690e3 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityActivity.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityActivity.kt @@ -1,22 +1,22 @@ -package com.sumera.koreactor.ui.feature.infinity +package com.sumera.koreactorexampleapp.ui.feature.infinity import android.os.Bundle import android.support.v7.widget.LinearLayoutManager -import com.sumera.koreactor.R -import com.sumera.koreactor.ui.base.BaseActivity -import com.sumera.koreactor.ui.common.PlaceholderLayout -import com.sumera.koreactor.ui.feature.infinity.adapter.InfinityAdapter -import com.sumera.koreactor.ui.feature.infinity.contract.NavigateToDetailEvent -import com.sumera.koreactor.ui.feature.infinity.contract.OnItemClickedAction -import com.sumera.koreactor.ui.feature.infinity.contract.OnRetryInfinityLoadingAction -import com.sumera.koreactor.ui.feature.infinity.contract.OnRetryInitialAction -import com.sumera.koreactor.ui.feature.infinity.contract.OnScrolledToBottomAction -import com.sumera.koreactor.ui.feature.infinity.contract.InfinityState -import com.sumera.koreactorlib.util.data.asOptional -import com.sumera.koreactorlib.util.extension.getChange -import com.sumera.koreactorlib.util.extension.getTrue -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviEvent +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactor.util.data.asOptional +import com.sumera.koreactor.util.extension.getChange +import com.sumera.koreactor.util.extension.getTrue +import com.sumera.koreactorexampleapp.R +import com.sumera.koreactorexampleapp.ui.base.BaseActivity +import com.sumera.koreactorexampleapp.ui.common.PlaceholderLayout +import com.sumera.koreactorexampleapp.ui.feature.infinity.adapter.InfinityAdapter +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.InfinityState +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.NavigateToDetailEvent +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.OnItemClickedAction +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.OnRetryInfinityLoadingAction +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.OnRetryInitialAction +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.OnScrolledToBottomAction import io.reactivex.Observable import kotlinx.android.synthetic.main.activity_infinity.* import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityActivityModule.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityActivityModule.kt new file mode 100644 index 0000000..bf1b8b0 --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityActivityModule.kt @@ -0,0 +1,16 @@ +package com.sumera.koreactorexampleapp.ui.feature.infinity + +import android.app.Activity +import com.sumera.koreactorexampleapp.injection.base.BaseActivityModule +import com.sumera.koreactorexampleapp.ui.feature.todo.ToDoActivity +import com.sumera.koreactorexampleapp.injection.PerActivity +import dagger.Binds +import dagger.Module + +@Module(includes = [BaseActivityModule::class]) +abstract class InfinityActivityModule { + + @Binds + @PerActivity + abstract fun activity(toDoActivity: ToDoActivity): Activity +} \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityReactor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityReactor.kt similarity index 62% rename from example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityReactor.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityReactor.kt index a4908f5..93689bf 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityReactor.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityReactor.kt @@ -1,27 +1,27 @@ -package com.sumera.koreactor.ui.feature.infinity +package com.sumera.koreactorexampleapp.ui.feature.infinity -import com.sumera.koreactor.data.ToDoItem -import com.sumera.koreactor.injection.PerActivity -import com.sumera.koreactor.ui.feature.infinity.contract.AddNewData -import com.sumera.koreactor.ui.feature.infinity.contract.InfinityState -import com.sumera.koreactor.ui.feature.infinity.contract.NavigateToDetailEvent -import com.sumera.koreactor.ui.feature.infinity.contract.OnItemClickedAction -import com.sumera.koreactor.ui.feature.infinity.contract.OnRetryInfinityLoadingAction -import com.sumera.koreactor.ui.feature.infinity.contract.OnRetryInitialAction -import com.sumera.koreactor.ui.feature.infinity.contract.OnScrolledToBottomAction -import com.sumera.koreactor.ui.feature.infinity.contract.ShowInfinityError -import com.sumera.koreactor.ui.feature.infinity.contract.ShowInfinityLoading -import com.sumera.koreactor.ui.feature.infinity.contract.ShowInitialError -import com.sumera.koreactor.ui.feature.infinity.contract.ShowInitialLoading -import com.sumera.koreactorlib.behaviour.ObservableWorker -import com.sumera.koreactorlib.behaviour.implementation.InfinityLoadingBehaviour -import com.sumera.koreactorlib.behaviour.implementation.LoadingListBehaviour -import com.sumera.koreactorlib.behaviour.messages -import com.sumera.koreactorlib.behaviour.triggers -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviAction -import com.sumera.koreactorlib.reactor.lifecycle.AttachState -import com.sumera.koreactorlib.util.extension.ofLifecycleType +import com.sumera.koreactorexampleapp.data.ToDoItem +import com.sumera.koreactorexampleapp.injection.PerActivity +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.AddNewData +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.InfinityState +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.NavigateToDetailEvent +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.OnItemClickedAction +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.OnRetryInfinityLoadingAction +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.OnRetryInitialAction +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.OnScrolledToBottomAction +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.ShowInfinityError +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.ShowInfinityLoading +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.ShowInitialError +import com.sumera.koreactorexampleapp.ui.feature.infinity.contract.ShowInitialLoading +import com.sumera.koreactor.behaviour.ObservableWorker +import com.sumera.koreactor.behaviour.implementation.InfinityLoadingBehaviour +import com.sumera.koreactor.behaviour.implementation.LoadingListBehaviour +import com.sumera.koreactor.behaviour.messages +import com.sumera.koreactor.behaviour.triggers +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviAction +import com.sumera.koreactor.reactor.lifecycle.AttachState +import com.sumera.koreactor.util.extension.ofLifecycleType import io.reactivex.Observable import io.reactivex.functions.BiFunction import java.util.* diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityReactorFactory.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityReactorFactory.kt similarity index 62% rename from example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityReactorFactory.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityReactorFactory.kt index b430581..ff7e155 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/InfinityReactorFactory.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/InfinityReactorFactory.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.feature.infinity +package com.sumera.koreactorexampleapp.ui.feature.infinity -import com.sumera.koreactor.injection.PerActivity -import com.sumera.koreactorlib.reactor.MviReactorFactory +import com.sumera.koreactorexampleapp.injection.PerActivity +import com.sumera.koreactor.reactor.MviReactorFactory import javax.inject.Inject import javax.inject.Provider diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/adapter/InfinityAdapter.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/adapter/InfinityAdapter.kt similarity index 93% rename from example/src/main/java/com/sumera/koreactor/ui/feature/infinity/adapter/InfinityAdapter.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/adapter/InfinityAdapter.kt index 3564202..4c1bbf2 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/adapter/InfinityAdapter.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/adapter/InfinityAdapter.kt @@ -1,10 +1,10 @@ -package com.sumera.koreactor.ui.feature.infinity.adapter +package com.sumera.koreactorexampleapp.ui.feature.infinity.adapter import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.ViewGroup -import com.sumera.koreactor.data.ToDoItem -import com.sumera.koreactor.injection.PerActivity +import com.sumera.koreactorexampleapp.data.ToDoItem +import com.sumera.koreactorexampleapp.injection.PerActivity import io.reactivex.Observable import io.reactivex.subjects.PublishSubject import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/adapter/InfinityFooterViewHolder.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/adapter/InfinityFooterViewHolder.kt similarity index 83% rename from example/src/main/java/com/sumera/koreactor/ui/feature/infinity/adapter/InfinityFooterViewHolder.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/adapter/InfinityFooterViewHolder.kt index c765893..96425ea 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/adapter/InfinityFooterViewHolder.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/adapter/InfinityFooterViewHolder.kt @@ -1,11 +1,11 @@ -package com.sumera.koreactor.ui.feature.infinity.adapter +package com.sumera.koreactorexampleapp.ui.feature.infinity.adapter import android.support.annotation.LayoutRes import android.support.v7.widget.RecyclerView import android.view.View import android.view.ViewGroup -import com.sumera.koreactor.R -import com.sumera.koreactor.tools.extensions.isVisible +import com.sumera.koreactorexampleapp.R +import com.sumera.koreactorexampleapp.tools.extensions.isVisible import kotlinx.android.synthetic.main.view_holder_infinity_footer.view.* class InfinityFooterViewHolder(view: View) : RecyclerView.ViewHolder(view) { diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/adapter/InifnityViewHolder.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/adapter/InifnityViewHolder.kt similarity index 80% rename from example/src/main/java/com/sumera/koreactor/ui/feature/infinity/adapter/InifnityViewHolder.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/adapter/InifnityViewHolder.kt index c1b6da5..54447a2 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/adapter/InifnityViewHolder.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/adapter/InifnityViewHolder.kt @@ -1,11 +1,11 @@ -package com.sumera.koreactor.ui.feature.infinity.adapter +package com.sumera.koreactorexampleapp.ui.feature.infinity.adapter import android.support.annotation.LayoutRes import android.support.v7.widget.RecyclerView import android.view.View import android.widget.TextView -import com.sumera.koreactor.R -import com.sumera.koreactor.data.ToDoItem +import com.sumera.koreactorexampleapp.R +import com.sumera.koreactorexampleapp.data.ToDoItem import kotlinx.android.synthetic.main.view_holder_todo_item.view.* class InifnityViewHolder(view: View) : RecyclerView.ViewHolder(view) { diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityActions.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityActions.kt similarity index 63% rename from example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityActions.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityActions.kt index 8521872..d53b6bb 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityActions.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityActions.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.feature.infinity.contract +package com.sumera.koreactorexampleapp.ui.feature.infinity.contract -import com.sumera.koreactor.data.ToDoItem -import com.sumera.koreactorlib.reactor.data.MviAction +import com.sumera.koreactorexampleapp.data.ToDoItem +import com.sumera.koreactor.reactor.data.MviAction sealed class InfinityActions : MviAction diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityEvents.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityEvents.kt new file mode 100644 index 0000000..7bfe739 --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityEvents.kt @@ -0,0 +1,7 @@ +package com.sumera.koreactorexampleapp.ui.feature.infinity.contract + +import com.sumera.koreactor.reactor.data.MviEvent + +sealed class InfinityEvents : MviEvent + +object NavigateToDetailEvent : InfinityEvents() diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityState.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityState.kt similarity index 53% rename from example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityState.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityState.kt index 0e17815..8b77880 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityState.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityState.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.feature.infinity.contract +package com.sumera.koreactorexampleapp.ui.feature.infinity.contract -import com.sumera.koreactor.data.ToDoItem -import com.sumera.koreactorlib.reactor.data.MviState +import com.sumera.koreactorexampleapp.data.ToDoItem +import com.sumera.koreactor.reactor.data.MviState data class InfinityState( val isInitialLoading: Boolean, diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityStateReducers.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityStateReducers.kt similarity index 89% rename from example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityStateReducers.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityStateReducers.kt index a6cac8e..2d1f680 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/infinity/contract/InfinityStateReducers.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/infinity/contract/InfinityStateReducers.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.feature.infinity.contract +package com.sumera.koreactorexampleapp.ui.feature.infinity.contract -import com.sumera.koreactor.data.ToDoItem -import com.sumera.koreactorlib.reactor.data.MviStateReducer +import com.sumera.koreactorexampleapp.data.ToDoItem +import com.sumera.koreactor.reactor.data.MviStateReducer sealed class InfinityStateReducer : MviStateReducer diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/main/MainActivity.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainActivity.kt similarity index 50% rename from example/src/main/java/com/sumera/koreactor/ui/feature/main/MainActivity.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainActivity.kt index 22ee6b9..b64bce7 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/main/MainActivity.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainActivity.kt @@ -1,28 +1,28 @@ -package com.sumera.koreactor.ui.feature.main +package com.sumera.koreactorexampleapp.ui.feature.main import android.content.Intent import android.os.Bundle import com.jakewharton.rxbinding2.view.clicks -import com.sumera.koreactor.R -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviEvent -import com.sumera.koreactor.ui.base.BaseActivity -import com.sumera.koreactor.ui.feature.counter.CounterActivity -import com.sumera.koreactor.ui.feature.infinity.InfinityActivity -import com.sumera.koreactor.ui.feature.main.contract.MainState -import com.sumera.koreactor.ui.feature.main.contract.NavigateToCounterEvent -import com.sumera.koreactor.ui.feature.main.contract.NavigateToInfinityEvent -import com.sumera.koreactor.ui.feature.main.contract.NavigateToSimpleLoadingEvent -import com.sumera.koreactor.ui.feature.main.contract.NavigateToTimerEvent -import com.sumera.koreactor.ui.feature.main.contract.NavigateToToDoEvent -import com.sumera.koreactor.ui.feature.main.contract.OnCounterButtonCLickAction -import com.sumera.koreactor.ui.feature.main.contract.OnInfinityButtonClickAction -import com.sumera.koreactor.ui.feature.main.contract.OnSimpleLoadingButtonClickAction -import com.sumera.koreactor.ui.feature.main.contract.OnTimerButtonClickAction -import com.sumera.koreactor.ui.feature.main.contract.OnToDoButtonClickAction -import com.sumera.koreactor.ui.feature.simpleloading.SimpleLoadingActivity -import com.sumera.koreactor.ui.feature.timer.activity.TimerActivity -import com.sumera.koreactor.ui.feature.todo.ToDoActivity +import com.sumera.koreactorexampleapp.R +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactorexampleapp.ui.base.BaseActivity +import com.sumera.koreactorexampleapp.ui.feature.counter.CounterActivity +import com.sumera.koreactorexampleapp.ui.feature.infinity.InfinityActivity +import com.sumera.koreactorexampleapp.ui.feature.main.contract.MainState +import com.sumera.koreactorexampleapp.ui.feature.main.contract.NavigateToCounterEvent +import com.sumera.koreactorexampleapp.ui.feature.main.contract.NavigateToInfinityEvent +import com.sumera.koreactorexampleapp.ui.feature.main.contract.NavigateToSimpleLoadingEvent +import com.sumera.koreactorexampleapp.ui.feature.main.contract.NavigateToTimerEvent +import com.sumera.koreactorexampleapp.ui.feature.main.contract.NavigateToToDoEvent +import com.sumera.koreactorexampleapp.ui.feature.main.contract.OnCounterButtonCLickAction +import com.sumera.koreactorexampleapp.ui.feature.main.contract.OnInfinityButtonClickAction +import com.sumera.koreactorexampleapp.ui.feature.main.contract.OnSimpleLoadingButtonClickAction +import com.sumera.koreactorexampleapp.ui.feature.main.contract.OnTimerButtonClickAction +import com.sumera.koreactorexampleapp.ui.feature.main.contract.OnToDoButtonClickAction +import com.sumera.koreactorexampleapp.ui.feature.simpleloading.SimpleLoadingActivity +import com.sumera.koreactorexampleapp.ui.feature.timer.activity.TimerActivity +import com.sumera.koreactorexampleapp.ui.feature.todo.ToDoActivity import io.reactivex.Observable import kotlinx.android.synthetic.main.activity_main.* import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/main/MainActivityModule.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainActivityModule.kt similarity index 56% rename from example/src/main/java/com/sumera/koreactor/ui/feature/main/MainActivityModule.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainActivityModule.kt index 5903c30..17a675f 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/main/MainActivityModule.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainActivityModule.kt @@ -1,8 +1,8 @@ -package com.sumera.koreactor.ui.feature.main +package com.sumera.koreactorexampleapp.ui.feature.main import android.app.Activity -import com.sumera.koreactor.injection.base.BaseActivityModule -import com.sumera.koreactor.injection.PerActivity +import com.sumera.koreactorexampleapp.injection.base.BaseActivityModule +import com.sumera.koreactorexampleapp.injection.PerActivity import dagger.Binds import dagger.Module diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainReactor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainReactor.kt new file mode 100644 index 0000000..f419cce --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainReactor.kt @@ -0,0 +1,54 @@ +package com.sumera.koreactorexampleapp.ui.feature.main + +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviAction +import com.sumera.koreactorexampleapp.ui.feature.main.contract.MainState +import com.sumera.koreactorexampleapp.ui.feature.main.contract.NavigateToCounterEvent +import com.sumera.koreactorexampleapp.ui.feature.main.contract.NavigateToInfinityEvent +import com.sumera.koreactorexampleapp.ui.feature.main.contract.NavigateToSimpleLoadingEvent +import com.sumera.koreactorexampleapp.ui.feature.main.contract.NavigateToTimerEvent +import com.sumera.koreactorexampleapp.ui.feature.main.contract.NavigateToToDoEvent +import com.sumera.koreactorexampleapp.ui.feature.main.contract.OnCounterButtonCLickAction +import com.sumera.koreactorexampleapp.ui.feature.main.contract.OnInfinityButtonClickAction +import com.sumera.koreactorexampleapp.ui.feature.main.contract.OnSimpleLoadingButtonClickAction +import com.sumera.koreactorexampleapp.ui.feature.main.contract.OnTimerButtonClickAction +import com.sumera.koreactorexampleapp.ui.feature.main.contract.OnToDoButtonClickAction +import com.sumera.koreactorexampleapp.injection.PerActivity +import io.reactivex.Observable +import javax.inject.Inject + +@PerActivity +class MainReactor @Inject constructor() : MviReactor() { + + override fun createInitialState(): MainState { + return MainState + } + + override fun bind(actions: Observable>) { + val counterAction = actions.ofActionType() + val todoAction = actions.ofActionType() + val infinityAction = actions.ofActionType() + val simpleLoadingAction = actions.ofActionType() + val timerAction = actions.ofActionType() + + counterAction + .map { NavigateToCounterEvent } + .bindToView() + + todoAction + .map { NavigateToToDoEvent } + .bindToView() + + infinityAction + .map { NavigateToInfinityEvent } + .bindToView() + + simpleLoadingAction + .map { NavigateToSimpleLoadingEvent } + .bindToView() + + timerAction + .map { NavigateToTimerEvent } + .bindToView() + } +} diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/main/MainReactorFactory.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainReactorFactory.kt similarity index 62% rename from example/src/main/java/com/sumera/koreactor/ui/feature/main/MainReactorFactory.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainReactorFactory.kt index bb33253..ff92f0d 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/main/MainReactorFactory.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/MainReactorFactory.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.feature.main +package com.sumera.koreactorexampleapp.ui.feature.main -import com.sumera.koreactorlib.reactor.MviReactorFactory -import com.sumera.koreactor.injection.PerActivity +import com.sumera.koreactor.reactor.MviReactorFactory +import com.sumera.koreactorexampleapp.injection.PerActivity import javax.inject.Inject import javax.inject.Provider diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/main/contract/MainActions.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/contract/MainActions.kt similarity index 72% rename from example/src/main/java/com/sumera/koreactor/ui/feature/main/contract/MainActions.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/contract/MainActions.kt index 46b8bc8..072e113 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/main/contract/MainActions.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/contract/MainActions.kt @@ -1,6 +1,6 @@ -package com.sumera.koreactor.ui.feature.main.contract +package com.sumera.koreactorexampleapp.ui.feature.main.contract -import com.sumera.koreactorlib.reactor.data.MviAction +import com.sumera.koreactor.reactor.data.MviAction sealed class MainActions : MviAction diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/main/contract/MainEvents.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/contract/MainEvents.kt similarity index 70% rename from example/src/main/java/com/sumera/koreactor/ui/feature/main/contract/MainEvents.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/contract/MainEvents.kt index 8a1d571..32e9b84 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/main/contract/MainEvents.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/contract/MainEvents.kt @@ -1,6 +1,6 @@ -package com.sumera.koreactor.ui.feature.main.contract +package com.sumera.koreactorexampleapp.ui.feature.main.contract -import com.sumera.koreactorlib.reactor.data.MviEvent +import com.sumera.koreactor.reactor.data.MviEvent sealed class MainEvent : MviEvent diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/contract/MainState.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/contract/MainState.kt new file mode 100644 index 0000000..43a24d2 --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/main/contract/MainState.kt @@ -0,0 +1,5 @@ +package com.sumera.koreactorexampleapp.ui.feature.main.contract + +import com.sumera.koreactor.reactor.data.MviState + +object MainState : MviState diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingActivity.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingActivity.kt similarity index 65% rename from example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingActivity.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingActivity.kt index 81c20ad..8d6502e 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingActivity.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingActivity.kt @@ -1,16 +1,16 @@ -package com.sumera.koreactor.ui.feature.simpleloading +package com.sumera.koreactorexampleapp.ui.feature.simpleloading import android.os.Bundle -import com.sumera.koreactor.R -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactor.ui.base.BaseActivity -import com.sumera.koreactor.ui.common.PlaceholderLayout -import com.sumera.koreactor.ui.feature.simpleloading.contract.RetryClicked -import com.sumera.koreactor.ui.feature.simpleloading.contract.SimpleLoadingState -import com.sumera.koreactorlib.util.data.asOptional -import com.sumera.koreactorlib.util.extension.getFalse -import com.sumera.koreactorlib.util.extension.getNotNull -import com.sumera.koreactorlib.util.extension.getTrue +import com.sumera.koreactorexampleapp.R +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactorexampleapp.ui.base.BaseActivity +import com.sumera.koreactorexampleapp.ui.common.PlaceholderLayout +import com.sumera.koreactorexampleapp.ui.feature.simpleloading.contract.RetryClicked +import com.sumera.koreactorexampleapp.ui.feature.simpleloading.contract.SimpleLoadingState +import com.sumera.koreactor.util.data.asOptional +import com.sumera.koreactor.util.extension.getFalse +import com.sumera.koreactor.util.extension.getNotNull +import com.sumera.koreactor.util.extension.getTrue import io.reactivex.Observable import kotlinx.android.synthetic.main.activity_simple_loading.* import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingFactory.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingFactory.kt similarity index 64% rename from example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingFactory.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingFactory.kt index 7bf3a2a..5f06c99 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingFactory.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingFactory.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.feature.simpleloading +package com.sumera.koreactorexampleapp.ui.feature.simpleloading -import com.sumera.koreactorlib.reactor.MviReactorFactory -import com.sumera.koreactor.injection.PerActivity +import com.sumera.koreactor.reactor.MviReactorFactory +import com.sumera.koreactorexampleapp.injection.PerActivity import javax.inject.Inject import javax.inject.Provider diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingModule.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingModule.kt similarity index 58% rename from example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingModule.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingModule.kt index 838f0ff..ea058b3 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/SimpleLoadingModule.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingModule.kt @@ -1,8 +1,8 @@ -package com.sumera.koreactor.ui.feature.simpleloading +package com.sumera.koreactorexampleapp.ui.feature.simpleloading import android.app.Activity -import com.sumera.koreactor.injection.base.BaseActivityModule -import com.sumera.koreactor.injection.PerActivity +import com.sumera.koreactorexampleapp.injection.base.BaseActivityModule +import com.sumera.koreactorexampleapp.injection.PerActivity import dagger.Binds import dagger.Module diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingReactor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingReactor.kt new file mode 100644 index 0000000..4c57c28 --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/SimpleLoadingReactor.kt @@ -0,0 +1,40 @@ +package com.sumera.koreactorexampleapp.ui.feature.simpleloading + +import com.sumera.koreactor.behaviour.ObservableWorker +import com.sumera.koreactor.behaviour.implementation.LoadingBehaviour +import com.sumera.koreactor.behaviour.messages +import com.sumera.koreactor.behaviour.triggers +import com.sumera.koreactorexampleapp.domain.GetSomeTextDataInteractor +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviAction +import com.sumera.koreactorexampleapp.ui.feature.simpleloading.contract.RetryClicked +import com.sumera.koreactorexampleapp.ui.feature.simpleloading.contract.ShowData +import com.sumera.koreactorexampleapp.ui.feature.simpleloading.contract.ShowError +import com.sumera.koreactorexampleapp.ui.feature.simpleloading.contract.ShowLoading +import com.sumera.koreactorexampleapp.ui.feature.simpleloading.contract.SimpleLoadingState +import com.sumera.koreactorexampleapp.injection.PerActivity +import io.reactivex.Observable +import javax.inject.Inject + +@PerActivity +class SimpleLoadingReactor @Inject constructor( + private val dataLoader: GetSomeTextDataInteractor +) : MviReactor() { + + override fun createInitialState(): SimpleLoadingState { + return SimpleLoadingState(isError = false, isLoading = false, data = null) + } + + override fun bind(actions: Observable>) { + val retryClicks = actions.ofActionType() + + LoadingBehaviour( + triggers = triggers(attachLifecycleObservable, retryClicks), + loadWorker = ObservableWorker{ dataLoader.execute() }, + cancelPrevious = true, + loadingMessage = messages({ ShowLoading }), + errorMessage = messages({ ShowError }), + dataMessage = messages({ ShowData(it) }) + ).bindToView() + } +} \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/contract/SimpleLoadingActions.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/contract/SimpleLoadingActions.kt new file mode 100644 index 0000000..5bf888e --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/contract/SimpleLoadingActions.kt @@ -0,0 +1,7 @@ +package com.sumera.koreactorexampleapp.ui.feature.simpleloading.contract + +import com.sumera.koreactor.reactor.data.MviAction + +sealed class SimpleLoadingActions : MviAction + +object RetryClicked : SimpleLoadingActions() \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/contract/SimpleLoadingReducers.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/contract/SimpleLoadingReducers.kt similarity index 83% rename from example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/contract/SimpleLoadingReducers.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/contract/SimpleLoadingReducers.kt index 5065832..9f2f6c8 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/simpleloading/contract/SimpleLoadingReducers.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/contract/SimpleLoadingReducers.kt @@ -1,6 +1,6 @@ -package com.sumera.koreactor.ui.feature.simpleloading.contract +package com.sumera.koreactorexampleapp.ui.feature.simpleloading.contract -import com.sumera.koreactorlib.reactor.data.MviStateReducer +import com.sumera.koreactor.reactor.data.MviStateReducer sealed class SimpleLoadingReducer : MviStateReducer diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/contract/SimpleLoadingState.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/contract/SimpleLoadingState.kt new file mode 100644 index 0000000..e7f2c65 --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/simpleloading/contract/SimpleLoadingState.kt @@ -0,0 +1,9 @@ +package com.sumera.koreactorexampleapp.ui.feature.simpleloading.contract + +import com.sumera.koreactor.reactor.data.MviState + +data class SimpleLoadingState( + val isLoading: Boolean, + val isError: Boolean, + val data: String? +) : MviState diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerFragment.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerFragment.kt similarity index 71% rename from example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerFragment.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerFragment.kt index 648e5e4..ac48dab 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerFragment.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerFragment.kt @@ -1,14 +1,14 @@ -package com.sumera.koreactor.ui.feature.timer +package com.sumera.koreactorexampleapp.ui.feature.timer import android.os.Bundle import android.view.View import com.jakewharton.rxbinding2.view.clicks -import com.sumera.koreactor.R -import com.sumera.koreactor.ui.base.BaseFragment -import com.sumera.koreactor.ui.feature.timer.contract.ResetTimerAction -import com.sumera.koreactor.ui.feature.timer.contract.TimerState -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.util.extension.getChange +import com.sumera.koreactorexampleapp.R +import com.sumera.koreactorexampleapp.ui.base.BaseFragment +import com.sumera.koreactorexampleapp.ui.feature.timer.contract.ResetTimerAction +import com.sumera.koreactorexampleapp.ui.feature.timer.contract.TimerState +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.util.extension.getChange import io.reactivex.Observable import kotlinx.android.synthetic.main.fragment_timer.* import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerFragmentModule.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerFragmentModule.kt similarity index 58% rename from example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerFragmentModule.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerFragmentModule.kt index 6869c5f..3e3fe04 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerFragmentModule.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerFragmentModule.kt @@ -1,8 +1,8 @@ -package com.sumera.koreactor.ui.feature.timer +package com.sumera.koreactorexampleapp.ui.feature.timer import android.support.v4.app.Fragment -import com.sumera.koreactor.injection.base.BaseFragmentModule -import com.sumera.koreactor.injection.PerFragment +import com.sumera.koreactorexampleapp.injection.base.BaseFragmentModule +import com.sumera.koreactorexampleapp.injection.PerFragment import dagger.Binds import dagger.Module diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerReactor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerReactor.kt similarity index 54% rename from example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerReactor.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerReactor.kt index 591d5b4..5572cd7 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerReactor.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerReactor.kt @@ -1,15 +1,15 @@ -package com.sumera.koreactor.ui.feature.timer +package com.sumera.koreactorexampleapp.ui.feature.timer -import com.sumera.koreactor.injection.PerFragment -import com.sumera.koreactor.ui.feature.timer.contract.IncrementCountReducer -import com.sumera.koreactor.ui.feature.timer.contract.ResetCountReducer -import com.sumera.koreactor.ui.feature.timer.contract.ResetTimerAction -import com.sumera.koreactor.ui.feature.timer.contract.TimerState -import com.sumera.koreactorlib.behaviour.implementation.TimerBehaviour -import com.sumera.koreactorlib.behaviour.messages -import com.sumera.koreactorlib.behaviour.triggers -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviAction +import com.sumera.koreactorexampleapp.injection.PerFragment +import com.sumera.koreactorexampleapp.ui.feature.timer.contract.IncrementCountReducer +import com.sumera.koreactorexampleapp.ui.feature.timer.contract.ResetCountReducer +import com.sumera.koreactorexampleapp.ui.feature.timer.contract.ResetTimerAction +import com.sumera.koreactorexampleapp.ui.feature.timer.contract.TimerState +import com.sumera.koreactor.behaviour.implementation.TimerBehaviour +import com.sumera.koreactor.behaviour.messages +import com.sumera.koreactor.behaviour.triggers +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviAction import io.reactivex.Observable import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerReactorFactory.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerReactorFactory.kt similarity index 63% rename from example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerReactorFactory.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerReactorFactory.kt index b998fe9..3ebf1ff 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/TimerReactorFactory.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/TimerReactorFactory.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.feature.timer +package com.sumera.koreactorexampleapp.ui.feature.timer -import com.sumera.koreactor.injection.PerFragment -import com.sumera.koreactorlib.reactor.MviReactorFactory +import com.sumera.koreactorexampleapp.injection.PerFragment +import com.sumera.koreactor.reactor.MviReactorFactory import javax.inject.Inject import javax.inject.Provider diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/activity/TimerActivity.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/activity/TimerActivity.kt new file mode 100644 index 0000000..895d0ed --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/activity/TimerActivity.kt @@ -0,0 +1,10 @@ +package com.sumera.koreactorexampleapp.ui.feature.timer.activity + +import com.sumera.koreactorexampleapp.R +import com.sumera.koreactorexampleapp.ui.base.stateless.StatelessActivity + +class TimerActivity: StatelessActivity() { + + override val layoutRes: Int + get() = R.layout.activity_timer +} diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/activity/TimerActivityModule.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/activity/TimerActivityModule.kt similarity index 53% rename from example/src/main/java/com/sumera/koreactor/ui/feature/timer/activity/TimerActivityModule.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/activity/TimerActivityModule.kt index f9521b9..6ada2a6 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/activity/TimerActivityModule.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/activity/TimerActivityModule.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.feature.timer.activity +package com.sumera.koreactorexampleapp.ui.feature.timer.activity -import com.sumera.koreactor.injection.base.BaseActivityModule -import com.sumera.koreactor.injection.PerActivity +import com.sumera.koreactorexampleapp.injection.base.BaseActivityModule +import com.sumera.koreactorexampleapp.injection.PerActivity import dagger.Binds import dagger.Module diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/contract/TimerActions.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/contract/TimerActions.kt new file mode 100644 index 0000000..d4ddf46 --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/contract/TimerActions.kt @@ -0,0 +1,7 @@ +package com.sumera.koreactorexampleapp.ui.feature.timer.contract + +import com.sumera.koreactor.reactor.data.MviAction + +sealed class TimerAction: MviAction + +object ResetTimerAction: TimerAction() diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/contract/TimerReducers.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/contract/TimerReducers.kt similarity index 76% rename from example/src/main/java/com/sumera/koreactor/ui/feature/timer/contract/TimerReducers.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/contract/TimerReducers.kt index 3189c9e..c51e1db 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/timer/contract/TimerReducers.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/contract/TimerReducers.kt @@ -1,6 +1,6 @@ -package com.sumera.koreactor.ui.feature.timer.contract +package com.sumera.koreactorexampleapp.ui.feature.timer.contract -import com.sumera.koreactorlib.reactor.data.MviStateReducer +import com.sumera.koreactor.reactor.data.MviStateReducer sealed class TimerReducer: MviStateReducer diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/contract/TimerState.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/contract/TimerState.kt new file mode 100644 index 0000000..41b6bd0 --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/timer/contract/TimerState.kt @@ -0,0 +1,7 @@ +package com.sumera.koreactorexampleapp.ui.feature.timer.contract + +import com.sumera.koreactor.reactor.data.MviState + +data class TimerState( + val timerValue: Int +): MviState diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoActivity.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoActivity.kt similarity index 70% rename from example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoActivity.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoActivity.kt index 4e58de1..a6e6ee1 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoActivity.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoActivity.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.ui.feature.todo +package com.sumera.koreactorexampleapp.ui.feature.todo import android.os.Bundle import android.support.design.widget.Snackbar @@ -6,25 +6,25 @@ import android.support.v7.widget.LinearLayoutManager import android.widget.Toast import com.jakewharton.rxbinding2.support.v4.widget.refreshes import com.jakewharton.rxbinding2.view.clicks -import com.sumera.koreactor.R -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviEvent -import com.sumera.koreactor.ui.base.BaseActivity -import com.sumera.koreactor.ui.common.PlaceholderLayout -import com.sumera.koreactor.ui.feature.todo.adapter.ToDoAdapter -import com.sumera.koreactor.ui.feature.todo.contract.NavigateToSomewhereElse -import com.sumera.koreactor.ui.feature.todo.contract.OnAddItemAction -import com.sumera.koreactor.ui.feature.todo.contract.OnRetryAction -import com.sumera.koreactor.ui.feature.todo.contract.OnSwipeRefreshAction -import com.sumera.koreactor.ui.feature.todo.contract.OnToDoItemAction -import com.sumera.koreactor.ui.feature.todo.contract.OnToolbarIconClicked -import com.sumera.koreactor.ui.feature.todo.contract.ShowToastEverytime -import com.sumera.koreactor.ui.feature.todo.contract.ShowToastOnlyVisible -import com.sumera.koreactor.ui.feature.todo.contract.ShowToastOnlyVisibleBuffered -import com.sumera.koreactor.ui.feature.todo.contract.ToDoState -import com.sumera.koreactorlib.util.data.asOptional -import com.sumera.koreactorlib.util.extension.getChange -import com.sumera.koreactorlib.util.extension.getTrue +import com.sumera.koreactorexampleapp.R +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactorexampleapp.ui.base.BaseActivity +import com.sumera.koreactorexampleapp.ui.common.PlaceholderLayout +import com.sumera.koreactorexampleapp.ui.feature.todo.adapter.ToDoAdapter +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.NavigateToSomewhereElse +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.OnAddItemAction +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.OnRetryAction +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.OnSwipeRefreshAction +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.OnToDoItemAction +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.OnToolbarIconClicked +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowToastEverytime +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowToastOnlyVisible +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowToastOnlyVisibleBuffered +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ToDoState +import com.sumera.koreactor.util.data.asOptional +import com.sumera.koreactor.util.extension.getChange +import com.sumera.koreactor.util.extension.getTrue import io.reactivex.Observable import kotlinx.android.synthetic.main.activity_todo.* import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoActivityModule.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoActivityModule.kt new file mode 100644 index 0000000..8664d62 --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoActivityModule.kt @@ -0,0 +1,16 @@ +package com.sumera.koreactorexampleapp.ui.feature.todo + +import android.app.Activity +import com.sumera.koreactorexampleapp.injection.PerActivity +import com.sumera.koreactorexampleapp.injection.base.BaseActivityModule +import com.sumera.koreactorexampleapp.ui.feature.infinity.InfinityActivity +import dagger.Binds +import dagger.Module + +@Module(includes = [BaseActivityModule::class]) +abstract class ToDoActivityModule { + + @Binds + @PerActivity + abstract fun activity(toDoActivity: InfinityActivity): Activity +} \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoReactor.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoReactor.kt similarity index 56% rename from example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoReactor.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoReactor.kt index 9b5fb5b..4e949c1 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoReactor.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoReactor.kt @@ -1,39 +1,39 @@ -package com.sumera.koreactor.ui.feature.todo +package com.sumera.koreactorexampleapp.ui.feature.todo -import com.sumera.koreactorlib.behaviour.ObservableWorker -import com.sumera.koreactorlib.behaviour.implementation.LoadingBehaviour -import com.sumera.koreactorlib.behaviour.implementation.ShowTemporaryBehaviour -import com.sumera.koreactorlib.behaviour.implementation.SwipeRefreshLoadingListBehaviour -import com.sumera.koreactorlib.behaviour.messages -import com.sumera.koreactorlib.behaviour.triggers -import com.sumera.koreactor.data.ToDoItem -import com.sumera.koreactor.domain.GetToDoItemsOnceInteractor -import com.sumera.koreactor.domain.SaveToDoItemInteractor -import com.sumera.koreactor.injection.PerActivity -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviAction -import com.sumera.koreactorlib.reactor.lifecycle.AttachState -import com.sumera.koreactor.ui.feature.todo.adapter.ToDoItemWrapper -import com.sumera.koreactor.ui.feature.todo.contract.AddToDoItem -import com.sumera.koreactor.ui.feature.todo.contract.HideInfoMessage -import com.sumera.koreactor.ui.feature.todo.contract.OnAddItemAction -import com.sumera.koreactor.ui.feature.todo.contract.OnRetryAction -import com.sumera.koreactor.ui.feature.todo.contract.OnSwipeRefreshAction -import com.sumera.koreactor.ui.feature.todo.contract.OnToDoItemAction -import com.sumera.koreactor.ui.feature.todo.contract.OnToolbarIconClicked -import com.sumera.koreactor.ui.feature.todo.contract.ShowData -import com.sumera.koreactor.ui.feature.todo.contract.ShowEmpty -import com.sumera.koreactor.ui.feature.todo.contract.ShowError -import com.sumera.koreactor.ui.feature.todo.contract.ShowInfoMessage -import com.sumera.koreactor.ui.feature.todo.contract.ShowLoading -import com.sumera.koreactor.ui.feature.todo.contract.ShowSwipeRefreshLoading -import com.sumera.koreactor.ui.feature.todo.contract.ShowToDoItemCompleted -import com.sumera.koreactor.ui.feature.todo.contract.ShowToDoItemLoading -import com.sumera.koreactor.ui.feature.todo.contract.ShowToastEverytime -import com.sumera.koreactor.ui.feature.todo.contract.ShowToastOnlyVisible -import com.sumera.koreactor.ui.feature.todo.contract.ShowToastOnlyVisibleBuffered -import com.sumera.koreactor.ui.feature.todo.contract.ToDoState -import com.sumera.koreactorlib.util.extension.ofLifecycleType +import com.sumera.koreactor.behaviour.ObservableWorker +import com.sumera.koreactor.behaviour.implementation.LoadingBehaviour +import com.sumera.koreactor.behaviour.implementation.ShowTemporaryBehaviour +import com.sumera.koreactor.behaviour.implementation.SwipeRefreshLoadingListBehaviour +import com.sumera.koreactor.behaviour.messages +import com.sumera.koreactor.behaviour.triggers +import com.sumera.koreactorexampleapp.data.ToDoItem +import com.sumera.koreactorexampleapp.domain.GetToDoItemsOnceInteractor +import com.sumera.koreactorexampleapp.domain.SaveToDoItemInteractor +import com.sumera.koreactorexampleapp.injection.PerActivity +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviAction +import com.sumera.koreactor.reactor.lifecycle.AttachState +import com.sumera.koreactorexampleapp.ui.feature.todo.adapter.ToDoItemWrapper +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.AddToDoItem +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.HideInfoMessage +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.OnAddItemAction +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.OnRetryAction +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.OnSwipeRefreshAction +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.OnToDoItemAction +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.OnToolbarIconClicked +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowData +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowEmpty +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowError +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowInfoMessage +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowLoading +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowSwipeRefreshLoading +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowToDoItemCompleted +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowToDoItemLoading +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowToastEverytime +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowToastOnlyVisible +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ShowToastOnlyVisibleBuffered +import com.sumera.koreactorexampleapp.ui.feature.todo.contract.ToDoState +import com.sumera.koreactor.util.extension.ofLifecycleType import io.reactivex.Observable import io.reactivex.subjects.PublishSubject import java.util.concurrent.TimeUnit diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoReactorFactory.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoReactorFactory.kt similarity index 62% rename from example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoReactorFactory.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoReactorFactory.kt index e7917cd..92113be 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/ToDoReactorFactory.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/ToDoReactorFactory.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.feature.todo +package com.sumera.koreactorexampleapp.ui.feature.todo -import com.sumera.koreactorlib.reactor.MviReactorFactory -import com.sumera.koreactor.injection.PerActivity +import com.sumera.koreactor.reactor.MviReactorFactory +import com.sumera.koreactorexampleapp.injection.PerActivity import javax.inject.Inject import javax.inject.Provider diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/adapter/ToDoAdapter.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/adapter/ToDoAdapter.kt similarity index 90% rename from example/src/main/java/com/sumera/koreactor/ui/feature/todo/adapter/ToDoAdapter.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/adapter/ToDoAdapter.kt index ef7ec17..c0aadcd 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/adapter/ToDoAdapter.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/adapter/ToDoAdapter.kt @@ -1,9 +1,9 @@ -package com.sumera.koreactor.ui.feature.todo.adapter +package com.sumera.koreactorexampleapp.ui.feature.todo.adapter import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.ViewGroup -import com.sumera.koreactor.injection.PerActivity +import com.sumera.koreactorexampleapp.injection.PerActivity import io.reactivex.Observable import io.reactivex.subjects.PublishSubject import javax.inject.Inject diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/adapter/ToDoItemWrapper.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/adapter/ToDoItemWrapper.kt new file mode 100644 index 0000000..d294d3f --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/adapter/ToDoItemWrapper.kt @@ -0,0 +1,9 @@ +package com.sumera.koreactorexampleapp.ui.feature.todo.adapter + +import com.sumera.koreactorexampleapp.data.ToDoItem + +data class ToDoItemWrapper( + val toDoItem: ToDoItem, + val isLoading: Boolean, + val isCompleted: Boolean +) \ No newline at end of file diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/adapter/ToDoViewHolder.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/adapter/ToDoViewHolder.kt similarity index 89% rename from example/src/main/java/com/sumera/koreactor/ui/feature/todo/adapter/ToDoViewHolder.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/adapter/ToDoViewHolder.kt index 13e873f..b67d6d0 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/adapter/ToDoViewHolder.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/adapter/ToDoViewHolder.kt @@ -1,10 +1,10 @@ -package com.sumera.koreactor.ui.feature.todo.adapter +package com.sumera.koreactorexampleapp.ui.feature.todo.adapter import android.support.annotation.LayoutRes import android.support.v7.widget.RecyclerView import android.view.View import android.widget.TextView -import com.sumera.koreactor.R +import com.sumera.koreactorexampleapp.R import kotlinx.android.synthetic.main.view_holder_todo_item.view.* class ToDoViewHolder(private val view: View) : RecyclerView.ViewHolder(view) { diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoActions.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoActions.kt similarity index 61% rename from example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoActions.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoActions.kt index 848a221..7c62c34 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoActions.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoActions.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactor.ui.feature.todo.contract +package com.sumera.koreactorexampleapp.ui.feature.todo.contract -import com.sumera.koreactorlib.reactor.data.MviAction -import com.sumera.koreactor.ui.feature.todo.adapter.ToDoItemWrapper +import com.sumera.koreactor.reactor.data.MviAction +import com.sumera.koreactorexampleapp.ui.feature.todo.adapter.ToDoItemWrapper sealed class ToDoActions : MviAction diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoEvents.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoEvents.kt similarity index 61% rename from example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoEvents.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoEvents.kt index 9756621..7618048 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoEvents.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoEvents.kt @@ -1,10 +1,10 @@ -package com.sumera.koreactor.ui.feature.todo.contract +package com.sumera.koreactorexampleapp.ui.feature.todo.contract -import com.sumera.koreactorlib.reactor.data.EveryTimeEventBehaviour -import com.sumera.koreactorlib.reactor.data.MviEvent -import com.sumera.koreactorlib.reactor.data.MviEventBehaviour -import com.sumera.koreactorlib.reactor.data.VisibleBufferedEventBehaviour -import com.sumera.koreactorlib.reactor.data.VisibleNonBufferedEventBehaviour +import com.sumera.koreactor.reactor.data.EveryTimeEventBehaviour +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactor.reactor.data.MviEventBehaviour +import com.sumera.koreactor.reactor.data.VisibleBufferedEventBehaviour +import com.sumera.koreactor.reactor.data.VisibleNonBufferedEventBehaviour sealed class ToDoEvents : MviEvent diff --git a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoReducers.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoReducers.kt similarity index 89% rename from example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoReducers.kt rename to example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoReducers.kt index ed6177d..a899b6a 100644 --- a/example/src/main/java/com/sumera/koreactor/ui/feature/todo/contract/ToDoReducers.kt +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoReducers.kt @@ -1,9 +1,9 @@ -package com.sumera.koreactor.ui.feature.todo.contract +package com.sumera.koreactorexampleapp.ui.feature.todo.contract -import com.sumera.koreactor.data.ToDoItem -import com.sumera.koreactorlib.reactor.data.MviStateReducer -import com.sumera.koreactor.tools.extensions.replaceWithPredicate -import com.sumera.koreactor.ui.feature.todo.adapter.ToDoItemWrapper +import com.sumera.koreactorexampleapp.data.ToDoItem +import com.sumera.koreactor.reactor.data.MviStateReducer +import com.sumera.koreactorexampleapp.tools.extensions.replaceWithPredicate +import com.sumera.koreactorexampleapp.ui.feature.todo.adapter.ToDoItemWrapper sealed class ToDoStateReducer : MviStateReducer diff --git a/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoState.kt b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoState.kt new file mode 100644 index 0000000..a0ecf6a --- /dev/null +++ b/example/src/main/java/com/sumera/koreactorexampleapp/ui/feature/todo/contract/ToDoState.kt @@ -0,0 +1,12 @@ +package com.sumera.koreactorexampleapp.ui.feature.todo.contract + +import com.sumera.koreactor.reactor.data.MviState +import com.sumera.koreactorexampleapp.ui.feature.todo.adapter.ToDoItemWrapper + +data class ToDoState( + val isLoading: Boolean, + val isSwipeLoading: Boolean, + val isError: Boolean, + val infoMessage: String, + val data: List? +) : MviState diff --git a/example/src/main/res/layout/activity_infinity.xml b/example/src/main/res/layout/activity_infinity.xml index 3bff682..6870c77 100644 --- a/example/src/main/res/layout/activity_infinity.xml +++ b/example/src/main/res/layout/activity_infinity.xml @@ -27,7 +27,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> - diff --git a/example/src/main/res/layout/activity_simple_loading.xml b/example/src/main/res/layout/activity_simple_loading.xml index 0670edb..1997537 100644 --- a/example/src/main/res/layout/activity_simple_loading.xml +++ b/example/src/main/res/layout/activity_simple_loading.xml @@ -26,7 +26,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> - diff --git a/example/src/main/res/layout/activity_timer.xml b/example/src/main/res/layout/activity_timer.xml index b74da0e..71b72ad 100644 --- a/example/src/main/res/layout/activity_timer.xml +++ b/example/src/main/res/layout/activity_timer.xml @@ -7,7 +7,7 @@ diff --git a/example/src/main/res/layout/activity_todo.xml b/example/src/main/res/layout/activity_todo.xml index d7d6977..8a1aa1e 100644 --- a/example/src/main/res/layout/activity_todo.xml +++ b/example/src/main/res/layout/activity_todo.xml @@ -43,7 +43,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> - diff --git a/example/src/main/res/menu/menu_main.xml b/example/src/main/res/menu/menu_main.xml index d98195a..a296913 100644 --- a/example/src/main/res/menu/menu_main.xml +++ b/example/src/main/res/menu/menu_main.xml @@ -1,7 +1,7 @@ + tools:context="com.sumera.koreactorexampleapp.MainActivity"> ( diff --git a/example/src/test/java/com/sumera/koreactor/lib/TestMviBindableDelegate.kt b/example/src/test/java/com/sumera/koreactorexampleapp/lib/TestMviBindableDelegate.kt similarity index 93% rename from example/src/test/java/com/sumera/koreactor/lib/TestMviBindableDelegate.kt rename to example/src/test/java/com/sumera/koreactorexampleapp/lib/TestMviBindableDelegate.kt index 5fe5e19..9dca1c6 100644 --- a/example/src/test/java/com/sumera/koreactor/lib/TestMviBindableDelegate.kt +++ b/example/src/test/java/com/sumera/koreactorexampleapp/lib/TestMviBindableDelegate.kt @@ -1,10 +1,10 @@ -package com.sumera.koreactor.lib +package com.sumera.koreactorexampleapp.lib -import com.sumera.koreactorlib.internal.extension.isViewStarted -import com.sumera.koreactorlib.reactor.data.MviEvent -import com.sumera.koreactorlib.reactor.data.MviState -import com.sumera.koreactorlib.reactor.lifecycle.LifecycleState -import com.sumera.koreactorlib.view.MviBindableViewDelegate +import com.sumera.koreactor.internal.extension.isViewStarted +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactor.reactor.data.MviState +import com.sumera.koreactor.reactor.lifecycle.LifecycleState +import com.sumera.koreactor.view.MviBindableViewDelegate import io.reactivex.Observable import io.reactivex.observers.TestObserver import io.reactivex.subjects.PublishSubject diff --git a/example/src/test/java/com/sumera/koreactor/lib/annotation/InitialLifecycleState.kt b/example/src/test/java/com/sumera/koreactorexampleapp/lib/annotation/InitialLifecycleState.kt similarity index 61% rename from example/src/test/java/com/sumera/koreactor/lib/annotation/InitialLifecycleState.kt rename to example/src/test/java/com/sumera/koreactorexampleapp/lib/annotation/InitialLifecycleState.kt index d73248b..b8a6a8c 100644 --- a/example/src/test/java/com/sumera/koreactor/lib/annotation/InitialLifecycleState.kt +++ b/example/src/test/java/com/sumera/koreactorexampleapp/lib/annotation/InitialLifecycleState.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.lib.annotation +package com.sumera.koreactorexampleapp.lib.annotation enum class InitialLifecycleState { diff --git a/example/src/test/java/com/sumera/koreactor/lib/annotation/RunAfter.kt b/example/src/test/java/com/sumera/koreactorexampleapp/lib/annotation/RunAfter.kt similarity index 69% rename from example/src/test/java/com/sumera/koreactor/lib/annotation/RunAfter.kt rename to example/src/test/java/com/sumera/koreactorexampleapp/lib/annotation/RunAfter.kt index eea4e5b..c7ec296 100644 --- a/example/src/test/java/com/sumera/koreactor/lib/annotation/RunAfter.kt +++ b/example/src/test/java/com/sumera/koreactorexampleapp/lib/annotation/RunAfter.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor.lib.annotation +package com.sumera.koreactorexampleapp.lib.annotation @Retention(AnnotationRetention.RUNTIME) annotation class RunAfter(val initialLifecycleState: InitialLifecycleState) diff --git a/lib/build.gradle b/lib/build.gradle index a2b3786..1943be9 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' android { compileSdkVersion 26 diff --git a/lib/src/main/java/com/sumera/koreactorlib/behaviour/Messages.kt b/lib/src/main/java/com/sumera/koreactor/behaviour/Messages.kt similarity index 65% rename from lib/src/main/java/com/sumera/koreactorlib/behaviour/Messages.kt rename to lib/src/main/java/com/sumera/koreactor/behaviour/Messages.kt index 3be4fe8..a278208 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/behaviour/Messages.kt +++ b/lib/src/main/java/com/sumera/koreactor/behaviour/Messages.kt @@ -1,8 +1,8 @@ -package com.sumera.koreactorlib.behaviour +package com.sumera.koreactor.behaviour -import com.sumera.koreactorlib.reactor.data.MviReactorMessage -import com.sumera.koreactorlib.reactor.data.MviReactorMessageCollection -import com.sumera.koreactorlib.reactor.data.MviState +import com.sumera.koreactor.reactor.data.MviReactorMessage +import com.sumera.koreactor.reactor.data.MviReactorMessageCollection +import com.sumera.koreactor.reactor.data.MviState import java.util.* class Messages( diff --git a/lib/src/main/java/com/sumera/koreactor/behaviour/MviBehaviour.kt b/lib/src/main/java/com/sumera/koreactor/behaviour/MviBehaviour.kt new file mode 100644 index 0000000..93cef23 --- /dev/null +++ b/lib/src/main/java/com/sumera/koreactor/behaviour/MviBehaviour.kt @@ -0,0 +1,10 @@ +package com.sumera.koreactor.behaviour + +import com.sumera.koreactor.reactor.data.MviReactorMessage +import com.sumera.koreactor.reactor.data.MviState +import io.reactivex.Observable + +interface MviBehaviour { + + fun createObservable(): Observable> +} diff --git a/lib/src/main/java/com/sumera/koreactorlib/behaviour/Triggers.kt b/lib/src/main/java/com/sumera/koreactor/behaviour/Triggers.kt similarity index 91% rename from lib/src/main/java/com/sumera/koreactorlib/behaviour/Triggers.kt rename to lib/src/main/java/com/sumera/koreactor/behaviour/Triggers.kt index 2c4fa0f..49cdefe 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/behaviour/Triggers.kt +++ b/lib/src/main/java/com/sumera/koreactor/behaviour/Triggers.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactorlib.behaviour +package com.sumera.koreactor.behaviour import io.reactivex.Observable import io.reactivex.Single diff --git a/lib/src/main/java/com/sumera/koreactorlib/behaviour/Worker.kt b/lib/src/main/java/com/sumera/koreactor/behaviour/Worker.kt similarity index 94% rename from lib/src/main/java/com/sumera/koreactorlib/behaviour/Worker.kt rename to lib/src/main/java/com/sumera/koreactor/behaviour/Worker.kt index 18e3668..e8a9eca 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/behaviour/Worker.kt +++ b/lib/src/main/java/com/sumera/koreactor/behaviour/Worker.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactorlib.behaviour +package com.sumera.koreactor.behaviour import io.reactivex.Observable import io.reactivex.Single diff --git a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/InfinityLoadingBehaviour.kt b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/InfinityLoadingBehaviour.kt similarity index 82% rename from lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/InfinityLoadingBehaviour.kt rename to lib/src/main/java/com/sumera/koreactor/behaviour/implementation/InfinityLoadingBehaviour.kt index ee270fa..79394a3 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/InfinityLoadingBehaviour.kt +++ b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/InfinityLoadingBehaviour.kt @@ -1,11 +1,11 @@ -package com.sumera.koreactorlib.behaviour.implementation - -import com.sumera.koreactorlib.behaviour.Messages -import com.sumera.koreactorlib.behaviour.MviBehaviour -import com.sumera.koreactorlib.behaviour.Triggers -import com.sumera.koreactorlib.behaviour.Worker -import com.sumera.koreactorlib.reactor.data.MviReactorMessage -import com.sumera.koreactorlib.reactor.data.MviState +package com.sumera.koreactor.behaviour.implementation + +import com.sumera.koreactor.behaviour.Messages +import com.sumera.koreactor.behaviour.MviBehaviour +import com.sumera.koreactor.behaviour.Triggers +import com.sumera.koreactor.behaviour.Worker +import com.sumera.koreactor.reactor.data.MviReactorMessage +import com.sumera.koreactor.reactor.data.MviState import io.reactivex.Observable data class InfinityLoadingBehaviour( diff --git a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/LoadingBehaviour.kt b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/LoadingBehaviour.kt similarity index 73% rename from lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/LoadingBehaviour.kt rename to lib/src/main/java/com/sumera/koreactor/behaviour/implementation/LoadingBehaviour.kt index 094fc09..919daab 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/LoadingBehaviour.kt +++ b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/LoadingBehaviour.kt @@ -1,11 +1,11 @@ -package com.sumera.koreactorlib.behaviour.implementation +package com.sumera.koreactor.behaviour.implementation -import com.sumera.koreactorlib.behaviour.Messages -import com.sumera.koreactorlib.behaviour.MviBehaviour -import com.sumera.koreactorlib.behaviour.Triggers -import com.sumera.koreactorlib.behaviour.Worker -import com.sumera.koreactorlib.reactor.data.MviReactorMessage -import com.sumera.koreactorlib.reactor.data.MviState +import com.sumera.koreactor.behaviour.Messages +import com.sumera.koreactor.behaviour.MviBehaviour +import com.sumera.koreactor.behaviour.Triggers +import com.sumera.koreactor.behaviour.Worker +import com.sumera.koreactor.reactor.data.MviReactorMessage +import com.sumera.koreactor.reactor.data.MviState import io.reactivex.Observable data class LoadingBehaviour( diff --git a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/LoadingListBehaviour.kt b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/LoadingListBehaviour.kt similarity index 76% rename from lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/LoadingListBehaviour.kt rename to lib/src/main/java/com/sumera/koreactor/behaviour/implementation/LoadingListBehaviour.kt index 60e997f..fa37496 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/LoadingListBehaviour.kt +++ b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/LoadingListBehaviour.kt @@ -1,11 +1,11 @@ -package com.sumera.koreactorlib.behaviour.implementation +package com.sumera.koreactor.behaviour.implementation -import com.sumera.koreactorlib.behaviour.Messages -import com.sumera.koreactorlib.behaviour.MviBehaviour -import com.sumera.koreactorlib.behaviour.Triggers -import com.sumera.koreactorlib.behaviour.Worker -import com.sumera.koreactorlib.reactor.data.MviReactorMessage -import com.sumera.koreactorlib.reactor.data.MviState +import com.sumera.koreactor.behaviour.Messages +import com.sumera.koreactor.behaviour.MviBehaviour +import com.sumera.koreactor.behaviour.Triggers +import com.sumera.koreactor.behaviour.Worker +import com.sumera.koreactor.reactor.data.MviReactorMessage +import com.sumera.koreactor.reactor.data.MviState import io.reactivex.Observable data class LoadingListBehaviour( diff --git a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/ShowTemporaryBehaviour.kt b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/ShowTemporaryBehaviour.kt similarity index 74% rename from lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/ShowTemporaryBehaviour.kt rename to lib/src/main/java/com/sumera/koreactor/behaviour/implementation/ShowTemporaryBehaviour.kt index dd0625e..b64dbdc 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/ShowTemporaryBehaviour.kt +++ b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/ShowTemporaryBehaviour.kt @@ -1,10 +1,10 @@ -package com.sumera.koreactorlib.behaviour.implementation +package com.sumera.koreactor.behaviour.implementation -import com.sumera.koreactorlib.behaviour.Messages -import com.sumera.koreactorlib.behaviour.MviBehaviour -import com.sumera.koreactorlib.behaviour.Triggers -import com.sumera.koreactorlib.reactor.data.MviReactorMessage -import com.sumera.koreactorlib.reactor.data.MviState +import com.sumera.koreactor.behaviour.Messages +import com.sumera.koreactor.behaviour.MviBehaviour +import com.sumera.koreactor.behaviour.Triggers +import com.sumera.koreactor.reactor.data.MviReactorMessage +import com.sumera.koreactor.reactor.data.MviState import io.reactivex.Observable import java.util.concurrent.TimeUnit diff --git a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/SwipeRefreshLoadingBehaviour.kt b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/SwipeRefreshLoadingBehaviour.kt similarity index 83% rename from lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/SwipeRefreshLoadingBehaviour.kt rename to lib/src/main/java/com/sumera/koreactor/behaviour/implementation/SwipeRefreshLoadingBehaviour.kt index 76c090a..0424098 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/SwipeRefreshLoadingBehaviour.kt +++ b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/SwipeRefreshLoadingBehaviour.kt @@ -1,11 +1,11 @@ -package com.sumera.koreactorlib.behaviour.implementation - -import com.sumera.koreactorlib.behaviour.Messages -import com.sumera.koreactorlib.behaviour.MviBehaviour -import com.sumera.koreactorlib.behaviour.Triggers -import com.sumera.koreactorlib.behaviour.Worker -import com.sumera.koreactorlib.reactor.data.MviReactorMessage -import com.sumera.koreactorlib.reactor.data.MviState +package com.sumera.koreactor.behaviour.implementation + +import com.sumera.koreactor.behaviour.Messages +import com.sumera.koreactor.behaviour.MviBehaviour +import com.sumera.koreactor.behaviour.Triggers +import com.sumera.koreactor.behaviour.Worker +import com.sumera.koreactor.reactor.data.MviReactorMessage +import com.sumera.koreactor.reactor.data.MviState import io.reactivex.Observable data class SwipeRefreshLoadingBehaviour( diff --git a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/SwipeRefreshLoadingListBehaviour.kt b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/SwipeRefreshLoadingListBehaviour.kt similarity index 84% rename from lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/SwipeRefreshLoadingListBehaviour.kt rename to lib/src/main/java/com/sumera/koreactor/behaviour/implementation/SwipeRefreshLoadingListBehaviour.kt index 3b84188..ef488c1 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/SwipeRefreshLoadingListBehaviour.kt +++ b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/SwipeRefreshLoadingListBehaviour.kt @@ -1,11 +1,11 @@ -package com.sumera.koreactorlib.behaviour.implementation - -import com.sumera.koreactorlib.behaviour.Messages -import com.sumera.koreactorlib.behaviour.MviBehaviour -import com.sumera.koreactorlib.behaviour.Triggers -import com.sumera.koreactorlib.behaviour.Worker -import com.sumera.koreactorlib.reactor.data.MviReactorMessage -import com.sumera.koreactorlib.reactor.data.MviState +package com.sumera.koreactor.behaviour.implementation + +import com.sumera.koreactor.behaviour.Messages +import com.sumera.koreactor.behaviour.MviBehaviour +import com.sumera.koreactor.behaviour.Triggers +import com.sumera.koreactor.behaviour.Worker +import com.sumera.koreactor.reactor.data.MviReactorMessage +import com.sumera.koreactor.reactor.data.MviState import io.reactivex.Observable data class SwipeRefreshLoadingListBehaviour( diff --git a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/TimerBehaviour.kt b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/TimerBehaviour.kt similarity index 67% rename from lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/TimerBehaviour.kt rename to lib/src/main/java/com/sumera/koreactor/behaviour/implementation/TimerBehaviour.kt index 78432ac..f371aea 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/behaviour/implementation/TimerBehaviour.kt +++ b/lib/src/main/java/com/sumera/koreactor/behaviour/implementation/TimerBehaviour.kt @@ -1,10 +1,10 @@ -package com.sumera.koreactorlib.behaviour.implementation +package com.sumera.koreactor.behaviour.implementation -import com.sumera.koreactorlib.behaviour.Messages -import com.sumera.koreactorlib.behaviour.MviBehaviour -import com.sumera.koreactorlib.behaviour.Triggers -import com.sumera.koreactorlib.reactor.data.MviReactorMessage -import com.sumera.koreactorlib.reactor.data.MviState +import com.sumera.koreactor.behaviour.Messages +import com.sumera.koreactor.behaviour.MviBehaviour +import com.sumera.koreactor.behaviour.Triggers +import com.sumera.koreactor.reactor.data.MviReactorMessage +import com.sumera.koreactor.reactor.data.MviState import io.reactivex.Observable import java.util.concurrent.TimeUnit diff --git a/lib/src/main/java/com/sumera/koreactorlib/internal/data/Either.kt b/lib/src/main/java/com/sumera/koreactor/internal/data/Either.kt similarity index 88% rename from lib/src/main/java/com/sumera/koreactorlib/internal/data/Either.kt rename to lib/src/main/java/com/sumera/koreactor/internal/data/Either.kt index 64e712e..f35260a 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/internal/data/Either.kt +++ b/lib/src/main/java/com/sumera/koreactor/internal/data/Either.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactorlib.internal.data +package com.sumera.koreactor.internal.data sealed class Either diff --git a/lib/src/main/java/com/sumera/koreactor/internal/data/EventWithLifecycle.kt b/lib/src/main/java/com/sumera/koreactor/internal/data/EventWithLifecycle.kt new file mode 100644 index 0000000..eb916a4 --- /dev/null +++ b/lib/src/main/java/com/sumera/koreactor/internal/data/EventWithLifecycle.kt @@ -0,0 +1,10 @@ +package com.sumera.koreactor.internal.data + +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactor.reactor.data.MviState +import com.sumera.koreactor.reactor.lifecycle.LifecycleState + +data class EventWithLifecycle ( + val event: MviEvent, + val lifecycleState: LifecycleState +) \ No newline at end of file diff --git a/lib/src/main/java/com/sumera/koreactorlib/internal/extension/EventObservableExtensions.kt b/lib/src/main/java/com/sumera/koreactor/internal/extension/EventObservableExtensions.kt similarity index 81% rename from lib/src/main/java/com/sumera/koreactorlib/internal/extension/EventObservableExtensions.kt rename to lib/src/main/java/com/sumera/koreactor/internal/extension/EventObservableExtensions.kt index 9b5eaec..d162c5d 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/internal/extension/EventObservableExtensions.kt +++ b/lib/src/main/java/com/sumera/koreactor/internal/extension/EventObservableExtensions.kt @@ -1,9 +1,9 @@ -package com.sumera.koreactorlib.internal.extension +package com.sumera.koreactor.internal.extension -import com.sumera.koreactorlib.internal.data.EventWithLifecycle -import com.sumera.koreactorlib.reactor.data.MviEvent -import com.sumera.koreactorlib.reactor.data.MviState -import com.sumera.koreactorlib.reactor.lifecycle.LifecycleState +import com.sumera.koreactor.internal.data.EventWithLifecycle +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactor.reactor.data.MviState +import com.sumera.koreactor.reactor.lifecycle.LifecycleState import hu.akarnokd.rxjava2.operators.FlowableTransformers import io.reactivex.BackpressureStrategy import io.reactivex.Observable diff --git a/lib/src/main/java/com/sumera/koreactorlib/internal/extension/LifecycleEventExtensions.kt b/lib/src/main/java/com/sumera/koreactor/internal/extension/LifecycleEventExtensions.kt similarity index 83% rename from lib/src/main/java/com/sumera/koreactorlib/internal/extension/LifecycleEventExtensions.kt rename to lib/src/main/java/com/sumera/koreactor/internal/extension/LifecycleEventExtensions.kt index ee60e83..29b2d7c 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/internal/extension/LifecycleEventExtensions.kt +++ b/lib/src/main/java/com/sumera/koreactor/internal/extension/LifecycleEventExtensions.kt @@ -1,6 +1,6 @@ -package com.sumera.koreactorlib.internal.extension +package com.sumera.koreactor.internal.extension -import com.sumera.koreactorlib.reactor.lifecycle.* +import com.sumera.koreactor.reactor.lifecycle.* fun LifecycleState.isViewStarted(): Boolean = when(this) { is AttachState -> false diff --git a/lib/src/main/java/com/sumera/koreactorlib/internal/util/DetachReactorHelper.kt b/lib/src/main/java/com/sumera/koreactor/internal/util/DetachReactorHelper.kt similarity index 91% rename from lib/src/main/java/com/sumera/koreactorlib/internal/util/DetachReactorHelper.kt rename to lib/src/main/java/com/sumera/koreactor/internal/util/DetachReactorHelper.kt index 143409f..68a3875 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/internal/util/DetachReactorHelper.kt +++ b/lib/src/main/java/com/sumera/koreactor/internal/util/DetachReactorHelper.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactorlib.internal.util +package com.sumera.koreactor.internal.util import android.app.Activity import android.support.v4.app.Fragment diff --git a/lib/src/main/java/com/sumera/koreactorlib/internal/util/LifecycleEventCorrectOrderValidator.kt b/lib/src/main/java/com/sumera/koreactor/internal/util/LifecycleEventCorrectOrderValidator.kt similarity index 55% rename from lib/src/main/java/com/sumera/koreactorlib/internal/util/LifecycleEventCorrectOrderValidator.kt rename to lib/src/main/java/com/sumera/koreactor/internal/util/LifecycleEventCorrectOrderValidator.kt index d7a2061..1dc1ee4 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/internal/util/LifecycleEventCorrectOrderValidator.kt +++ b/lib/src/main/java/com/sumera/koreactor/internal/util/LifecycleEventCorrectOrderValidator.kt @@ -1,14 +1,14 @@ -package com.sumera.koreactorlib.internal.util +package com.sumera.koreactor.internal.util -import com.sumera.koreactorlib.reactor.lifecycle.AttachState -import com.sumera.koreactorlib.reactor.lifecycle.CreateState -import com.sumera.koreactorlib.reactor.lifecycle.DestroyState -import com.sumera.koreactorlib.reactor.lifecycle.DetachState -import com.sumera.koreactorlib.reactor.lifecycle.LifecycleState -import com.sumera.koreactorlib.reactor.lifecycle.PauseState -import com.sumera.koreactorlib.reactor.lifecycle.ResumeState -import com.sumera.koreactorlib.reactor.lifecycle.StartState -import com.sumera.koreactorlib.reactor.lifecycle.StopState +import com.sumera.koreactor.reactor.lifecycle.AttachState +import com.sumera.koreactor.reactor.lifecycle.CreateState +import com.sumera.koreactor.reactor.lifecycle.DestroyState +import com.sumera.koreactor.reactor.lifecycle.DetachState +import com.sumera.koreactor.reactor.lifecycle.LifecycleState +import com.sumera.koreactor.reactor.lifecycle.PauseState +import com.sumera.koreactor.reactor.lifecycle.ResumeState +import com.sumera.koreactor.reactor.lifecycle.StartState +import com.sumera.koreactor.reactor.lifecycle.StopState object LifecycleEventCorrectOrderValidator { diff --git a/lib/src/main/java/com/sumera/koreactorlib/reactor/MviReactor.kt b/lib/src/main/java/com/sumera/koreactor/reactor/MviReactor.kt similarity index 83% rename from lib/src/main/java/com/sumera/koreactorlib/reactor/MviReactor.kt rename to lib/src/main/java/com/sumera/koreactor/reactor/MviReactor.kt index a16b7a0..e89141c 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/reactor/MviReactor.kt +++ b/lib/src/main/java/com/sumera/koreactor/reactor/MviReactor.kt @@ -1,29 +1,29 @@ -package com.sumera.koreactorlib.reactor +package com.sumera.koreactor.reactor import android.arch.lifecycle.ViewModel -import com.sumera.koreactorlib.behaviour.MviBehaviour -import com.sumera.koreactorlib.internal.data.fold -import com.sumera.koreactorlib.internal.extension.cacheEventsUntilViewIsCreated -import com.sumera.koreactorlib.internal.extension.cacheEventsUntilViewIsStarted -import com.sumera.koreactorlib.internal.extension.throwEventsAwayIfViewIsNotStarted -import com.sumera.koreactorlib.internal.util.LifecycleEventCorrectOrderValidator -import com.sumera.koreactorlib.reactor.data.EventOrReducer -import com.sumera.koreactorlib.reactor.data.MviAction -import com.sumera.koreactorlib.reactor.data.MviEvent -import com.sumera.koreactorlib.reactor.data.MviReactorMessage -import com.sumera.koreactorlib.reactor.data.MviState -import com.sumera.koreactorlib.reactor.data.MviStateReducer -import com.sumera.koreactorlib.reactor.lifecycle.AttachState -import com.sumera.koreactorlib.reactor.lifecycle.CreateState -import com.sumera.koreactorlib.reactor.lifecycle.DestroyState -import com.sumera.koreactorlib.reactor.lifecycle.DetachState -import com.sumera.koreactorlib.reactor.lifecycle.LifecycleState -import com.sumera.koreactorlib.reactor.lifecycle.PauseState -import com.sumera.koreactorlib.reactor.lifecycle.ResumeState -import com.sumera.koreactorlib.reactor.lifecycle.StartState -import com.sumera.koreactorlib.reactor.lifecycle.StopState -import com.sumera.koreactorlib.util.extension.ofLifecycleType -import com.sumera.koreactorlib.view.MviBindableViewDelegate +import com.sumera.koreactor.behaviour.MviBehaviour +import com.sumera.koreactor.internal.data.fold +import com.sumera.koreactor.internal.extension.cacheEventsUntilViewIsCreated +import com.sumera.koreactor.internal.extension.cacheEventsUntilViewIsStarted +import com.sumera.koreactor.internal.extension.throwEventsAwayIfViewIsNotStarted +import com.sumera.koreactor.internal.util.LifecycleEventCorrectOrderValidator +import com.sumera.koreactor.reactor.data.EventOrReducer +import com.sumera.koreactor.reactor.data.MviAction +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactor.reactor.data.MviReactorMessage +import com.sumera.koreactor.reactor.data.MviState +import com.sumera.koreactor.reactor.data.MviStateReducer +import com.sumera.koreactor.reactor.lifecycle.AttachState +import com.sumera.koreactor.reactor.lifecycle.CreateState +import com.sumera.koreactor.reactor.lifecycle.DestroyState +import com.sumera.koreactor.reactor.lifecycle.DetachState +import com.sumera.koreactor.reactor.lifecycle.LifecycleState +import com.sumera.koreactor.reactor.lifecycle.PauseState +import com.sumera.koreactor.reactor.lifecycle.ResumeState +import com.sumera.koreactor.reactor.lifecycle.StartState +import com.sumera.koreactor.reactor.lifecycle.StopState +import com.sumera.koreactor.util.extension.ofLifecycleType +import com.sumera.koreactor.view.MviBindableViewDelegate import io.reactivex.Observable import io.reactivex.Single import io.reactivex.android.schedulers.AndroidSchedulers diff --git a/lib/src/main/java/com/sumera/koreactorlib/reactor/MviReactorFactory.kt b/lib/src/main/java/com/sumera/koreactor/reactor/MviReactorFactory.kt similarity index 88% rename from lib/src/main/java/com/sumera/koreactorlib/reactor/MviReactorFactory.kt rename to lib/src/main/java/com/sumera/koreactor/reactor/MviReactorFactory.kt index 3ab7c08..7e5a543 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/reactor/MviReactorFactory.kt +++ b/lib/src/main/java/com/sumera/koreactor/reactor/MviReactorFactory.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactorlib.reactor +package com.sumera.koreactor.reactor import android.arch.lifecycle.ViewModel import android.arch.lifecycle.ViewModelProvider diff --git a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/EventOrReducer.kt b/lib/src/main/java/com/sumera/koreactor/reactor/data/EventOrReducer.kt similarity index 63% rename from lib/src/main/java/com/sumera/koreactorlib/reactor/data/EventOrReducer.kt rename to lib/src/main/java/com/sumera/koreactor/reactor/data/EventOrReducer.kt index ff8934b..ef022d2 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/EventOrReducer.kt +++ b/lib/src/main/java/com/sumera/koreactor/reactor/data/EventOrReducer.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactorlib.reactor.data +package com.sumera.koreactor.reactor.data -import com.sumera.koreactorlib.internal.data.Either -import com.sumera.koreactorlib.internal.data.fold +import com.sumera.koreactor.internal.data.Either +import com.sumera.koreactor.internal.data.fold interface EventOrReducer : MviReactorMessage { diff --git a/lib/src/main/java/com/sumera/koreactor/reactor/data/MviAction.kt b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviAction.kt new file mode 100644 index 0000000..5c79da6 --- /dev/null +++ b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviAction.kt @@ -0,0 +1,5 @@ +package com.sumera.koreactor.reactor.data + +interface MviAction + + diff --git a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviEvent.kt b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviEvent.kt similarity index 69% rename from lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviEvent.kt rename to lib/src/main/java/com/sumera/koreactor/reactor/data/MviEvent.kt index c2a6a09..ab9966d 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviEvent.kt +++ b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviEvent.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactorlib.reactor.data +package com.sumera.koreactor.reactor.data -import com.sumera.koreactorlib.internal.data.Either -import com.sumera.koreactorlib.internal.data.EitherLeft +import com.sumera.koreactor.internal.data.Either +import com.sumera.koreactor.internal.data.EitherLeft interface MviEvent : EventOrReducer, MviReactorMessage { diff --git a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviEventBehaviour.kt b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviEventBehaviour.kt similarity index 92% rename from lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviEventBehaviour.kt rename to lib/src/main/java/com/sumera/koreactor/reactor/data/MviEventBehaviour.kt index 81cbda3..e0db8ef 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviEventBehaviour.kt +++ b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviEventBehaviour.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactorlib.reactor.data +package com.sumera.koreactor.reactor.data sealed class MviEventBehaviour { diff --git a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviReactorMessage.kt b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviReactorMessage.kt similarity index 70% rename from lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviReactorMessage.kt rename to lib/src/main/java/com/sumera/koreactor/reactor/data/MviReactorMessage.kt index e51db09..c4205d4 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviReactorMessage.kt +++ b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviReactorMessage.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactorlib.reactor.data +package com.sumera.koreactor.reactor.data interface MviReactorMessage { diff --git a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviReactorMessageCollection.kt b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviReactorMessageCollection.kt similarity index 86% rename from lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviReactorMessageCollection.kt rename to lib/src/main/java/com/sumera/koreactor/reactor/data/MviReactorMessageCollection.kt index aebc8af..e64cd9a 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviReactorMessageCollection.kt +++ b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviReactorMessageCollection.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactorlib.reactor.data +package com.sumera.koreactor.reactor.data class MviReactorMessageCollection( private val values: Collection> diff --git a/lib/src/main/java/com/sumera/koreactor/reactor/data/MviState.kt b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviState.kt new file mode 100644 index 0000000..fbf91de --- /dev/null +++ b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviState.kt @@ -0,0 +1,3 @@ +package com.sumera.koreactor.reactor.data + +interface MviState \ No newline at end of file diff --git a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviStateReducer.kt b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviStateReducer.kt similarity index 68% rename from lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviStateReducer.kt rename to lib/src/main/java/com/sumera/koreactor/reactor/data/MviStateReducer.kt index 5e8696a..cce25fe 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviStateReducer.kt +++ b/lib/src/main/java/com/sumera/koreactor/reactor/data/MviStateReducer.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactorlib.reactor.data +package com.sumera.koreactor.reactor.data -import com.sumera.koreactorlib.internal.data.Either -import com.sumera.koreactorlib.internal.data.EitherRight +import com.sumera.koreactor.internal.data.Either +import com.sumera.koreactor.internal.data.EitherRight interface MviStateReducer : EventOrReducer, MviReactorMessage { diff --git a/lib/src/main/java/com/sumera/koreactorlib/reactor/lifecycle/Lifecycle.kt b/lib/src/main/java/com/sumera/koreactor/reactor/lifecycle/Lifecycle.kt similarity index 89% rename from lib/src/main/java/com/sumera/koreactorlib/reactor/lifecycle/Lifecycle.kt rename to lib/src/main/java/com/sumera/koreactor/reactor/lifecycle/Lifecycle.kt index 8f4f284..a553580 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/reactor/lifecycle/Lifecycle.kt +++ b/lib/src/main/java/com/sumera/koreactor/reactor/lifecycle/Lifecycle.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactorlib.reactor.lifecycle +package com.sumera.koreactor.reactor.lifecycle sealed class LifecycleState { override fun toString(): String { diff --git a/lib/src/main/java/com/sumera/koreactorlib/util/data/Optional.kt b/lib/src/main/java/com/sumera/koreactor/util/data/Optional.kt similarity index 81% rename from lib/src/main/java/com/sumera/koreactorlib/util/data/Optional.kt rename to lib/src/main/java/com/sumera/koreactor/util/data/Optional.kt index 8661468..d97186a 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/util/data/Optional.kt +++ b/lib/src/main/java/com/sumera/koreactor/util/data/Optional.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactorlib.util.data +package com.sumera.koreactor.util.data data class Optional(val value: T?) { diff --git a/lib/src/main/java/com/sumera/koreactorlib/util/extension/LifecycleObservable.kt b/lib/src/main/java/com/sumera/koreactor/util/extension/LifecycleObservable.kt similarity index 60% rename from lib/src/main/java/com/sumera/koreactorlib/util/extension/LifecycleObservable.kt rename to lib/src/main/java/com/sumera/koreactor/util/extension/LifecycleObservable.kt index 5b6589e..441a26c 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/util/extension/LifecycleObservable.kt +++ b/lib/src/main/java/com/sumera/koreactor/util/extension/LifecycleObservable.kt @@ -1,6 +1,6 @@ -package com.sumera.koreactorlib.util.extension +package com.sumera.koreactor.util.extension -import com.sumera.koreactorlib.reactor.lifecycle.LifecycleState +import com.sumera.koreactor.reactor.lifecycle.LifecycleState import io.reactivex.Observable inline fun Observable.ofLifecycleType(): Observable { diff --git a/lib/src/main/java/com/sumera/koreactorlib/util/extension/MviStateObservable.kt b/lib/src/main/java/com/sumera/koreactor/util/extension/MviStateObservable.kt similarity index 89% rename from lib/src/main/java/com/sumera/koreactorlib/util/extension/MviStateObservable.kt rename to lib/src/main/java/com/sumera/koreactor/util/extension/MviStateObservable.kt index 2c69125..54a670a 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/util/extension/MviStateObservable.kt +++ b/lib/src/main/java/com/sumera/koreactor/util/extension/MviStateObservable.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactorlib.util.extension +package com.sumera.koreactor.util.extension -import com.sumera.koreactorlib.reactor.data.MviState -import com.sumera.koreactorlib.util.data.Optional +import com.sumera.koreactor.reactor.data.MviState +import com.sumera.koreactor.util.data.Optional import io.reactivex.Observable fun Observable.getChange(action: (T) -> (V)) : Observable { diff --git a/lib/src/main/java/com/sumera/koreactorlib/view/MviBindableView.kt b/lib/src/main/java/com/sumera/koreactor/view/MviBindableView.kt similarity index 59% rename from lib/src/main/java/com/sumera/koreactorlib/view/MviBindableView.kt rename to lib/src/main/java/com/sumera/koreactor/view/MviBindableView.kt index 8a1672f..4d5941d 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/view/MviBindableView.kt +++ b/lib/src/main/java/com/sumera/koreactor/view/MviBindableView.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactorlib.view +package com.sumera.koreactor.view -import com.sumera.koreactorlib.reactor.data.MviEvent -import com.sumera.koreactorlib.reactor.data.MviState +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactor.reactor.data.MviState import io.reactivex.Observable interface MviBindableView { diff --git a/lib/src/main/java/com/sumera/koreactorlib/view/MviBindableViewDelegate.kt b/lib/src/main/java/com/sumera/koreactor/view/MviBindableViewDelegate.kt similarity index 66% rename from lib/src/main/java/com/sumera/koreactorlib/view/MviBindableViewDelegate.kt rename to lib/src/main/java/com/sumera/koreactor/view/MviBindableViewDelegate.kt index f0e7947..81fb22a 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/view/MviBindableViewDelegate.kt +++ b/lib/src/main/java/com/sumera/koreactor/view/MviBindableViewDelegate.kt @@ -1,7 +1,7 @@ -package com.sumera.koreactorlib.view +package com.sumera.koreactor.view -import com.sumera.koreactorlib.reactor.data.MviEvent -import com.sumera.koreactorlib.reactor.data.MviState +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactor.reactor.data.MviState import io.reactivex.Observable interface MviBindableViewDelegate { diff --git a/lib/src/main/java/com/sumera/koreactorlib/view/delegate/MviReactorDelegate.kt b/lib/src/main/java/com/sumera/koreactor/view/delegate/MviReactorDelegate.kt similarity index 86% rename from lib/src/main/java/com/sumera/koreactorlib/view/delegate/MviReactorDelegate.kt rename to lib/src/main/java/com/sumera/koreactor/view/delegate/MviReactorDelegate.kt index 88c1857..0e48d83 100644 --- a/lib/src/main/java/com/sumera/koreactorlib/view/delegate/MviReactorDelegate.kt +++ b/lib/src/main/java/com/sumera/koreactor/view/delegate/MviReactorDelegate.kt @@ -1,15 +1,15 @@ -package com.sumera.koreactorlib.view.delegate +package com.sumera.koreactor.view.delegate import android.app.Activity import android.os.Bundle import android.support.v4.app.Fragment -import com.sumera.koreactorlib.internal.util.DetachReactorHelper -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviAction -import com.sumera.koreactorlib.reactor.data.MviEvent -import com.sumera.koreactorlib.reactor.data.MviState -import com.sumera.koreactorlib.view.MviBindableView -import com.sumera.koreactorlib.view.MviBindableViewDelegate +import com.sumera.koreactor.internal.util.DetachReactorHelper +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviAction +import com.sumera.koreactor.reactor.data.MviEvent +import com.sumera.koreactor.reactor.data.MviState +import com.sumera.koreactor.view.MviBindableView +import com.sumera.koreactor.view.MviBindableViewDelegate import io.reactivex.Observable import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign diff --git a/example/src/main/java/com/sumera/koreactor/MviAppCompatActivityDelegate.kt b/lib/src/main/java/com/sumera/koreactor/view/implementation/MviAppCompatActivityDelegate.kt similarity index 85% rename from example/src/main/java/com/sumera/koreactor/MviAppCompatActivityDelegate.kt rename to lib/src/main/java/com/sumera/koreactor/view/implementation/MviAppCompatActivityDelegate.kt index 6beeeb6..2cbc621 100644 --- a/example/src/main/java/com/sumera/koreactor/MviAppCompatActivityDelegate.kt +++ b/lib/src/main/java/com/sumera/koreactor/view/implementation/MviAppCompatActivityDelegate.kt @@ -1,15 +1,15 @@ -package com.sumera.koreactor +package com.sumera.koreactor.view.implementation import android.arch.lifecycle.ViewModel import android.arch.lifecycle.ViewModelProvider import android.arch.lifecycle.ViewModelProviders import android.os.Bundle import android.support.v7.app.AppCompatActivity -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviAction -import com.sumera.koreactorlib.reactor.data.MviState -import com.sumera.koreactorlib.view.MviBindableView -import com.sumera.koreactorlib.view.delegate.MviReactorDelegate +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviAction +import com.sumera.koreactor.reactor.data.MviState +import com.sumera.koreactor.view.MviBindableView +import com.sumera.koreactor.view.delegate.MviReactorDelegate import io.reactivex.Observable abstract class MviAppCompatActivityDelegate : AppCompatActivity(), MviBindableView { diff --git a/example/src/main/java/com/sumera/koreactor/MviFragmentDelegate.kt b/lib/src/main/java/com/sumera/koreactor/view/implementation/MviFragmentDelegate.kt similarity index 86% rename from example/src/main/java/com/sumera/koreactor/MviFragmentDelegate.kt rename to lib/src/main/java/com/sumera/koreactor/view/implementation/MviFragmentDelegate.kt index df63e2e..91a82a7 100644 --- a/example/src/main/java/com/sumera/koreactor/MviFragmentDelegate.kt +++ b/lib/src/main/java/com/sumera/koreactor/view/implementation/MviFragmentDelegate.kt @@ -1,4 +1,4 @@ -package com.sumera.koreactor +package com.sumera.koreactor.view.implementation import android.arch.lifecycle.ViewModel import android.arch.lifecycle.ViewModelProvider @@ -6,11 +6,11 @@ import android.arch.lifecycle.ViewModelProviders import android.os.Bundle import android.support.v4.app.Fragment import android.view.View -import com.sumera.koreactorlib.reactor.MviReactor -import com.sumera.koreactorlib.reactor.data.MviAction -import com.sumera.koreactorlib.reactor.data.MviState -import com.sumera.koreactorlib.view.MviBindableView -import com.sumera.koreactorlib.view.delegate.MviReactorDelegate +import com.sumera.koreactor.reactor.MviReactor +import com.sumera.koreactor.reactor.data.MviAction +import com.sumera.koreactor.reactor.data.MviState +import com.sumera.koreactor.view.MviBindableView +import com.sumera.koreactor.view.delegate.MviReactorDelegate import io.reactivex.Observable abstract class MviFragmentDelegate : Fragment(), MviBindableView { diff --git a/lib/src/main/java/com/sumera/koreactorlib/behaviour/MviBehaviour.kt b/lib/src/main/java/com/sumera/koreactorlib/behaviour/MviBehaviour.kt deleted file mode 100644 index 48ed456..0000000 --- a/lib/src/main/java/com/sumera/koreactorlib/behaviour/MviBehaviour.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.sumera.koreactorlib.behaviour - -import com.sumera.koreactorlib.reactor.data.MviReactorMessage -import com.sumera.koreactorlib.reactor.data.MviState -import io.reactivex.Observable - -interface MviBehaviour { - - fun createObservable(): Observable> -} diff --git a/lib/src/main/java/com/sumera/koreactorlib/internal/data/EventWithLifecycle.kt b/lib/src/main/java/com/sumera/koreactorlib/internal/data/EventWithLifecycle.kt deleted file mode 100644 index 5a7eda4..0000000 --- a/lib/src/main/java/com/sumera/koreactorlib/internal/data/EventWithLifecycle.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.sumera.koreactorlib.internal.data - -import com.sumera.koreactorlib.reactor.data.MviEvent -import com.sumera.koreactorlib.reactor.data.MviState -import com.sumera.koreactorlib.reactor.lifecycle.LifecycleState - -data class EventWithLifecycle ( - val event: MviEvent, - val lifecycleState: LifecycleState -) \ No newline at end of file diff --git a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviAction.kt b/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviAction.kt deleted file mode 100644 index ad44cd3..0000000 --- a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviAction.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.sumera.koreactorlib.reactor.data - -interface MviAction - - diff --git a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviState.kt b/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviState.kt deleted file mode 100644 index d8b9748..0000000 --- a/lib/src/main/java/com/sumera/koreactorlib/reactor/data/MviState.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.sumera.koreactorlib.reactor.data - -interface MviState \ No newline at end of file diff --git a/lib/src/test/java/com/sumera/koreactor/ExampleUnitTest.java b/lib/src/test/java/com/sumera/koreactorexampleapp/ExampleUnitTest.java similarity index 90% rename from lib/src/test/java/com/sumera/koreactor/ExampleUnitTest.java rename to lib/src/test/java/com/sumera/koreactorexampleapp/ExampleUnitTest.java index 05423a4..683368d 100644 --- a/lib/src/test/java/com/sumera/koreactor/ExampleUnitTest.java +++ b/lib/src/test/java/com/sumera/koreactorexampleapp/ExampleUnitTest.java @@ -1,4 +1,4 @@ -package com.sumera.koreactor; +package com.sumera.koreactorexampleapp; import org.junit.Test;