This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal sealed class ListState : State { | |
data class Screen( | |
val giphies: List<GiphyItem> = emptyList(), | |
val loadingMode: Mode = Mode.IDLE_REFRESH | |
) : ListState() | |
data class Error( | |
val errorMessage: Int | |
) : ListState(), SingleEvent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal sealed class ListAction : Action { | |
data class Refresh( | |
val limit: Int = DEFAULT_LIMIT | |
) : ListAction() | |
data class LoadMore( | |
val offset: Int | |
) : ListAction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlin.reflect.KProperty | |
internal class Component(modules: List<Module>, private val parentComponent: Component? = null) { | |
private val providers: Map<Class<*>, Provider<*>> = hashMapOf<Class<*>, Provider<*>>().apply { | |
modules.forEach { putAll(it) } | |
} | |
inline fun <reified T> get() = get(T::class.java) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.support.v4.widget.SwipeRefreshLayout; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.AttributeSet; | |
import android.view.LayoutInflater; | |
import android.widget.FrameLayout; | |
import android.widget.ProgressBar; | |
import android.widget.TextView; |
NewerOlder