Skip to content

Commit

Permalink
PlayerBottomSheet: Fix bottom distance for ColorOS Freeform
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsummer233 committed Feb 16, 2025
1 parent 1b1d0ed commit 1482bfc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
android:theme="@style/Theme.Gramophone"
android:windowSoftInputMode="adjustResize"
tools:targetApi="upside_down_cake">

<activity
android:name=".ui.BugHandlerActivity"
android:exported="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,12 @@ class PlayerBottomSheet private constructor(
private fun getDistanceToBottom(view: View): Int {
val windowMetrics =
(context.getSystemService(Context.WINDOW_SERVICE) as WindowManager).currentWindowMetrics
val screenHeight = windowMetrics.bounds.height()
val windowHeight = windowMetrics.bounds.height()

val location = IntArray(2)
view.getLocationOnScreen(location)
view.getLocationInWindow(location)

return screenHeight - (location[1] + view.height)
return windowHeight - (location[1] + view.height)
}

override fun onAttachedToWindow() {
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
val agpVersion = "8.8.0"
val agpVersion = "8.8.1"
id("com.android.application") version agpVersion apply false
id("com.android.library") version agpVersion apply false
val kotlinVersion = "2.1.20-Beta2"
kotlin("android") version kotlinVersion apply false
kotlin("plugin.parcelize") version kotlinVersion apply false
id("com.google.devtools.ksp") version "$kotlinVersion-1.0.29" apply false
id("com.google.devtools.ksp") version "$kotlinVersion-1.0.30" apply false
}

tasks.withType(JavaCompile::class) {
Expand Down

0 comments on commit 1482bfc

Please sign in to comment.