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
package com.example.observable_queue; | |
import android.support.annotation.Nullable; | |
import java.util.Arrays; | |
import rx.Observable; | |
import rx.Scheduler; | |
import rx.android.schedulers.AndroidSchedulers; | |
import rx.subjects.BehaviorSubject; |
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
sealed class Optional<out T> { | |
data class Just<out T>(val element: T): Optional<T>() | |
object None: Optional<Nothing>() | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Turtle | |
import Prelude hiding (FilePath) | |
import qualified Data.Text as T | |
import qualified Control.Foldl as Fold | |
import Data.Maybe | |
import Control.Monad (filterM) |
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
package com.dimsuz.lcefilterdelay | |
import io.reactivex.Observable | |
import io.reactivex.ObservableSource | |
import io.reactivex.Observer | |
import io.reactivex.Scheduler | |
import io.reactivex.disposables.Disposable | |
import io.reactivex.exceptions.Exceptions | |
import io.reactivex.internal.disposables.DisposableHelper | |
import io.reactivex.internal.fuseable.SimpleQueue |
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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:background="#f2f2f2" | |
android:layout_height="wrap_content"> | |
<!-- notice margin top + bottom here --> | |
<ImageView |
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
package com.dimsuz.diffdispatcher.sample; | |
import java.lang.Override; | |
import javax.annotation.Nonnull; | |
import javax.annotation.Nullable; | |
public final class UserInfoViewStateDiffDispatcher_Generated implements UserInfoViewStateDiffDispatcher { | |
private final UserInfoRenderer receiver; | |
public UserInfoViewStateDiffDispatcher_Generated(UserInfoRenderer receiver) { |
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
class ViewStateRendererDispatcher(private val receiver: ViewStateRenderer) { | |
fun dispatch(viewState: ViewState, previousViewState: ViewState?) { | |
if (viewState.users != previousViewState?.users) { | |
receiver.renderUsers(viewState.users) | |
} | |
if (viewState.categories != previousViewState?.categories | |
|| viewState.users != previuosViewState?.users) { | |
receiver.renderCategories(viewState.categories, viewState.users) | |
} | |
if (viewState.showProgressBar != previousViewState?.showProgressBar |
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
class MyFragmentOrActivity : BaseActivityOrFragment, ViewStateRenderer { | |
private val renderDispatcher = ViewStateDiffDispatcher.Builder() | |
.target(this) // <-- a class wich implements ViewStateRenderer and will receive render calls | |
.build() | |
private var previousViewState: ViewState? = null | |
fun render(viewState: ViewState) { | |
renderDispatcher.dispatch(viewState, previousViewState) |
OlderNewer