Skip to content

Instantly share code, notes, and snippets.

View randallmitchell's full-sized avatar

Randall Mitchell randallmitchell

  • Maryland
View GitHub Profile
@randallmitchell
randallmitchell / themes.xml
Created October 3, 2018 04:29
Setting the theme for spinners when using an AppCompat theme.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="spinnerStyle">@style/Spinner</item>
<item name="android:spinnerItemStyle">@style/Spinner.Item</item>
<item name="spinnerDropDownItemStyle">@style/Spinner.Dropdown</item>
</style>
<!-- styling for the main widget -->
<style name="Spinner" parent="@style/Widget.AppCompat.Spinner">
@randallmitchell
randallmitchell / LifecycleFriendlyReactiveSample.kt
Last active April 28, 2018 04:02
Solving Android Inactive Lifecycle State Data Events in a Reactive Environment using Relays
package com.methodsignature.sample
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.jakewharton.rxrelay2.BehaviorRelay
import io.reactivex.Observable
import io.reactivex.disposables.CompositeDisposable
data class Data(
val id: Long,
@randallmitchell
randallmitchell / FunctionalActivityExample.kt
Created April 19, 2018 22:16
Android Functional Activity Approach
package com.methodsignature.kotlin.example
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.Toast
/**
* Base class that supports composition and handles the boilerplate.
*/
@randallmitchell
randallmitchell / SkipExceptionTest.kt
Last active January 12, 2018 17:43
RxJava Filter on Error with Kotlin
import io.reactivex.Observable
import io.reactivex.Single
import io.reactivex.schedulers.Schedulers
import junit.framework.Assert
import org.junit.Test
import java.util.*
class SkipExceptionTest {
private val data: Map<Int, String> = mapOf(
package com.methodsignature.listlauncher;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Scheduler;