This file contains hidden or 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 androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.LifecycleRegistry | |
class LifecycleTestOwner : LifecycleOwner { | |
private val registry = LifecycleRegistry(this) | |
override fun getLifecycle(): Lifecycle { | |
return registry |
This file contains hidden or 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 AppOnVisibilityChangeListener() : LifecycleObserver { | |
var isVisible = MutableLiveData<Boolean>() | |
init { | |
AppLog.d("Initialising") | |
ProcessLifecycleOwner.get().lifecycle.addObserver(this) | |
} | |
@OnLifecycleEvent(Lifecycle.Event.ON_STOP) |
This file contains hidden or 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.app.Activity; | |
import android.app.Application; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.support.annotation.NonNull; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.support.v4.app.FragmentManager; | |
import timber.log.Timber; |
This file contains hidden or 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 com.crashlytics.android.Crashlytics | |
import com.squareup.leakcanary.AnalysisResult | |
import com.squareup.leakcanary.DisplayLeakService | |
import com.squareup.leakcanary.HeapDump | |
import io.fabric.sdk.android.Fabric | |
import timber.log.Timber | |
class LeakUploadService : DisplayLeakService() { | |
override fun afterDefaultHandling( |
This file contains hidden or 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 com.google.gson.Gson | |
abstract class BaseJsonTest { | |
val serializer = Serializer() | |
inner class Serializer { | |
private val gson = Gson() |
This file contains hidden or 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.os.Bundle | |
import android.os.Parcel | |
import android.os.Parcelable | |
/** | |
* Inspired from [here](https://gist.github.com/tomaszpolanski/92a2eada1e06e4a4c71abb298d397173#file-utils-kt) | |
*/ | |
abstract class BaseParcelableTest { |
This file contains hidden or 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"?> | |
<resources> | |
<!--reds--> | |
<color name="md_red_50">#FFEBEE</color> | |
<color name="md_red_100">#FFCDD2</color> | |
<color name="md_red_200">#EF9A9A</color> | |
<color name="md_red_300">#E57373</color> | |
<color name="md_red_400">#EF5350</color> | |
<color name="md_red_500">#F44336</color> | |
<color name="md_red_600">#E53935</color> |
This file contains hidden or 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.TargetApi; | |
import android.content.Context; | |
import android.os.Build; | |
import android.os.Handler; | |
import android.os.Looper; | |
import android.util.AttributeSet; | |
import android.widget.TextView; | |
/** | |
* Written by Michael Fotiadis |