Instead of the verbose setOnClickListener:
RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));Observable
.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)| class FooBarFragment : Fragment() { | |
| companion object { | |
| fun newInstance(foo: String, bar: String?) = FooBarFragment().apply { | |
| this.foo = foo | |
| this.bar = bar | |
| } | |
| } | |
| private var foo: String by argumentNotNull() |
| root = true | |
| [*] | |
| charset = utf-8 | |
| end_of_line = lf | |
| indent_size = 4 | |
| indent_style = space | |
| insert_final_newline = true | |
| trim_trailing_whitespace = true | |
| max_line_length = 120 |
| class Phone(sendSmsCode: SendSmsCodeUseCase) : ActorReducerFeature<Wish, Effect, PhoneState, News>( | |
| initialState = PhoneState(), | |
| actor = PhoneActor(sendSmsCode), | |
| reducer = PhoneReducer(), | |
| newsPublisher = PhoneNewsPublisher() | |
| ) { | |
| data class PhoneState( | |
| val selectedCountryCode: CountryCodeEntity = CountryCodeEntity("us", "United States of America", "1"), | |
| val phone: String = "", |
| #!/usr/bin/env bash | |
| # I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very | |
| # well, so I wrote my own script to do the simple job of converting package names. | |
| # | |
| # You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv | |
| # | |
| # It'll run faster on a clean build because then there are fewer files to scan over. | |
| # | |
| # Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`. |
| public class BezInterpolator { | |
| private static BezInterpolator bezInterpolator; | |
| //Control points to create the cubic bezier curve. | |
| private float[] PRINCIPLE_DEFAULT_EASE = {(float)0.25, (float)0.1, (float)0.25, (float)1.0}; | |
| private float[] EASE_OUT = {(float)0, (float)0, (float)0.58, (float)1.0}; | |
| private float[] EASE_IN = {(float)0.42, (float)0, (float)1.0, (float)1.0}; | |
| public static BezInterpolator getInstance(){ |
| /** | |
| * Orginal http://stackoverflow.com/questions/23122088/colored-boxed-with-letters-a-la-gmail | |
| * Used to create a {@link Bitmap} that contains a letter used in the English | |
| * alphabet or digit, if there is no letter or digit available, a default image | |
| * is shown instead. | |
| * | |
| * Only English language supported. | |
| */ | |
| public class LetterBitmap { |
| import rx.Observable | |
| import rx.Observer | |
| import rx.Subscriber | |
| import rx.Subscription | |
| import rx.functions.Action0 | |
| import rx.functions.Action1 | |
| fun <T> Observable<T>.uiSubscribe(schedulers: Schedulers, subscriber: Subscriber<in T>): Subscription { | |
| return subscribeOn(schedulers.io) | |
| .observeOn(schedulers.mainThread) |
| #!/bin/bash | |
| # Vadim Zaliva lord@crocodile.org | |
| # based on https://gist.github.com/hadess/6847281 | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "This script must be run as root" 1>&2 | |
| exit 1 | |
| fi |
| import android.app.Activity; | |
| import android.content.Context; | |
| import android.graphics.Rect; | |
| import android.view.View; | |
| import android.view.inputmethod.InputMethodManager; | |
| public class KeyboardUtils { | |
| public static void hideKeyboard(Activity activity) { | |
| View view = activity.findViewById(android.R.id.content); |