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.Properties | |
android { | |
compileSdkVersion(Config.Android.compileSdkVersion) | |
buildToolsVersion = Config.Android.buildToolsVersion | |
defaultConfig { | |
minSdkVersion(Config.Android.minSdkVersion) | |
versionCode = Config.Libs.versionCode | |
versionName = Config.Libs.versionName |
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
class OkHttp3IdlingResource( | |
private val name: String, | |
private val dispatcher: Dispatcher | |
) : IdlingResource { | |
private val callbackReference = AtomicReference<ResourceCallback>() | |
init { | |
dispatcher.idleCallback = Runnable { | |
callbackReference.get()?.onTransitionToIdle() |
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
102 # keep model classes e.g. kotlin data classes without need of @Keep or @SerializedName annotations | |
103 -keep class com.yourapppackage.app.**.model.** { <fields>; } |
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
@Override | |
protected void onDraw(Canvas canvas) { | |
super.onDraw(canvas); | |
mPaint.setStyle(Paint.Style.STROKE); | |
mPaint.setStrokeWidth(50); | |
// Setting the color of the circle | |
mPaint.setColor(Color.BLUE); | |
// Draw the circle at (x,y) with radius 250 |
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 void enableStrictMode() { | |
StrictMode.ThreadPolicy.Builder threadPolicyBuilder = new StrictMode.ThreadPolicy.Builder() | |
.detectAll() | |
.penaltyFlashScreen() | |
.penaltyLog(); | |
StrictMode.VmPolicy.Builder vmPolicyBuilder = new StrictMode.VmPolicy.Builder() | |
.detectAll() | |
.penaltyLog(); | |
StrictMode.setThreadPolicy(threadPolicyBuilder.build()); |
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
/** | |
* Utils for I/O operations. | |
* <p/> | |
* Created by Tomek on 09/06/15. | |
*/ | |
public class IoUtils { | |
/** | |
* Reads file and returns a String. | |
* |
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
/** | |
* View showing rotating SweepGradient. | |
*/ | |
class RotatingGradientView @JvmOverloads constructor( | |
context: Context?, | |
attrs: AttributeSet? = null, | |
defStyleAttr: Int = 0 | |
) : View(context, attrs, defStyleAttr) { | |
private val paint = Paint(Paint.ANTI_ALIAS_FLAG) | |
private var middleX = 0f |
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 kotlinx.coroutines.CoroutineStart.LAZY | |
import kotlinx.coroutines.Deferred | |
import kotlinx.coroutines.async | |
import kotlinx.coroutines.cancelAndJoin | |
import kotlinx.coroutines.coroutineScope | |
import kotlinx.coroutines.sync.Mutex | |
import kotlinx.coroutines.sync.withLock | |
import kotlinx.coroutines.yield | |
import java.util.concurrent.atomic.AtomicReference | |
import kotlin.DeprecationLevel.ERROR |
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
/** | |
* Timber log tree for production. | |
*/ | |
public class CrashReportingTree extends Timber.Tree{ | |
@Override protected void log(int priority, String tag, String message, Throwable throwable) { | |
switch (priority) { | |
case Log.VERBOSE: | |
case Log.DEBUG: | |
case Log.INFO: |
NewerOlder