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
firebaseTestLab { | |
keyFile = file("developer-account.json") | |
googleProjectId = "mgm-resorts-app" | |
devices { | |
instrumentedTest { | |
deviceIds = ["Nexus5X"] | |
androidApiLevels = [23] | |
isUseOrchestrator = true | |
numShards = 4 | |
environmentVariables = ["clearPackageData=true"] |
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
fun <T> Single<T>.toEither(): Single<Either<DefaultError, T>> = this | |
.map<Either<DefaultError, T>> { Either.right(it) } | |
.onErrorReturn { Either.left(it.toDefaultError()) } |
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
inline fun <reified T : Activity> Context.open() = startActivity(Intent(this, T::class.java)) | |
inline fun <reified T : Activity> Context.openForResult(code: Int) = startActivityForResult(Intent(this, T::class.java), code) | |
inline fun <reified T : Fragment> newInstance(): T = T::class.java.newInstance() | |
Usage: | |
open<LoginActivity>() | |
openForResult<LoginActivity>(INTENT_CODE) |
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
presenter.onStart(object : BookPresenter.View { | |
override var pages: String by book_fragment_pages.textViewDelegate() | |
}) |
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
fun TextView.textViewDelegate() : ReadWriteProperty<Any, String> = object : ReadWriteProperty<Any, String> { | |
override fun getValue(thisRef: Any, property: KProperty<*>): String = text.toString() | |
override fun setValue(thisRef: Any, property: KProperty<*>, value: String) { | |
text = value | |
} | |
} |
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
startActivityForResult(fileHelper.photoPickIntent(isFrontCameraAvailable(context)), | |
when (type) { | |
UploadType.Document -> AttachmentsCode.GALLERY_OR_CAMERA_RESULTS_DOCUMENT | |
UploadType.Proof -> AttachmentsCode.GALLERY_OR_CAMERA_RESULTS_PROOF | |
UploadType.Selfie -> AttachmentsCode.CAMERA_RESULTS_SELFIE | |
}) |
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
sealed class UnlockState { | |
object Activating : UnlockState() | |
object Activated : UnlockState() | |
object Opened : UnlockState() | |
} |
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
sealed class UploadType { | |
object Document : UploadType() | |
object Selfie : UploadType() | |
object Proof : UploadType() | |
} |
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
sealed class BiometricsErrors : DefaultError { | |
data class UnknownError(val errorCode: Int, val reason: String) : BiometricsErrors() | |
object NotSupportedError : BiometricsErrors() | |
object NoFingerprintsEnrolledError : BiometricsErrors() | |
object AuthFailedError : BiometricsErrors() | |
} |
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
val codes = arrayOf(1, 2, 3, 4, 5) | |
val generalCodes = asList(-5, -4, -3, -2, -1, 0, *codes) |
NewerOlder