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
#!/bin/sh | |
# Check if device is connected | |
if [[ $(adb get-state) ]]; then | |
# Run Android and jUnit tests | |
./gradlew clean testDebug connectedDebugAndroidTest | |
else | |
# Run jUnit tests | |
./gradlew clean testDebug | |
fi |
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
#!/bin/sh | |
./gradlew clean testDebug |
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
#!/bin/sh | |
# Your code belongs here |
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
vi pre-push |
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 DelayedTimeProvider(private val timeProvider: TimeProvider, | |
private val delayed: Delayed) : TimeProvider { | |
override fun getTime(): Long = timeProvider.getTime() + delayed.get() | |
} | |
data class Delayed(private val time: Long, private val unit: TimeUnit) { | |
fun get() = unit.toMillis(time) | |
} |
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 CreateTriggerPresenter @Inject constructor( | |
private val permissionRequest: DexterBuilder.SinglePermissionListener, | |
private val androidGetContact: AndroidGetContact, | |
val logger: Logger) | |
: BasePresenter<CreateTriggerState, CreateTriggerRoute, CreateTriggerAction, CreateTriggerView>(logger) { | |
override fun action(action: CreateTriggerAction) { | |
when (action) { | |
is RequestContactAction -> onContactRequest() | |
is ContactImportAction -> onContactImport(action) |
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
fun configureRxThreading() { | |
RxJavaPlugins.reset() | |
val immediate = object : Scheduler() { | |
override fun scheduleDirect(run: Runnable, delay: Long, unit: TimeUnit): Disposable { | |
return super.scheduleDirect(run, 0, unit) | |
} | |
override fun createWorker(): Worker { | |
return ExecutorScheduler.ExecutorWorker(Executor { it.run() }) |
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.* | |
@DslMarker | |
annotation class CalendarDsl | |
@CalendarDsl | |
class CalendarBuilder(val calendar: Calendar) { | |
fun dayOfMonth(function: () -> Int) = calendar.apply { set(Calendar.DAY_OF_MONTH, function()) } | |
fun dayOfMonth(value: Int) = calendar.apply { set(Calendar.DAY_OF_MONTH, value) } |
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 android.app.Activity; | |
import android.content.Context; | |
import android.graphics.Rect; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.view.ViewTreeObserver; | |
import android.view.inputmethod.InputMethodManager; | |
import java.util.HashMap; |