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
public class ViewModelInjectionFactory<VM extends ViewModel> implements ViewModelProvider.Factory { | |
private Lazy<VM> viewModel; | |
@Inject | |
public ViewModelInjectionFactory(Lazy<VM> viewModel) { | |
this.viewModel = viewModel; | |
} | |
@Override |
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 java.util.concurrent.TimeUnit; | |
import io.reactivex.ObservableOperator; | |
import io.reactivex.Observer; | |
import io.reactivex.disposables.Disposable; | |
public class FilterWithTimeout<T> implements ObservableOperator<T, T> { | |
private final long intervalDuration; | |
private final TimeUnit unit; |
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 me.mesmo.app.presentation.views; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.support.annotation.ColorInt; | |
import android.support.annotation.Nullable; | |
import android.support.v7.widget.AppCompatTextView; | |
import android.text.Layout; |
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
public class ResourceProvider { | |
private final Context context; | |
@Inject | |
public ResourceProvider(Context context) { | |
this.context = context; | |
} | |
@NonNull |
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
private TimedCacheSource<Discover> discoverObservable = TimedCacheSource.createWithTimeout(30, TimeUnit.SECONDS); | |
public Single<Discover> getProviders() { | |
return discoverObservable.switchIfEmpty(fetchProviders().doOnSuccess(discoverObservable)); | |
} |
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 me.mesmo.app.utils.cache; | |
import com.jakewharton.rxrelay2.PublishRelay; | |
import com.jakewharton.rxrelay2.Relay; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.atomic.AtomicReference; | |
import io.reactivex.Completable; | |
import io.reactivex.Observable; |
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
public interface Consumer<T> { | |
void accept(T value); | |
} |
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
@Module | |
abstract class FragmentBindingModule { | |
@Binds | |
abstract fun bindFragmentFactory(factory: FragmentInjectionFactory): FragmentFactory | |
@Binds | |
@IntoMap | |
@FragmentKey(MainFragment::class) | |
abstract fun bindMainFragment(fragment: MainFragment): Fragment |
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.annotation.SuppressLint | |
import android.app.Activity | |
import android.content.Context | |
import android.content.res.ColorStateList | |
import android.content.res.Resources | |
import android.graphics.Typeface | |
import android.graphics.drawable.Drawable | |
import android.view.View | |
import android.view.animation.Animation | |
import android.view.animation.AnimationUtils |
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
const puppeteerLottie = require("puppeteer-lottie"); | |
const fs = require("fs"); | |
const baseInputDir = "lotties/"; | |
const baseOutputDir = "lotties-rendered/"; | |
const outputExtension = '.mp4'; | |
(async () => { | |
await run(); |
OlderNewer