Skip to content

Instantly share code, notes, and snippets.

View dptsolutions's full-sized avatar

Don Phillips dptsolutions

  • Los Angeles, CA
View GitHub Profile
@bagus2x
bagus2x / ExoPlayerState.kt
Created March 19, 2023 06:46
Observe exoplayer state / Player.Listener in jetpack compose
class ExoPlayerState(
context: Context,
private val scope: CoroutineScope
) : ExoPlayer by ExoPlayer.Builder(context).build(), Player.Listener {
@get:JvmName("playing")
var isPlaying by mutableStateOf(false)
private set
var duration by mutableStateOf(0.seconds)
private set
var currentPosition by mutableStateOf(0.seconds)
@ychescale9
ychescale9 / build.gradle.kts
Last active June 5, 2024 22:56
Customizing APK file name with new AGP variant APIs
android {
onVariantProperties {
val mainOutput = outputs.single { it.outputType == VariantOutputConfiguration.OutputType.SINGLE }
tasks.register<CreateRenamedApk>("createRenamedApkFor${name}") {
this.originalApkFolder.set(artifacts.get(ArtifactType.APK))
this.builtArtifactsLoader.set(artifacts.getBuiltArtifactsLoader())
this.newApkFolder.set(layout.buildDirectory.dir("outputs/renamed_apk/${[email protected]}"))
this.versionCode.set(mainOutput.versionCode)
this.versionName.set(mainOutput.versionName)
}