Skip to content

Commit

Permalink
Split to packages
Browse files Browse the repository at this point in the history
  • Loading branch information
SumeraMartin committed Feb 4, 2018
1 parent cca3d60 commit 8f65c52
Show file tree
Hide file tree
Showing 90 changed files with 295 additions and 300 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import android.arch.lifecycle.ViewModelProvider
import android.arch.lifecycle.ViewModelProviders
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
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 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 io.reactivex.Observable

abstract class MviAppCompatActivityDelegate<STATE : MviState> : AppCompatActivity(), MviBindableView<STATE> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.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 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 io.reactivex.Observable

abstract class MviFragmentDelegate<STATE : MviState> : Fragment(), MviBindableView<STATE> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.sumera.koreactor.ui.base
import android.os.Bundle
import android.support.v4.app.Fragment
import com.sumera.koreactor.MviAppCompatActivityDelegate
import com.sumera.koreactor.reactor.data.MviState
import com.sumera.koreactorlib.reactor.data.MviState
import dagger.android.AndroidInjection
import dagger.android.AndroidInjector
import dagger.android.DispatchingAndroidInjector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.sumera.koreactor.MviFragmentDelegate
import com.sumera.koreactor.reactor.data.MviState
import com.sumera.koreactorlib.reactor.data.MviState
import dagger.android.AndroidInjector
import dagger.android.DispatchingAndroidInjector
import dagger.android.support.AndroidSupportInjection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.sumera.koreactor.ui.base.stateless

import com.sumera.koreactor.reactor.data.MviState
import com.sumera.koreactorlib.reactor.data.MviState

object EmptyState: MviState
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sumera.koreactor.ui.base.stateless

import com.sumera.koreactor.reactor.MviReactor
import com.sumera.koreactorlib.reactor.MviReactor
import com.sumera.koreactor.ui.base.BaseActivity
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.sumera.koreactor.ui.base.stateless

import com.sumera.koreactor.injection.PerActivity
import com.sumera.koreactor.reactor.MviReactor
import com.sumera.koreactor.reactor.data.MviAction
import com.sumera.koreactorlib.reactor.MviReactor
import com.sumera.koreactorlib.reactor.data.MviAction
import io.reactivex.Observable
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.sumera.koreactor.ui.base.stateless

import com.sumera.koreactor.injection.PerActivity
import com.sumera.koreactor.reactor.MviReactorFactory
import com.sumera.koreactorlib.reactor.MviReactorFactory
import javax.inject.Inject
import javax.inject.Provider

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import android.os.Bundle
import android.widget.Toast
import com.jakewharton.rxbinding2.view.clicks
import com.sumera.koreactor.R
import com.sumera.koreactor.reactor.MviReactor
import com.sumera.koreactor.reactor.data.MviEvent
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.koreactor.util.extension.getChange
import com.sumera.koreactorlib.reactor.MviReactor
import com.sumera.koreactorlib.reactor.data.MviEvent
import com.sumera.koreactorlib.util.extension.getChange
import io.reactivex.Observable
import kotlinx.android.synthetic.main.activity_counter.*
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.sumera.koreactor.ui.feature.counter

import com.sumera.koreactor.reactor.MviReactor
import com.sumera.koreactor.reactor.data.MviAction
import com.sumera.koreactorlib.reactor.MviReactor
import com.sumera.koreactorlib.reactor.data.MviAction
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.DecrementReducer
import com.sumera.koreactor.ui.feature.counter.contract.IncrementAction
import com.sumera.koreactor.ui.feature.counter.contract.IncrementReducer
import com.sumera.koreactor.ui.feature.counter.contract.ShowNumberIsDivisibleByFiveToast
import com.sumera.koreactor.util.extension.getChange
import com.sumera.koreactorlib.util.extension.getChange
import com.sumera.koreactor.injection.PerActivity
import io.reactivex.Observable
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.sumera.koreactor.ui.feature.counter

import com.sumera.koreactor.reactor.MviReactorFactory
import com.sumera.koreactor.injection.PerActivity
import com.sumera.koreactorlib.reactor.MviReactorFactory
import javax.inject.Inject
import javax.inject.Provider

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sumera.koreactor.ui.feature.counter.contract

import com.sumera.koreactor.reactor.data.MviAction
import com.sumera.koreactorlib.reactor.data.MviAction

sealed class CounterActions : MviAction<CounterState>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sumera.koreactor.ui.feature.counter.contract

import com.sumera.koreactor.reactor.data.MviEvent
import com.sumera.koreactorlib.reactor.data.MviEvent

sealed class CounterEvents: MviEvent<CounterState>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sumera.koreactor.ui.feature.counter.contract

import com.sumera.koreactor.reactor.data.MviState
import com.sumera.koreactorlib.reactor.data.MviState

