@@ -40,8 +40,8 @@ import androidx.compose.material3.BasicAlertDialog
4040import androidx.compose.material3.Button
4141import androidx.compose.material3.CardDefaults
4242import androidx.compose.material3.DropdownMenu
43- import me.bmax.apatch.ui.theme.BackgroundConfig
4443import androidx.compose.material3.DropdownMenuItem
44+ import me.bmax.apatch.ui.theme.BackgroundConfig
4545import androidx.compose.material3.ElevatedCard
4646import androidx.compose.material3.ExperimentalMaterial3Api
4747import androidx.compose.material3.Icon
@@ -88,6 +88,8 @@ import me.bmax.apatch.Natives
8888import me.bmax.apatch.R
8989import me.bmax.apatch.apApp
9090import me.bmax.apatch.ui.component.ProvideMenuShape
91+ import me.bmax.apatch.ui.component.WallpaperAwareDropdownMenu
92+ import me.bmax.apatch.ui.component.WallpaperAwareDropdownMenuItem
9193import me.bmax.apatch.ui.component.rememberConfirmDialog
9294import me.bmax.apatch.ui.viewmodel.PatchesViewModel
9395import me.bmax.apatch.util.Version
@@ -410,18 +412,31 @@ private fun TopBar(
410412 contentDescription = stringResource(id = R .string.reboot)
411413 )
412414
413- ProvideMenuShape (RoundedCornerShape (10 .dp)) {
414- DropdownMenu (
415- expanded = showDropdownReboot,
416- onDismissRequest = { showDropdownReboot = false },
417- containerColor = MaterialTheme .colorScheme.surfaceContainer
418- ) {
419- RebootDropdownItem (id = R .string.reboot)
420- RebootDropdownItem (id = R .string.reboot_recovery, reason = " recovery" )
421- RebootDropdownItem (id = R .string.reboot_bootloader, reason = " bootloader" )
422- RebootDropdownItem (id = R .string.reboot_download, reason = " download" )
423- RebootDropdownItem (id = R .string.reboot_edl, reason = " edl" )
424- }
415+ WallpaperAwareDropdownMenu (
416+ expanded = showDropdownReboot,
417+ onDismissRequest = { showDropdownReboot = false },
418+ shape = RoundedCornerShape (10 .dp)
419+ ) {
420+ WallpaperAwareDropdownMenuItem (
421+ text = { Text (stringResource(id = R .string.reboot)) },
422+ onClick = { reboot() }
423+ )
424+ WallpaperAwareDropdownMenuItem (
425+ text = { Text (stringResource(id = R .string.reboot_recovery)) },
426+ onClick = { reboot(" recovery" ) }
427+ )
428+ WallpaperAwareDropdownMenuItem (
429+ text = { Text (stringResource(id = R .string.reboot_bootloader)) },
430+ onClick = { reboot(" bootloader" ) }
431+ )
432+ WallpaperAwareDropdownMenuItem (
433+ text = { Text (stringResource(id = R .string.reboot_download)) },
434+ onClick = { reboot(" download" ) }
435+ )
436+ WallpaperAwareDropdownMenuItem (
437+ text = { Text (stringResource(id = R .string.reboot_edl)) },
438+ onClick = { reboot(" edl" ) }
439+ )
425440 }
426441 }
427442 }
@@ -432,25 +447,25 @@ private fun TopBar(
432447 imageVector = Icons .Filled .MoreVert ,
433448 contentDescription = stringResource(id = R .string.settings)
434449 )
435- ProvideMenuShape (RoundedCornerShape (10 .dp)) {
436- DropdownMenu (
437- expanded = showDropdownMoreOptions,
438- onDismissRequest = { showDropdownMoreOptions = false },
439- containerColor = MaterialTheme .colorScheme.surfaceContainer
440- ) {
441- DropdownMenuItem (text = {
442- Text (stringResource(R .string.home_more_menu_feedback_or_suggestion))
443- }, onClick = {
450+ WallpaperAwareDropdownMenu (
451+ expanded = showDropdownMoreOptions,
452+ onDismissRequest = { showDropdownMoreOptions = false },
453+ shape = RoundedCornerShape (10 .dp)
454+ ) {
455+ WallpaperAwareDropdownMenuItem (
456+ text = { Text (stringResource(R .string.home_more_menu_feedback_or_suggestion)) },
457+ onClick = {
444458 showDropdownMoreOptions = false
445459 uriHandler.openUri(" https://github.com/matsuzaka-yuki/FolkPatch/issues/new/choose" )
446- })
447- DropdownMenuItem (text = {
448- Text (stringResource(R .string.home_more_menu_about))
449- }, onClick = {
460+ }
461+ )
462+ WallpaperAwareDropdownMenuItem (
463+ text = { Text (stringResource(R .string.home_more_menu_about)) },
464+ onClick = {
450465 navigator.navigate(AboutScreenDestination )
451466 showDropdownMoreOptions = false
452- })
453- }
467+ }
468+ )
454469 }
455470 }
456471 }
0 commit comments