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
object Delegates { | |
/** | |
* Lazy read-only property with respect to calling context in initializer | |
* @param initializer Lazy initializer | |
*/ | |
public fun <T> contextLazy(initializer: Any?.() -> T): ReadOnlyProperty<Any?, T> = UnsafeContextLazy(initializer) | |
} | |
/** | |
* Lazy read-only property with respect to calling context in initializer |
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
@Test | |
@LooperMode(LooperMode.Mode.PAUSED) | |
fun crashesWhenUnsubscribing() { | |
updateManager.setUpdateAvailable(100500) | |
updateManager.withInfo { | |
startUpdateFlowForResult(it, AppUpdateType.FLEXIBLE, activity, 100) | |
assertTrue(isConfirmationDialogVisible) | |
userAcceptsUpdate() | |
downloadStarts() |
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
/** | |
* Basic activity that runs flexible update | |
*/ | |
class FlexibleUpdateActivity : AppCompatActivity(), AppUpdateView { | |
/** | |
* Update flow | |
*/ | |
private lateinit var updateWrapper: AppUpdateWrapper | |
override fun onCreate(savedInstanceState: Bundle?) { |
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
/** | |
* Checks if user has already refused to install update and terminates update flow | |
*/ | |
interface UpdateFlowBreaker: TimeCancelledStorage { | |
/** | |
* Checks if enough time has passed since user had explicitly cancelled update | |
*/ | |
fun isEnoughTimePassedSinceLatestCancel(): Boolean | |
/** |
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
android { | |
flavorDimensions "backend" | |
productFlavors { | |
testserver { | |
dimension "backend" | |
applicationIdSuffix ".test" // Makes your app have a different package name | |
} | |
production { | |
dimension "backend" | |
} |
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
android { | |
signingConfigs { | |
release: { | |
// Some release config for your app | |
} | |
} | |
buildTypes { | |
debug { | |
debuggable true |
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
/* | |
* Sample API | |
* API description in Markdown. | |
* | |
* OpenAPI spec version: 1.0.0 | |
* | |
* | |
* NOTE: This class is auto generated by the swagger code generator program. | |
* https://github.com/swagger-api/swagger-codegen.git | |
* Do not edit the class manually. |
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
/** | |
* Does: | |
* - fetches data from couple of endpoints | |
* - calculates result | |
* - ??? | |
*/ | |
class NoRepositoryFetchTask( | |
@Named("backend1") private val backend1: ConnectionAssets, | |
@Named("backend1") private val backend1Auth: Authentication, | |
@Named("backend2") private val backend2: ConnectionAssets, |
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
abstract class BaseModel: ViewModel() { | |
var initialized: Boolean = false | |
private set | |
/** | |
* Called from activity's onCreate or onStart | |
*/ | |
fun initialize() { | |
if (!initialized) { |
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
{ | |
"id": 2173910, | |
"name": "Broken Hill Municipality", | |
"state": "", | |
"country": "AU", | |
"coord": { | |
"lon": 141.433334, | |
"lat": -31.950001 | |
} | |
} |
OlderNewer