mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-07-30 09:06:35 -04:00
Merge branch 'check-for-updates-menu' into 'master'
add "Check for updates" menu item to MyApps, #3171 See merge request fdroid/fdroidclient!1693
This commit is contained in:
@@ -138,6 +138,7 @@ fun MyApps(
|
||||
}
|
||||
TopAppBarOverflowButton { onDismissRequest ->
|
||||
MyAppsOverFlowMenu(
|
||||
onCheckForUpdates = myAppsInfo.actions::checkForUpdates,
|
||||
onInstallHistory = { onNav(NavigationKey.InstallationHistory) },
|
||||
onExportInstalledApps = myAppsInfo.actions::exportInstalledApps,
|
||||
onDismissRequest = onDismissRequest,
|
||||
|
||||
@@ -44,5 +44,7 @@ interface MyAppsActions {
|
||||
|
||||
fun onNotWarnWhenMetered()
|
||||
|
||||
fun checkForUpdates()
|
||||
|
||||
fun exportInstalledApps()
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.fdroid.ui.apps
|
||||
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.History
|
||||
import androidx.compose.material.icons.filled.Refresh
|
||||
import androidx.compose.material.icons.filled.UploadFile
|
||||
import androidx.compose.material3.DropdownMenuItem
|
||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||
@@ -17,10 +18,25 @@ import org.fdroid.R
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
@Composable
|
||||
fun MyAppsOverFlowMenu(
|
||||
onCheckForUpdates: () -> Unit,
|
||||
onInstallHistory: () -> Unit,
|
||||
onExportInstalledApps: () -> Unit,
|
||||
onDismissRequest: () -> Unit,
|
||||
) {
|
||||
DropdownMenuItem(
|
||||
text = { Text(stringResource(R.string.pref_repo_updates_title)) },
|
||||
onClick = {
|
||||
onCheckForUpdates()
|
||||
onDismissRequest()
|
||||
},
|
||||
leadingIcon = {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Refresh,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.semantics { hideFromAccessibility() },
|
||||
)
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text(stringResource(R.string.install_history)) },
|
||||
onClick = {
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.fdroid.install.AppInstallManager
|
||||
import org.fdroid.install.InstallConfirmationState
|
||||
import org.fdroid.install.InstallState
|
||||
import org.fdroid.install.InstalledAppsCache
|
||||
import org.fdroid.repo.RepoUpdateWorker
|
||||
import org.fdroid.settings.OnboardingManager
|
||||
import org.fdroid.settings.SettingsManager
|
||||
import org.fdroid.ui.utils.startActivitySafe
|
||||
@@ -154,6 +155,10 @@ constructor(
|
||||
settingsManager.onDontWarnOnMeteredNetwork()
|
||||
}
|
||||
|
||||
override fun checkForUpdates() {
|
||||
RepoUpdateWorker.updateNow(application)
|
||||
}
|
||||
|
||||
override fun exportInstalledApps() {
|
||||
scope.launch {
|
||||
val stringBuilder =
|
||||
|
||||
@@ -425,6 +425,8 @@ fun getMyAppsInfo(model: MyAppsModel): MyAppsInfo =
|
||||
|
||||
override fun onNotWarnWhenMetered() {}
|
||||
|
||||
override fun checkForUpdates() {}
|
||||
|
||||
override fun exportInstalledApps() {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user