Skip to content

Commit

Permalink
Refactor: Removed window insets handling in QuickLyricsSearchActivity
Browse files Browse the repository at this point in the history
Removed custom window insets handling code and system window insets disabling. This simplifies the activity's layout and removes unnecessary code for managing window insets.
  • Loading branch information
BobbyESP committed Nov 14, 2024
1 parent 7d9439a commit 85f59d5
Showing 1 changed file with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,6 @@ class QuickLyricsSearchActivity : ComponentActivity() {
super.onCreate(savedInstanceState)

enableEdgeToEdge()

// Disable the default system window insets handling
WindowCompat.setDecorFitsSystemWindows(window, false)

// Set a listener to handle window insets manually
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v, insets ->
// Remove any padding from the view
v.setPadding(0, 0, 0, 0)
insets
}

// Configure the window properties
window.run {
// Set the background to be transparent
setBackgroundDrawable(ColorDrawable(0))
// Set the window layout to match the parent dimensions
setLayout(
WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT
)
// Set the window type based on the Android version
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// For Android O and above, use TYPE_APPLICATION_OVERLAY
setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY)
} else {
// For older versions, use TYPE_SYSTEM_ALERT
setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT)
}
}

handleShareIntent(intent)

setContent {
Expand Down

0 comments on commit 85f59d5

Please sign in to comment.