feat: three-dot context menu on song rows + search shows songs as rows
- Add ⋮ button to every song-item triggering the context menu (same as right-click) - Show song-actions always visible on touch devices via @media (hover:none) - Search results: songs now render as makeSongItem rows instead of cards (artists/albums remain as horizontal card rows) - Fix Android app opening system settings on every launch after notification permission denial — now only redirects to settings once using notif_settings_shown flag Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
7bec106350
commit
27eb209945
4 files changed
+22
-14
No files matched your search
@@ -206,10 +206,13 @@ class MainActivity : AppCompatActivity(), MusicService.StateListener {
|
||||
ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS)
|
||||
== PackageManager.PERMISSION_GRANTED -> return
|
||||
|
||||
// System won't show the dialog again after one denial — send user to settings.
|
||||
// System won't show the dialog again after one denial — send user to settings once.
|
||||
!ActivityCompat.shouldShowRequestPermissionRationale(
|
||||
this, Manifest.permission.POST_NOTIFICATIONS
|
||||
) && _notifPermissionAskedBefore() -> openNotificationSettings()
|
||||
) && _notifPermissionAskedBefore() && !_notifSettingsShownBefore() -> {
|
||||
markNotifSettingsShown()
|
||||
openNotificationSettings()
|
||||
}
|
||||
|
||||
else -> {
|
||||
markNotifPermissionAsked()
|
||||
@@ -225,9 +228,10 @@ class MainActivity : AppCompatActivity(), MusicService.StateListener {
|
||||
) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||
if (requestCode == 42 &&
|
||||
grantResults.firstOrNull() == PackageManager.PERMISSION_DENIED
|
||||
grantResults.firstOrNull() == PackageManager.PERMISSION_DENIED &&
|
||||
!_notifSettingsShownBefore()
|
||||
) {
|
||||
// Denied — open settings so the user can flip the toggle themselves.
|
||||
markNotifSettingsShown()
|
||||
openNotificationSettings()
|
||||
}
|
||||
}
|
||||
@@ -247,4 +251,11 @@ class MainActivity : AppCompatActivity(), MusicService.StateListener {
|
||||
private fun markNotifPermissionAsked() =
|
||||
getSharedPreferences("ns_prefs", MODE_PRIVATE).edit()
|
||||
.putBoolean("notif_asked", true).apply()
|
||||
|
||||
private fun _notifSettingsShownBefore() =
|
||||
getSharedPreferences("ns_prefs", MODE_PRIVATE).getBoolean("notif_settings_shown", false)
|
||||
|
||||
private fun markNotifSettingsShown() =
|
||||
getSharedPreferences("ns_prefs", MODE_PRIVATE).edit()
|
||||
.putBoolean("notif_settings_shown", true).apply()
|
||||
}
|
||||
Reference in new issue
Block a user