data class CounterState(
val counter: Int
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sumera.koreactor.ui.feature.counter.contract

import com.sumera.koreactor.reactor.data.MviStateReducer
import com.sumera.koreactorlib.reactor.data.MviStateReducer

sealed class CounterStateReducers: MviStateReducer<CounterState>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package com.sumera.koreactor.ui.feature.infinity
import android.os.Bundle
import android.support.v7.widget.LinearLayoutManager
import com.sumera.koreactor.R
import com.sumera.koreactor.reactor.MviReactor
import com.sumera.koreactor.reactor.data.MviEvent
import com.sumera.koreactor.ui.base.BaseActivity
import com.sumera.koreactor.ui.common.PlaceholderLayout
import com.sumera.koreactor.ui.feature.infinity.adapter.InfinityAdapter
Expand All @@ -13,12 +11,12 @@ 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.todo.InfinityReactor
import com.sumera.koreactor.ui.feature.todo.InfinityReactorFactory
import com.sumera.koreactor.ui.feature.todo.contract.InfinityState
import com.sumera.koreactor.util.data.asOptional
import com.sumera.koreactor.util.extension.getChange
import com.sumera.koreactor.util.extension.getTrue
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 io.reactivex.Observable
import kotlinx.android.synthetic.main.activity_infinity.*
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
package com.sumera.koreactor.ui.feature.todo
package com.sumera.koreactor.ui.feature.infinity

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.data.ToDoItem
import com.sumera.koreactor.reactor.MviReactor
import com.sumera.koreactor.reactor.data.MviAction
import com.sumera.koreactor.reactor.lifecycle.AttachState
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
Expand All @@ -19,9 +13,15 @@ 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.koreactor.ui.feature.todo.contract.InfinityState
import com.sumera.koreactor.util.extension.ofLifecycleType
import com.sumera.koreactor.injection.PerActivity
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 io.reactivex.Observable
import io.reactivex.functions.BiFunction
import java.util.*
Expand Down Expand Up @@ -50,7 +50,7 @@ class InfinityReactor @Inject constructor(
val itemClickedAction = actions.ofActionType<OnItemClickedAction>()

val startLoadingNextDataAction = bottomScrolledAction
.withLatestFrom(stateObservable, BiFunction { _: OnScrolledToBottomAction, state:InfinityState -> state })
.withLatestFrom(stateObservable, BiFunction { _: OnScrolledToBottomAction, state: InfinityState -> state })
.filter { !it.isInfinityLoading && !it.isInfinityError }

LoadingListBehaviour<Any, ToDoItem, InfinityState>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.sumera.koreactor.ui.feature.todo
package com.sumera.koreactor.ui.feature.infinity

import com.sumera.koreactor.injection.PerActivity
import com.sumera.koreactor.reactor.MviReactorFactory
import com.sumera.koreactorlib.reactor.MviReactorFactory
import javax.inject.Inject
import javax.inject.Provider

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.sumera.koreactor.ui.feature.infinity.contract

import com.sumera.koreactor.data.ToDoItem
import com.sumera.koreactor.reactor.data.MviAction
import com.sumera.koreactor.ui.feature.todo.contract.InfinityState
import com.sumera.koreactorlib.reactor.data.MviAction

sealed class InfinityActions : MviAction<InfinityState>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.sumera.koreactor.ui.feature.infinity.contract

import com.sumera.koreactor.reactor.data.MviEvent
import com.sumera.koreactor.ui.feature.todo.contract.InfinityState
import com.sumera.koreactorlib.reactor.data.MviEvent

sealed class InfinityEvents : MviEvent<InfinityState>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.sumera.koreactor.ui.feature.todo.contract
package com.sumera.koreactor.ui.feature.infinity.contract

import com.sumera.koreactor.data.ToDoItem
import com.sumera.koreactor.reactor.data.MviState
import com.sumera.koreactorlib.reactor.data.MviState

data class InfinityState(
val isInitialLoading: Boolean,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.sumera.koreactor.ui.feature.infinity.contract

import com.sumera.koreactor.data.ToDoItem
import com.sumera.koreactor.reactor.data.MviStateReducer
import com.sumera.koreactor.ui.feature.todo.contract.InfinityState
import com.sumera.koreactorlib.reactor.data.MviStateReducer

sealed class InfinityStateReducer : MviStateReducer<InfinityState>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.content.Intent
import android.os.Bundle
import com.jakewharton.rxbinding2.view.clicks
import com.sumera.koreactor.R
import com.sumera.koreactor.reactor.MviReactor
import com.sumera.koreactor.reactor.data.MviEvent
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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.sumera.koreactor.ui.feature.main

import com.sumera.koreactor.reactor.MviReactor
import com.sumera.koreactor.reactor.data.MviAction
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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sumera.koreactor.ui.feature.main

import com.sumera.koreactor.reactor.MviReactorFactory
import com.sumera.koreactorlib.reactor.MviReactorFactory
import com.sumera.koreactor.injection.PerActivity
import javax.inject.Inject
import javax.inject.Provider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sumera.koreactor.ui.feature.main.contract

import com.sumera.koreactor.reactor.data.MviAction
import com.sumera.koreactorlib.reactor.data.MviAction

sealed class MainActions : MviAction<MainState>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sumera.koreactor.ui.feature.main.contract

import com.sumera.koreactor.reactor.data.MviEvent
import com.sumera.koreactorlib.reactor.data.MviEvent

sealed class MainEvent : MviEvent<MainState>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.sumera.koreactor.ui.feature.main.contract

import com.sumera.koreactor.reactor.data.MviState
import com.sumera.koreactorlib.reactor.data.MviState

object MainState : MviState
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package com.sumera.koreactor.ui.feature.simpleloading

import android.os.Bundle
import com.sumera.koreactor.R
import com.sumera.koreactor.reactor.MviReactor
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.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 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 io.reactivex.Observable
import kotlinx.android.synthetic.main.activity_simple_loading.*
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sumera.koreactor.ui.feature.simpleloading

import com.sumera.koreactor.reactor.MviReactorFactory
import com.sumera.koreactorlib.reactor.MviReactorFactory
import com.sumera.koreactor.injection.PerActivity
import javax.inject.Inject
import javax.inject.Provider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.sumera.koreactor.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.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.koreactor.reactor.MviReactor
import com.sumera.koreactor.reactor.data.MviAction
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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.sumera.koreactor.ui.feature.simpleloading.contract

import com.sumera.koreactor.reactor.data.MviAction
import com.sumera.koreactorlib.reactor.data.MviAction

sealed class SimpleLoadingActions : MviAction<SimpleLoadingState>

Expand Down
Loading

0 comments on commit 8f65c52

Please sign in to comment.