Skip to content

Instantly share code, notes, and snippets.

View ryansgot's full-sized avatar

Ryan ryansgot

  • Fukuoka, Japan
  • 22:43 (UTC +09:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ryansgot on github.
  • I am ryansgot (https://keybase.io/ryansgot) on keybase.
  • I have a public key ASAAzPNnn8DC6ZF7hUO_-gh2cy1t2s9r6Ds-IBgFeDEzNwo

To claim this, I am signing this object:

@ryansgot
ryansgot / DrawableMatcher.java
Created July 23, 2018 22:31
Espresso testing Drawables with color filters
public class DrawableMatcher extends TypeSafeMatcher<View> {
public interface Extractor {
@NonNull Drawable extract(@NonNull View v);
}
private String mReason;
@DrawableRes private final int mDrawableId;
private ColorFilter mExpectedColorFilter;
private Extractor mExtractor;
@ryansgot
ryansgot / android_kotlin_directdb_app_build.gradle
Last active October 17, 2018 13:16
ForSure DB Android directdb Kotlin app build.grade
apply plugin: 'com.android.application'
apply plugin: 'com.fsryan.gradle.forsuredb'
apply plugin: 'kotlin-android' // <-- must appear after applying forsuredb
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
dependencies {
kapt 'com.fsryan.forsuredb:forsuredbcompiler:0.13.0'
implementation 'com.fsryan.forsuredb:forsuredbapi:0.13.0'
implementation 'com.fsryan.forsuredb:sqlitelib:0.13.0'
@ryansgot
ryansgot / android_java_directdb_app_build.gradle
Last active October 17, 2018 13:17
ForSure DB Android directdb java app build.grade
apply plugin: 'com.android.application'
apply plugin: 'com.fsryan.gradle.forsuredb'
dependencies {
annotationProcessor 'com.fsryan.forsuredb:forsuredbcompiler:0.13.0'
implementation 'com.fsryan.forsuredb:forsuredbapi:0.13.0'
implementation 'com.fsryan.forsuredb:sqlitelib:0.13.0'
implementation 'com.fsryan.forsuredb:forsuredbandroid-directdb:0.13.0'
// forsuredbmodels-jackson and forsuredbmodels-moshi are also options
implementation 'com.fsryan.forsuredb:forsuredbmodels-gson:0.13.0'
@ryansgot
ryansgot / android_java_contentprovider_app_build.gradle
Last active October 17, 2018 13:17
ForSure DB Android contentprovider Java app build.grade
apply plugin: 'com.android.application'
apply plugin: 'com.fsryan.gradle.forsuredb'
dependencies {
annotationProcessor 'com.fsryan.forsuredb:forsuredbcompiler:0.13.0'
implementation 'com.fsryan.forsuredb:forsuredbapi:0.13.0'
implementation 'com.fsryan.forsuredb:sqlitelib:0.13.0'
implementation 'com.fsryan.forsuredb:forsuredbandroid-contentprovider:0.13.0'
// forsuredbmodels-jackson and forsuredbmodels-moshi are also options
implementation 'com.fsryan.forsuredb:forsuredbmodels-gson:0.13.0'
@ryansgot
ryansgot / android_kotlin_contentprovider_app_build.gradle
Last active October 17, 2018 13:16
ForSure DB Android contentprovider Kotlin app build.grade
apply plugin: 'com.android.application'
apply plugin: 'com.fsryan.gradle.forsuredb'
apply plugin: 'kotlin-android' // <-- must appear after applying forsuredb
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
dependencies {
kapt 'com.fsryan.forsuredb:forsuredbcompiler:0.13.0'
implementation 'com.fsryan.forsuredb:forsuredbapi:0.13.0'
implementation 'com.fsryan.forsuredb:sqlitelib:0.13.0'
@ryansgot
ryansgot / App_directdb.java
Last active June 8, 2018 05:03
ForSureDB Example App.java (directdb)
import android.app.Application;
import com.fsryan.forsuredb.FSDBHelper;
import com.fsryan.forsuredb.ForSureAndroidInfoFactory;
import com.fsryan.forsuredb.gsonserialization.FSDbInfoGsonSerializer;
import com.fsryan.forsuredb.api.FSTableCreator;
public class App extends Application {
@Override
public void onCreate() {
@ryansgot
ryansgot / App_directdb.kt
Last active June 8, 2018 05:05
ForSureDB Example App.kt (directdb)
import android.app.Application
import com.fsryan.forsuredb.FSDBHelper
import com.fsryan.forsuredb.ForSureAndroidInfoFactory
import com.fsryan.forsuredb.gsonserialization.FSDbInfoGsonSerializer
import com.fsryan.forsuredb.api.FSTableCreator
class App : Application() {
override fun onCreate() {
@ryansgot
ryansgot / App_contentprovider.java
Last active June 8, 2018 03:56
ForSureDB Example App.java (contentprovider)
import android.app.Application;
import com.fsryan.forsuredb.FSDBHelper;
import com.fsryan.forsuredb.ForSureAndroidInfoFactory;
import com.fsryan.forsuredb.gsonserialization.FSDbInfoGsonSerializer;
import com.fsryan.forsuredb.api.FSTableCreator;
public class App extends Application {
@Override
public void onCreate() {
@ryansgot
ryansgot / forsuredb_androidmanifest_directdb.xml
Created June 8, 2018 02:04
ForSure DB AndroidManifest (with directdb)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fsryan.example.forsuredb">
<!-- Must decalre an application class -->
<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"