disable interaction

This commit is contained in:
2026-08-17 14:29:59 +03:00
parent b23307e6dd
commit ea67ed80a5
3 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ plugins {
alias(libs.plugins.convention.ktor.client)
}
val appVersion = "1.26.5"
val appVersion = "1.26.6"
android {
buildFeatures { buildConfig = true }
@@ -3,6 +3,7 @@ package ru.shadowsparky.videoplayer.ui
import android.app.Activity
import android.content.Context
import android.content.pm.ActivityInfo
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.annotation.OptIn
@@ -58,20 +59,20 @@ actual fun VideoCanvas(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
useController = false
focusable = View.NOT_FOCUSABLE
defaultFocusHighlightEnabled = false
resizeMode = when (scaleType) {
VideoScaleType.FIT -> AspectRatioFrameLayout.RESIZE_MODE_FIT
VideoScaleType.FULL -> AspectRatioFrameLayout.RESIZE_MODE_ZOOM
VideoScaleType.STRETCH -> AspectRatioFrameLayout.RESIZE_MODE_FILL
}
keepScreenOn = true
context.updatePipAutoEnter(this, true)
}
},
update = { playerView ->
playerView.defaultFocusHighlightEnabled = false
if (playerView.player != androidController.getPlayerInstance()) {
playerView.player = androidController.getPlayerInstance()
}
@@ -107,9 +107,11 @@ fun VideoPlayer(
false
}
} else {
modifier.clickable {
areControlsVisible = !areControlsVisible
}
modifier.clickable(
interactionSource = null,
indication = null,
onClick = { areControlsVisible = !areControlsVisible }
)
}
Box(modifier = rootModifier.background(Color.Black)) {