mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-02-08 14:13:16 -05:00
Move 'All Apps' to main overflow menu for now
This commit is contained in:
@@ -17,7 +17,6 @@ import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBar
|
||||
@@ -31,7 +30,6 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Alignment.Companion.End
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
import androidx.compose.ui.res.stringResource
|
||||
@@ -169,17 +167,6 @@ fun Discover(
|
||||
onAppTap = onAppTap,
|
||||
)
|
||||
}
|
||||
val listAll = AppListType.All(
|
||||
title = stringResource(R.string.app_list_all),
|
||||
)
|
||||
OutlinedButton(
|
||||
onClick = { onListTap(listAll) },
|
||||
modifier = Modifier
|
||||
.align(End)
|
||||
.padding(horizontal = 16.dp),
|
||||
) {
|
||||
Text(listAll.title)
|
||||
}
|
||||
}
|
||||
NoEnabledReposDiscoverModel -> {
|
||||
Text(
|
||||
|
||||
@@ -6,11 +6,12 @@ import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.semantics.hideFromAccessibility
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import org.fdroid.ui.navigation.NavDestinations
|
||||
import org.fdroid.ui.navigation.moreMenuItems
|
||||
import org.fdroid.ui.navigation.getMoreMenuItems
|
||||
|
||||
@Composable
|
||||
fun DiscoverOverFlowMenu(
|
||||
@@ -22,7 +23,7 @@ fun DiscoverOverFlowMenu(
|
||||
expanded = menuExpanded,
|
||||
onDismissRequest = onDismissRequest
|
||||
) {
|
||||
moreMenuItems.forEach { dest ->
|
||||
getMoreMenuItems(LocalContext.current).forEach { dest ->
|
||||
DropdownMenuItem(
|
||||
text = { Text(stringResource(dest.label)) },
|
||||
onClick = { onItemClicked(dest) },
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.fdroid.ui.navigation
|
||||
|
||||
import android.content.Context
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Apps
|
||||
@@ -72,6 +73,12 @@ sealed class NavDestinations(
|
||||
object Settings :
|
||||
NavDestinations(NavigationKey.Settings, R.string.menu_settings, Icons.Filled.Settings)
|
||||
|
||||
class AllApps(title: String) : NavDestinations(
|
||||
id = NavigationKey.AppList(AppListType.All(title)),
|
||||
label = R.string.app_list_all,
|
||||
icon = Icons.Filled.Apps,
|
||||
)
|
||||
|
||||
object About : NavDestinations(NavigationKey.About, R.string.menu_about, Icons.Filled.Info)
|
||||
}
|
||||
|
||||
@@ -80,6 +87,7 @@ val topBarMenuItems = listOf(
|
||||
NavDestinations.Settings,
|
||||
)
|
||||
|
||||
val moreMenuItems = listOf(
|
||||
fun getMoreMenuItems(context: Context) = listOf(
|
||||
NavDestinations.AllApps(context.getString(R.string.app_list_all)),
|
||||
NavDestinations.About,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user