Skip to content

Commit

Permalink
fix: sometimes crash when scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
ZTFtrue committed Feb 4, 2024
1 parent ed661d0 commit cfe9ac6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/main/java/com/ztftrue/music/ui/play/LyricsView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
import androidx.compose.ui.input.nestedscroll.NestedScrollSource
import androidx.compose.ui.input.nestedscroll.nestedScroll
Expand Down Expand Up @@ -67,8 +66,6 @@ import androidx.compose.ui.window.PopupProperties
import androidx.media3.common.util.UnstableApi
import com.ztftrue.music.MainActivity
import com.ztftrue.music.MusicViewModel
import com.ztftrue.music.utils.CustomColorUtils.getContrastingColor
import com.ztftrue.music.utils.CustomColorUtils.toAndroidColor
import com.ztftrue.music.utils.ListStringCaption
import com.ztftrue.music.utils.LyricsType
import com.ztftrue.music.utils.Utils
Expand Down Expand Up @@ -313,8 +310,12 @@ fun LyricsView(
source: NestedScrollSource
): Offset {
// if (textToolbar.status == TextToolbarStatus.Shown) {
try {
focusManager.clearFocus()
textToolbar.hide()
} catch (_: Exception) {

}
// }
return super.onPreScroll(available, source)
}
Expand Down

0 comments on commit cfe9ac6

Please sign in to comment.