Compare commits
23
Commits
27d1a4b6ea
..
v1.4.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f0f556e82 | ||
|
|
2a4b5f54a8 | ||
|
|
31a1f5158f | ||
|
|
3aedc51b97 | ||
|
|
8e88e9601a | ||
|
|
8f65bb05b7 | ||
|
|
6be81093e0 | ||
|
|
1b90010bbc | ||
|
|
ade61c0850 | ||
|
|
e97498a148 | ||
|
|
584ec246d1 | ||
|
|
200b834d1c | ||
|
|
0fcc9ba514 | ||
|
|
8d38c319a2 | ||
|
|
90ce637846 | ||
|
|
f77080f6f2 | ||
|
|
f161db3345 | ||
|
|
32ae274da3 | ||
|
|
431f61e683 | ||
|
|
2cadfa8972 | ||
|
|
77bcaddc55 | ||
|
|
a2d049e280 | ||
|
|
a393624d03 |
No files matched your search
+19
-1
@@ -1,9 +1,27 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.4.1] - 2026-10-30
|
||||||
|
### New
|
||||||
|
* about screen
|
||||||
|
|
||||||
|
## [1.4.0] - 2026-10-30
|
||||||
|
### New
|
||||||
|
* settings
|
||||||
|
|
||||||
|
## [1.3.0] - 2026-10-30
|
||||||
|
### New
|
||||||
|
* auto update
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
* show app icon on splash screen
|
||||||
|
|
||||||
|
## [1.2.12] - 2026-10-29
|
||||||
|
### New
|
||||||
|
* dark mode support on the splash screen
|
||||||
|
|
||||||
## [1.2.11] - 2026-10-29
|
## [1.2.11] - 2026-10-29
|
||||||
### New
|
### New
|
||||||
* ability to edit words (with swiping to the left)
|
* ability to edit words (with swiping to the left)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
* delete words with swiping to the right (instead of pressing the button)
|
* delete words with swiping to the right (instead of pressing the button)
|
||||||
|
|
||||||
|
|||||||
@@ -58,11 +58,11 @@ No streaks, no pressure, no clutter. Just a gentle daily reminder of what you wa
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- 🧩 Home screen widget showing your current quality of the week
|
- Home screen widget showing your current quality of the week
|
||||||
- 🔄 Automatic weekly rotation to a new quality
|
- Automatic weekly rotation to a new quality
|
||||||
- 🌙 Light and dark theme support
|
- Light and dark theme support, Material You
|
||||||
- 🔒 No ads, no tracking, no unnecessary permissions
|
- No ads, no tracking, no unnecessary permissions
|
||||||
- ⚡ Lightweight and battery-friendly
|
- Lightweight and battery-friendly
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ You can follow the build under **Actions** in the repository. When it finishes,
|
|||||||
The workflow takes the notes from the section of `CHANGELOG.md` whose heading starts with the version number:
|
The workflow takes the notes from the section of `CHANGELOG.md` whose heading starts with the version number:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
## 1.1.3
|
## [1.1.3] - 2026-10-03
|
||||||
|
|
||||||
- Added Weblate translations
|
- Added Weblate translations
|
||||||
- Fixed widget update at the start of a new week
|
- Fixed widget update at the start of a new week
|
||||||
@@ -152,7 +152,8 @@ You are free to use, modify and redistribute this software under the terms of th
|
|||||||
|
|
||||||
## Translations
|
## Translations
|
||||||
|
|
||||||
WeekFocus is translated via [Weblate](https://weblate.schamagusa.de/engage/weekfocus/).
|
~~WeekFocus is translated via [Weblate](https://weblate.schamagusa.de/engage/weekfocus/).
|
||||||
Help translate the app into your language!
|
Help translate the app into your language!~~
|
||||||
|
<!--[](https://weblate.schamagusa.de/engage/weekfocus/)-->
|
||||||
|
|
||||||
[](https://weblate.schamagusa.de/engage/weekfocus/)
|
If you want to contribute with translation you would have to fork this repository, translate into the files directly and make an pull request back to this repository.
|
||||||
@@ -93,4 +93,7 @@ dependencies {
|
|||||||
debugImplementation(libs.androidx.compose.ui.test.manifest)
|
debugImplementation(libs.androidx.compose.ui.test.manifest)
|
||||||
debugImplementation(libs.androidx.compose.ui.tooling)
|
debugImplementation(libs.androidx.compose.ui.tooling)
|
||||||
implementation(libs.androidx.material.icons.extended)
|
implementation(libs.androidx.material.icons.extended)
|
||||||
|
implementation("androidx.core:core-splashscreen:1.0.1")
|
||||||
|
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.7")
|
||||||
|
implementation("androidx.navigation:navigation-compose:2.8.5")
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,10 @@
|
|||||||
<!-- Nötig, damit der Wochenwechsel-Alarm nach einem Neustart neu geplant wird -->
|
<!-- Nötig, damit der Wochenwechsel-Alarm nach einem Neustart neu geplant wird -->
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
|
|
||||||
|
<!-- used for auto-update -->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
@@ -17,7 +21,7 @@
|
|||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/Theme.WeekFocus"
|
android:theme="@style/Theme.WeekFocus.Splash"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:windowSoftInputMode="adjustResize">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
@@ -39,6 +43,15 @@
|
|||||||
android:name="android.appwidget.provider"
|
android:name="android.appwidget.provider"
|
||||||
android:resource="@xml/widget_info" />
|
android:resource="@xml/widget_info" />
|
||||||
</receiver>
|
</receiver>
|
||||||
|
<provider
|
||||||
|
android:name="androidx.core.content.FileProvider"
|
||||||
|
android:authorities="${applicationId}.fileprovider"
|
||||||
|
android:exported="false"
|
||||||
|
android:grantUriPermissions="true">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
|
android:resource="@xml/file_paths" />
|
||||||
|
</provider>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -5,8 +5,10 @@ import android.os.Bundle
|
|||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.Home
|
import androidx.compose.material.icons.filled.Home
|
||||||
import androidx.compose.material.icons.filled.List
|
import androidx.compose.material.icons.filled.List
|
||||||
import androidx.compose.material.icons.filled.Settings
|
import androidx.compose.material.icons.filled.Settings
|
||||||
@@ -19,25 +21,49 @@ import androidx.compose.ui.Alignment
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import de.schanbro.weekfocus.ui.theme.WeekFocusTheme
|
import androidx.navigation.NavGraph.Companion.findStartDestination
|
||||||
|
import androidx.navigation.compose.*
|
||||||
|
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||||
|
import de.schanbro.weekfocus.screens.AboutScreen
|
||||||
|
import de.schanbro.weekfocus.screens.SettingsScreen
|
||||||
import de.schanbro.weekfocus.screens.WordListScreen
|
import de.schanbro.weekfocus.screens.WordListScreen
|
||||||
|
import de.schanbro.weekfocus.settings.SettingsRepository
|
||||||
|
import de.schanbro.weekfocus.settings.ThemeMode
|
||||||
|
import de.schanbro.weekfocus.ui.theme.WeekFocusTheme
|
||||||
|
import de.schanbro.weekfocus.update.NetworkPermissionGate
|
||||||
|
import de.schanbro.weekfocus.update.UpdateHandler
|
||||||
|
|
||||||
|
private object Routes {
|
||||||
|
const val HOME = "home"
|
||||||
|
const val WORDS = "words"
|
||||||
|
const val SETTINGS = "settings"
|
||||||
|
const val ABOUT = "about"
|
||||||
|
}
|
||||||
|
|
||||||
class MainActivity : ComponentActivity() {
|
class MainActivity : ComponentActivity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
installSplashScreen()
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
setContent {
|
setContent {
|
||||||
WeekFocusTheme {
|
val settings = remember { SettingsRepository.get(applicationContext) }
|
||||||
|
val darkTheme = when (settings.themeMode) {
|
||||||
|
ThemeMode.SYSTEM -> isSystemInDarkTheme()
|
||||||
|
ThemeMode.LIGHT -> false
|
||||||
|
ThemeMode.DARK -> true
|
||||||
|
}
|
||||||
|
|
||||||
|
WeekFocusTheme(darkTheme = darkTheme) {
|
||||||
MainScreen()
|
MainScreen()
|
||||||
|
NetworkPermissionGate {
|
||||||
|
UpdateHandler()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
// Falls das Widget (z.B. durch Energiesparmodus) nicht rechtzeitig aktualisiert
|
|
||||||
// wurde, wird es beim Öffnen der App nachgezogen.
|
|
||||||
updateWidget(this)
|
updateWidget(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,7 +71,9 @@ class MainActivity : ComponentActivity() {
|
|||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun MainScreen() {
|
fun MainScreen() {
|
||||||
var selectedTab by remember { mutableIntStateOf(0) }
|
val navController = rememberNavController()
|
||||||
|
val backStackEntry by navController.currentBackStackEntryAsState()
|
||||||
|
val currentRoute = backStackEntry?.destination?.route
|
||||||
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()
|
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
@@ -56,14 +84,25 @@ fun MainScreen() {
|
|||||||
LargeTopAppBar(
|
LargeTopAppBar(
|
||||||
title = {
|
title = {
|
||||||
Text(
|
Text(
|
||||||
when (selectedTab) {
|
when (currentRoute) {
|
||||||
0 -> stringResource(R.string.title_home)
|
Routes.HOME -> stringResource(R.string.title_weekly_focus)
|
||||||
1 -> stringResource(R.string.title_words)
|
Routes.WORDS -> stringResource(R.string.title_words)
|
||||||
2 -> stringResource(R.string.title_settings)
|
Routes.SETTINGS -> stringResource(R.string.title_settings)
|
||||||
|
Routes.ABOUT -> stringResource(R.string.title_about)
|
||||||
else -> stringResource(R.string.app_name)
|
else -> stringResource(R.string.app_name)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
navigationIcon = {
|
||||||
|
if (currentRoute == Routes.ABOUT) {
|
||||||
|
IconButton(onClick = { navController.popBackStack() }) {
|
||||||
|
Icon(
|
||||||
|
Icons.AutoMirrored.Filled.ArrowBack,
|
||||||
|
contentDescription = stringResource(R.string.action_back)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
scrollBehavior = scrollBehavior,
|
scrollBehavior = scrollBehavior,
|
||||||
colors = TopAppBarDefaults.largeTopAppBarColors(
|
colors = TopAppBarDefaults.largeTopAppBarColors(
|
||||||
containerColor = MaterialTheme.colorScheme.surface,
|
containerColor = MaterialTheme.colorScheme.surface,
|
||||||
@@ -72,40 +111,66 @@ fun MainScreen() {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
bottomBar = {
|
bottomBar = {
|
||||||
NavigationBar {
|
if (currentRoute != Routes.ABOUT) {
|
||||||
NavigationBarItem(
|
NavigationBar {
|
||||||
selected = selectedTab == 0,
|
NavigationBarItem(
|
||||||
onClick = { selectedTab = 0 },
|
selected = currentRoute == Routes.HOME,
|
||||||
icon = {
|
onClick = {
|
||||||
Icon(
|
navController.navigate(Routes.HOME) {
|
||||||
imageVector = if (selectedTab == 0) Icons.Filled.Home else Icons.Outlined.Home,
|
popUpTo(navController.graph.findStartDestination().id) {
|
||||||
contentDescription = stringResource(R.string.title_home)
|
saveState = true
|
||||||
)
|
}
|
||||||
},
|
launchSingleTop = true
|
||||||
label = { Text(stringResource(R.string.title_home)) }
|
restoreState = true
|
||||||
)
|
}
|
||||||
NavigationBarItem(
|
},
|
||||||
selected = selectedTab == 1,
|
icon = {
|
||||||
onClick = { selectedTab = 1 },
|
Icon(
|
||||||
icon = {
|
imageVector = if (currentRoute == Routes.HOME) Icons.Filled.Home else Icons.Outlined.Home,
|
||||||
Icon(
|
contentDescription = stringResource(R.string.title_home)
|
||||||
imageVector = if (selectedTab == 1) Icons.Filled.List else Icons.Outlined.List,
|
)
|
||||||
contentDescription = stringResource(R.string.title_words)
|
},
|
||||||
)
|
label = { Text(stringResource(R.string.title_home)) }
|
||||||
},
|
)
|
||||||
label = { Text(stringResource(R.string.title_words)) }
|
NavigationBarItem(
|
||||||
)
|
selected = currentRoute == Routes.WORDS,
|
||||||
NavigationBarItem(
|
onClick = {
|
||||||
selected = selectedTab == 2,
|
navController.navigate(Routes.WORDS) {
|
||||||
onClick = { selectedTab = 2 },
|
popUpTo(navController.graph.findStartDestination().id) {
|
||||||
icon = {
|
saveState = true
|
||||||
Icon(
|
}
|
||||||
imageVector = if (selectedTab == 2) Icons.Filled.Settings else Icons.Outlined.Settings,
|
launchSingleTop = true
|
||||||
contentDescription = stringResource(R.string.title_settings)
|
restoreState = true
|
||||||
)
|
}
|
||||||
},
|
},
|
||||||
label = { Text(stringResource(R.string.title_settings)) }
|
icon = {
|
||||||
)
|
Icon(
|
||||||
|
imageVector = if (currentRoute == Routes.WORDS) Icons.Filled.List else Icons.Outlined.List,
|
||||||
|
contentDescription = stringResource(R.string.title_words)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
label = { Text(stringResource(R.string.title_words)) }
|
||||||
|
)
|
||||||
|
NavigationBarItem(
|
||||||
|
selected = currentRoute == Routes.SETTINGS,
|
||||||
|
onClick = {
|
||||||
|
navController.navigate(Routes.SETTINGS) {
|
||||||
|
popUpTo(navController.graph.findStartDestination().id) {
|
||||||
|
saveState = true
|
||||||
|
}
|
||||||
|
launchSingleTop = true
|
||||||
|
restoreState = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icon = {
|
||||||
|
Icon(
|
||||||
|
imageVector = if (currentRoute == Routes.SETTINGS) Icons.Filled.Settings else Icons.Outlined.Settings,
|
||||||
|
contentDescription = stringResource(R.string.title_settings)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
label = { Text(stringResource(R.string.title_settings)) }
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
) { innerPadding ->
|
) { innerPadding ->
|
||||||
@@ -115,10 +180,17 @@ fun MainScreen() {
|
|||||||
.padding(innerPadding),
|
.padding(innerPadding),
|
||||||
color = MaterialTheme.colorScheme.background
|
color = MaterialTheme.colorScheme.background
|
||||||
) {
|
) {
|
||||||
when (selectedTab) {
|
NavHost(
|
||||||
0 -> PlaceholderScreen(title = stringResource(R.string.title_weekly_focus))
|
navController = navController,
|
||||||
1 -> WordListScreen()
|
startDestination = Routes.HOME,
|
||||||
2 -> PlaceholderScreen(title = stringResource(R.string.title_settings))
|
modifier = Modifier.fillMaxSize()
|
||||||
|
) {
|
||||||
|
composable(Routes.HOME) { PlaceholderScreen(title = stringResource(R.string.title_weekly_focus)) }
|
||||||
|
composable(Routes.WORDS) { WordListScreen() }
|
||||||
|
composable(Routes.SETTINGS) {
|
||||||
|
SettingsScreen(onOpenAbout = { navController.navigate(Routes.ABOUT) })
|
||||||
|
}
|
||||||
|
composable(Routes.ABOUT) { AboutScreen() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,9 +210,6 @@ fun PlaceholderScreen(title: String) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Bleibt als Top-Level-Funktion erhalten, damit WordListScreen unverändert weiter funktioniert.
|
|
||||||
*/
|
|
||||||
fun updateWidget(context: Context) {
|
fun updateWidget(context: Context) {
|
||||||
SimpleWidget.updateAllWidgets(context)
|
SimpleWidget.updateAllWidgets(context)
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package de.schanbro.weekfocus.components
|
||||||
|
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.selection.toggleable
|
||||||
|
import androidx.compose.material3.ListItem
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Switch
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.semantics.Role
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
internal fun SectionTitle(text: String) {
|
||||||
|
Text(
|
||||||
|
text = text,
|
||||||
|
style = MaterialTheme.typography.labelLarge,
|
||||||
|
color = MaterialTheme.colorScheme.primary,
|
||||||
|
modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 16.dp, bottom = 4.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
internal fun SwitchRow(
|
||||||
|
title: String,
|
||||||
|
summary: String,
|
||||||
|
checked: Boolean,
|
||||||
|
onCheckedChange: (Boolean) -> Unit
|
||||||
|
) {
|
||||||
|
ListItem(
|
||||||
|
headlineContent = { Text(title) },
|
||||||
|
supportingContent = { Text(summary) },
|
||||||
|
trailingContent = { Switch(checked = checked, onCheckedChange = null) },
|
||||||
|
// Die ganze Zeile ist klickbar, der Switch selbst nur Anzeige (gut für TalkBack)
|
||||||
|
modifier = Modifier.toggleable(
|
||||||
|
value = checked,
|
||||||
|
role = Role.Switch,
|
||||||
|
onValueChange = onCheckedChange
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
internal fun ClickRow(
|
||||||
|
title: String,
|
||||||
|
summary: String,
|
||||||
|
onClick: () -> Unit,
|
||||||
|
trailing: (@Composable () -> Unit)? = null
|
||||||
|
) {
|
||||||
|
ListItem(
|
||||||
|
headlineContent = { Text(title) },
|
||||||
|
supportingContent = { Text(summary) },
|
||||||
|
trailingContent = trailing,
|
||||||
|
modifier = Modifier.clickable(onClick = onClick)
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package de.schanbro.weekfocus.screens
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||||
|
import androidx.compose.material3.*
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.platform.LocalUriHandler
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import de.schanbro.weekfocus.R
|
||||||
|
import de.schanbro.weekfocus.components.ClickRow
|
||||||
|
import de.schanbro.weekfocus.components.SectionTitle
|
||||||
|
import de.schanbro.weekfocus.update.UpdateChecker
|
||||||
|
|
||||||
|
private const val REPO_URL = "https://git.schamagusa.de/robin/WeekFocus"
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
|
@Composable
|
||||||
|
fun AboutScreen(
|
||||||
|
modifier: Modifier = Modifier
|
||||||
|
) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
val uriHandler = LocalUriHandler.current
|
||||||
|
val version = remember { UpdateChecker.currentVersion(context) }
|
||||||
|
|
||||||
|
Column(modifier = modifier.fillMaxSize()) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.verticalScroll(rememberScrollState())
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 24.dp, vertical = 32.dp),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.app_name),
|
||||||
|
style = MaterialTheme.typography.headlineMedium
|
||||||
|
)
|
||||||
|
Spacer(Modifier.height(4.dp))
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.about_version, version),
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
Spacer(Modifier.height(16.dp))
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.about_description),
|
||||||
|
style = MaterialTheme.typography.bodyLarge,
|
||||||
|
textAlign = TextAlign.Center
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
HorizontalDivider()
|
||||||
|
|
||||||
|
SectionTitle(stringResource(R.string.about_section_links))
|
||||||
|
|
||||||
|
ClickRow(
|
||||||
|
title = stringResource(R.string.settings_source_title),
|
||||||
|
summary = stringResource(R.string.settings_source_summary),
|
||||||
|
onClick = { uriHandler.openUri(REPO_URL) }
|
||||||
|
)
|
||||||
|
ClickRow(
|
||||||
|
title = stringResource(R.string.about_issues_title),
|
||||||
|
summary = stringResource(R.string.about_issues_summary),
|
||||||
|
onClick = { uriHandler.openUri("$REPO_URL/issues") }
|
||||||
|
)
|
||||||
|
ClickRow(
|
||||||
|
title = stringResource(R.string.about_releases_title),
|
||||||
|
summary = stringResource(R.string.about_releases_summary),
|
||||||
|
onClick = { uriHandler.openUri("$REPO_URL/releases") }
|
||||||
|
)
|
||||||
|
|
||||||
|
Spacer(Modifier.height(16.dp))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
package de.schanbro.weekfocus.screens
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.net.Uri
|
||||||
|
import android.os.Build
|
||||||
|
import android.provider.Settings
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.selection.toggleable
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.material3.*
|
||||||
|
import androidx.compose.runtime.*
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||||
|
import androidx.compose.ui.platform.LocalUriHandler
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.semantics.Role
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import de.schanbro.weekfocus.R
|
||||||
|
import de.schanbro.weekfocus.settings.SettingsRepository
|
||||||
|
import de.schanbro.weekfocus.settings.ThemeMode
|
||||||
|
import de.schanbro.weekfocus.update.ReleaseInfo
|
||||||
|
import de.schanbro.weekfocus.update.UpdateChecker
|
||||||
|
import de.schanbro.weekfocus.update.UpdateDialog
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import de.schanbro.weekfocus.components.SectionTitle
|
||||||
|
import de.schanbro.weekfocus.components.ClickRow
|
||||||
|
import de.schanbro.weekfocus.components.SwitchRow
|
||||||
|
|
||||||
|
private const val REPO_URL = "https://git.schamagusa.de/robin/WeekFocus"
|
||||||
|
|
||||||
|
private enum class CheckStatus { IDLE, CHECKING, UP_TO_DATE, FAILED, AVAILABLE }
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
|
@Composable
|
||||||
|
fun SettingsScreen(
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
onOpenAbout: () -> Unit
|
||||||
|
) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
val settings = remember { SettingsRepository.get(context) }
|
||||||
|
val haptic = LocalHapticFeedback.current
|
||||||
|
val uriHandler = LocalUriHandler.current
|
||||||
|
val scope = rememberCoroutineScope()
|
||||||
|
|
||||||
|
val currentVersion = remember { UpdateChecker.currentVersion(context) }
|
||||||
|
var status by remember { mutableStateOf(CheckStatus.IDLE) }
|
||||||
|
var availableRelease by remember { mutableStateOf<ReleaseInfo?>(null) }
|
||||||
|
|
||||||
|
fun checkNow() {
|
||||||
|
if (status == CheckStatus.CHECKING) return
|
||||||
|
status = CheckStatus.CHECKING
|
||||||
|
scope.launch {
|
||||||
|
val latest = UpdateChecker.fetchLatestRelease(settings.includePrereleases)
|
||||||
|
status = when {
|
||||||
|
latest == null -> CheckStatus.FAILED
|
||||||
|
UpdateChecker.isNewer(latest.version, currentVersion) -> {
|
||||||
|
availableRelease = latest
|
||||||
|
CheckStatus.AVAILABLE
|
||||||
|
}
|
||||||
|
else -> CheckStatus.UP_TO_DATE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column(
|
||||||
|
modifier = modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.verticalScroll(rememberScrollState())
|
||||||
|
) {
|
||||||
|
// ---------- Updates ----------
|
||||||
|
SectionTitle(stringResource(R.string.settings_section_updates))
|
||||||
|
|
||||||
|
SwitchRow(
|
||||||
|
title = stringResource(R.string.settings_auto_update_title),
|
||||||
|
summary = stringResource(R.string.settings_auto_update_summary),
|
||||||
|
checked = settings.autoCheckUpdates,
|
||||||
|
onCheckedChange = {
|
||||||
|
haptic.performHapticFeedback(
|
||||||
|
if (it) HapticFeedbackType.ToggleOn else HapticFeedbackType.ToggleOff
|
||||||
|
)
|
||||||
|
settings.updateAutoCheckUpdates(it)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
SwitchRow(
|
||||||
|
title = stringResource(R.string.settings_prerelease_title),
|
||||||
|
summary = stringResource(R.string.settings_prerelease_summary),
|
||||||
|
checked = settings.includePrereleases,
|
||||||
|
onCheckedChange = {
|
||||||
|
haptic.performHapticFeedback(
|
||||||
|
if (it) HapticFeedbackType.ToggleOn else HapticFeedbackType.ToggleOff
|
||||||
|
)
|
||||||
|
settings.updateIncludePrereleases(it)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
ClickRow(
|
||||||
|
title = stringResource(R.string.settings_check_now_title),
|
||||||
|
summary = when (status) {
|
||||||
|
CheckStatus.IDLE -> stringResource(R.string.settings_check_idle, currentVersion)
|
||||||
|
CheckStatus.CHECKING -> stringResource(R.string.settings_check_checking)
|
||||||
|
CheckStatus.UP_TO_DATE -> stringResource(R.string.settings_check_up_to_date)
|
||||||
|
CheckStatus.FAILED -> stringResource(R.string.settings_check_failed)
|
||||||
|
CheckStatus.AVAILABLE -> stringResource(R.string.settings_check_available)
|
||||||
|
},
|
||||||
|
onClick = { checkNow() },
|
||||||
|
trailing = {
|
||||||
|
if (status == CheckStatus.CHECKING) {
|
||||||
|
CircularProgressIndicator(
|
||||||
|
modifier = Modifier.size(24.dp),
|
||||||
|
strokeWidth = 3.dp
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
HorizontalDivider(Modifier.padding(vertical = 8.dp))
|
||||||
|
|
||||||
|
// ---------- Darstellung ----------
|
||||||
|
SectionTitle(stringResource(R.string.settings_section_appearance))
|
||||||
|
|
||||||
|
ListItem(headlineContent = { Text(stringResource(R.string.settings_theme_title)) })
|
||||||
|
val modes = listOf(
|
||||||
|
ThemeMode.SYSTEM to R.string.settings_theme_system,
|
||||||
|
ThemeMode.LIGHT to R.string.settings_theme_light,
|
||||||
|
ThemeMode.DARK to R.string.settings_theme_dark
|
||||||
|
)
|
||||||
|
SingleChoiceSegmentedButtonRow(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 16.dp)
|
||||||
|
) {
|
||||||
|
modes.forEachIndexed { index, (mode, labelRes) ->
|
||||||
|
SegmentedButton(
|
||||||
|
selected = settings.themeMode == mode,
|
||||||
|
onClick = {
|
||||||
|
if (settings.themeMode != mode) {
|
||||||
|
haptic.performHapticFeedback(HapticFeedbackType.ToggleOn)
|
||||||
|
settings.updateThemeMode(mode)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
shape = SegmentedButtonDefaults.itemShape(index, modes.size)
|
||||||
|
) {
|
||||||
|
Text(stringResource(labelRes))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pro-App-Sprache gibt es erst ab Android 13
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
ClickRow(
|
||||||
|
title = stringResource(R.string.settings_language_title),
|
||||||
|
summary = stringResource(R.string.settings_language_summary),
|
||||||
|
onClick = {
|
||||||
|
try {
|
||||||
|
context.startActivity(
|
||||||
|
Intent(
|
||||||
|
Settings.ACTION_APP_LOCALE_SETTINGS,
|
||||||
|
Uri.fromParts("package", context.packageName, null)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
} catch (_: Exception) {
|
||||||
|
// Gerät ohne diese Einstellungsseite: nichts tun
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
HorizontalDivider(Modifier.padding(vertical = 8.dp))
|
||||||
|
|
||||||
|
// ---------- Info ----------
|
||||||
|
SectionTitle(stringResource(R.string.settings_section_about))
|
||||||
|
|
||||||
|
ClickRow(
|
||||||
|
title = stringResource(R.string.title_about),
|
||||||
|
summary = stringResource(R.string.settings_about_summary),
|
||||||
|
onClick = onOpenAbout
|
||||||
|
)
|
||||||
|
|
||||||
|
Spacer(Modifier.height(16.dp))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dialog, wenn "Jetzt nach Updates suchen" etwas gefunden hat
|
||||||
|
availableRelease?.let { info ->
|
||||||
|
UpdateDialog(info = info, onDismiss = { availableRelease = null })
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -130,13 +130,13 @@ fun DeleteWordDialog(
|
|||||||
AlertDialog(
|
AlertDialog(
|
||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
icon = { Icon(Icons.Default.Delete, contentDescription = null) },
|
icon = { Icon(Icons.Default.Delete, contentDescription = null) },
|
||||||
title = { Text("Wort löschen?") },
|
title = { Text(stringResource(R.string.dialog_delete_title)) },
|
||||||
text = { Text("„$word“ wird dauerhaft entfernt.") },
|
text = { Text(stringResource(R.string.dialog_delete_message, word)) },
|
||||||
confirmButton = {
|
confirmButton = {
|
||||||
TextButton(onClick = onConfirm) { Text("Löschen") }
|
TextButton(onClick = onConfirm) { Text(stringResource(R.string.action_delete)) }
|
||||||
},
|
},
|
||||||
dismissButton = {
|
dismissButton = {
|
||||||
TextButton(onClick = onDismiss) { Text("Abbrechen") }
|
TextButton(onClick = onDismiss) { Text(stringResource(R.string.action_cancel)) }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,7 @@ fun EditWordDialog(
|
|||||||
AlertDialog(
|
AlertDialog(
|
||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
icon = { Icon(Icons.Default.Edit, contentDescription = null) },
|
icon = { Icon(Icons.Default.Edit, contentDescription = null) },
|
||||||
title = { Text("Wort bearbeiten") },
|
title = { Text(stringResource(R.string.dialog_edit_title)) },
|
||||||
text = {
|
text = {
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = text,
|
value = text,
|
||||||
@@ -166,10 +166,10 @@ fun EditWordDialog(
|
|||||||
TextButton(
|
TextButton(
|
||||||
onClick = { onSave(text) },
|
onClick = { onSave(text) },
|
||||||
enabled = text.isNotBlank()
|
enabled = text.isNotBlank()
|
||||||
) { Text("Speichern") }
|
) { Text(stringResource(R.string.action_save)) }
|
||||||
},
|
},
|
||||||
dismissButton = {
|
dismissButton = {
|
||||||
TextButton(onClick = onDismiss) { Text("Abbrechen") }
|
TextButton(onClick = onDismiss) { Text(stringResource(R.string.action_cancel)) }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package de.schanbro.weekfocus.settings
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
|
|
||||||
|
enum class ThemeMode { SYSTEM, LIGHT, DARK }
|
||||||
|
|
||||||
|
class SettingsRepository private constructor(context: Context) {
|
||||||
|
|
||||||
|
private val prefs = context.getSharedPreferences("WeekFocusPrefs", Context.MODE_PRIVATE)
|
||||||
|
|
||||||
|
var themeMode by mutableStateOf(
|
||||||
|
runCatching { ThemeMode.valueOf(prefs.getString(KEY_THEME, "") ?: "") }
|
||||||
|
.getOrDefault(ThemeMode.SYSTEM)
|
||||||
|
)
|
||||||
|
private set
|
||||||
|
|
||||||
|
var autoCheckUpdates by mutableStateOf(prefs.getBoolean(KEY_AUTO_UPDATE, true))
|
||||||
|
private set
|
||||||
|
|
||||||
|
var includePrereleases by mutableStateOf(prefs.getBoolean(KEY_PRERELEASE, false))
|
||||||
|
private set
|
||||||
|
|
||||||
|
fun updateThemeMode(mode: ThemeMode) {
|
||||||
|
themeMode = mode
|
||||||
|
prefs.edit().putString(KEY_THEME, mode.name).apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateAutoCheckUpdates(value: Boolean) {
|
||||||
|
autoCheckUpdates = value
|
||||||
|
prefs.edit().putBoolean(KEY_AUTO_UPDATE, value).apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateIncludePrereleases(value: Boolean) {
|
||||||
|
includePrereleases = value
|
||||||
|
prefs.edit().putBoolean(KEY_PRERELEASE, value).apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val KEY_THEME = "theme_mode"
|
||||||
|
private const val KEY_AUTO_UPDATE = "auto_check_updates"
|
||||||
|
private const val KEY_PRERELEASE = "include_prereleases"
|
||||||
|
|
||||||
|
@Volatile
|
||||||
|
private var instance: SettingsRepository? = null
|
||||||
|
|
||||||
|
fun get(context: Context): SettingsRepository =
|
||||||
|
instance ?: synchronized(this) {
|
||||||
|
instance ?: SettingsRepository(context.applicationContext).also { instance = it }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package de.schanbro.weekfocus.update
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.net.Uri
|
||||||
|
import android.provider.Settings
|
||||||
|
import androidx.core.content.FileProvider
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.ensureActive
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
|
import java.io.File
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.HttpURLConnection
|
||||||
|
import java.net.URL
|
||||||
|
|
||||||
|
object ApkInstaller {
|
||||||
|
|
||||||
|
fun canInstall(context: Context): Boolean =
|
||||||
|
context.packageManager.canRequestPackageInstalls()
|
||||||
|
|
||||||
|
fun openInstallPermissionSettings(context: Context) {
|
||||||
|
val intent = Intent(
|
||||||
|
Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES,
|
||||||
|
Uri.parse("package:${context.packageName}")
|
||||||
|
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
context.startActivity(intent)
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun download(
|
||||||
|
context: Context,
|
||||||
|
url: String,
|
||||||
|
onProgress: (Float) -> Unit
|
||||||
|
): File = withContext(Dispatchers.IO) {
|
||||||
|
val dir = File(context.cacheDir, "updates").apply {
|
||||||
|
mkdirs()
|
||||||
|
listFiles()?.forEach { it.delete() } // alte Downloads aufräumen
|
||||||
|
}
|
||||||
|
val file = File(dir, "update.apk")
|
||||||
|
|
||||||
|
val conn = URL(url).openConnection() as HttpURLConnection
|
||||||
|
conn.connectTimeout = 15_000
|
||||||
|
conn.readTimeout = 15_000
|
||||||
|
try {
|
||||||
|
if (conn.responseCode != HttpURLConnection.HTTP_OK) {
|
||||||
|
throw IOException("HTTP ${conn.responseCode}")
|
||||||
|
}
|
||||||
|
val total = conn.contentLengthLong
|
||||||
|
conn.inputStream.use { input ->
|
||||||
|
file.outputStream().use { output ->
|
||||||
|
val buffer = ByteArray(16 * 1024)
|
||||||
|
var done = 0L
|
||||||
|
var read: Int
|
||||||
|
while (input.read(buffer).also { read = it } != -1) {
|
||||||
|
ensureActive() // macht den Abbruch möglich
|
||||||
|
output.write(buffer, 0, read)
|
||||||
|
done += read
|
||||||
|
if (total > 0) onProgress(done.toFloat() / total)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file
|
||||||
|
} finally {
|
||||||
|
conn.disconnect()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun install(context: Context, apk: File) {
|
||||||
|
val uri = FileProvider.getUriForFile(
|
||||||
|
context, "${context.packageName}.fileprovider", apk
|
||||||
|
)
|
||||||
|
val intent = Intent(Intent.ACTION_VIEW).apply {
|
||||||
|
setDataAndType(uri, "application/vnd.android.package-archive")
|
||||||
|
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
}
|
||||||
|
context.startActivity(intent)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package de.schanbro.weekfocus.update
|
||||||
|
|
||||||
|
import android.Manifest
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.pm.PackageManager
|
||||||
|
import android.net.Uri
|
||||||
|
import android.provider.Settings
|
||||||
|
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
|
import androidx.compose.material3.AlertDialog
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.material3.TextButton
|
||||||
|
import androidx.compose.runtime.*
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.lifecycle.Lifecycle
|
||||||
|
import androidx.lifecycle.compose.LifecycleEventEffect
|
||||||
|
import de.schanbro.weekfocus.R
|
||||||
|
|
||||||
|
private const val KEY_HINT_DISMISSED = "network_hint_dismissed"
|
||||||
|
|
||||||
|
/** Zeigt [content] nur, wenn die App Netzwerkzugriff hat. Fragt sonst einmal danach. */
|
||||||
|
@Composable
|
||||||
|
fun NetworkPermissionGate(content: @Composable () -> Unit) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
val prefs = remember {
|
||||||
|
context.getSharedPreferences("WeekFocusPrefs", Context.MODE_PRIVATE)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun isGranted() = ContextCompat.checkSelfPermission(
|
||||||
|
context, Manifest.permission.INTERNET
|
||||||
|
) == PackageManager.PERMISSION_GRANTED
|
||||||
|
|
||||||
|
var granted by remember { mutableStateOf(isGranted()) }
|
||||||
|
var showDialog by remember {
|
||||||
|
mutableStateOf(!isGranted() && !prefs.getBoolean(KEY_HINT_DISMISSED, false))
|
||||||
|
}
|
||||||
|
|
||||||
|
val launcher = rememberLauncherForActivityResult(
|
||||||
|
ActivityResultContracts.RequestPermission()
|
||||||
|
) { result ->
|
||||||
|
granted = result || isGranted()
|
||||||
|
if (!granted) openAppSettings(context) // kein System-Dialog möglich → Einstellungen
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nach Rückkehr aus den Einstellungen neu prüfen
|
||||||
|
LifecycleEventEffect(Lifecycle.Event.ON_RESUME) {
|
||||||
|
granted = isGranted()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (granted) {
|
||||||
|
content()
|
||||||
|
} else if (showDialog) {
|
||||||
|
AlertDialog(
|
||||||
|
onDismissRequest = {},
|
||||||
|
title = { Text(stringResource(R.string.permission_network_title)) },
|
||||||
|
text = { Text(stringResource(R.string.permission_network_message)) },
|
||||||
|
confirmButton = {
|
||||||
|
TextButton(onClick = {
|
||||||
|
showDialog = false
|
||||||
|
launcher.launch(Manifest.permission.INTERNET)
|
||||||
|
}) { Text(stringResource(R.string.permission_allow)) }
|
||||||
|
},
|
||||||
|
dismissButton = {
|
||||||
|
TextButton(onClick = {
|
||||||
|
prefs.edit().putBoolean(KEY_HINT_DISMISSED, true).apply()
|
||||||
|
showDialog = false
|
||||||
|
}) { Text(stringResource(R.string.permission_not_now)) }
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun openAppSettings(context: Context) {
|
||||||
|
val intent = Intent(
|
||||||
|
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
|
||||||
|
Uri.fromParts("package", context.packageName, null)
|
||||||
|
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
context.startActivity(intent)
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
package de.schanbro.weekfocus.update
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.net.HttpURLConnection
|
||||||
|
import java.net.URL
|
||||||
|
import org.json.JSONArray
|
||||||
|
|
||||||
|
data class ReleaseInfo(
|
||||||
|
val version: String,
|
||||||
|
val notes: String,
|
||||||
|
val apkUrl: String
|
||||||
|
)
|
||||||
|
|
||||||
|
object UpdateChecker {
|
||||||
|
|
||||||
|
private const val RELEASES_URL =
|
||||||
|
"https://git.schamagusa.de/api/v1/repos/robin/WeekFocus/releases"
|
||||||
|
|
||||||
|
suspend fun fetchLatestRelease(includePrereleases: Boolean = false): ReleaseInfo? =
|
||||||
|
withContext(Dispatchers.IO) {
|
||||||
|
try {
|
||||||
|
if (includePrereleases) {
|
||||||
|
val body = httpGet("$RELEASES_URL?limit=10") ?: return@withContext null
|
||||||
|
val array = JSONArray(body)
|
||||||
|
(0 until array.length())
|
||||||
|
.map { array.getJSONObject(it) }
|
||||||
|
.firstNotNullOfOrNull { toRelease(it) }
|
||||||
|
} else {
|
||||||
|
val body = httpGet("$RELEASES_URL/latest") ?: return@withContext null
|
||||||
|
toRelease(JSONObject(body))
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun httpGet(url: String): String? {
|
||||||
|
val conn = URL(url).openConnection() as HttpURLConnection
|
||||||
|
conn.connectTimeout = 10_000
|
||||||
|
conn.readTimeout = 10_000
|
||||||
|
conn.setRequestProperty("Accept", "application/json")
|
||||||
|
return try {
|
||||||
|
if (conn.responseCode == HttpURLConnection.HTTP_OK) {
|
||||||
|
conn.inputStream.bufferedReader().use { it.readText() }
|
||||||
|
} else null
|
||||||
|
} finally {
|
||||||
|
conn.disconnect()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun toRelease(json: JSONObject): ReleaseInfo? {
|
||||||
|
if (json.optBoolean("draft", false)) return null
|
||||||
|
val assets = json.getJSONArray("assets")
|
||||||
|
val apk = (0 until assets.length())
|
||||||
|
.map { assets.getJSONObject(it) }
|
||||||
|
.firstOrNull { it.getString("name").endsWith(".apk", ignoreCase = true) }
|
||||||
|
?: return null
|
||||||
|
return ReleaseInfo(
|
||||||
|
version = json.getString("tag_name"),
|
||||||
|
notes = json.optString("body", ""),
|
||||||
|
apkUrl = apk.getString("browser_download_url")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
|
fun currentVersion(context: Context): String =
|
||||||
|
context.packageManager.getPackageInfo(context.packageName, 0).versionName ?: "0"
|
||||||
|
|
||||||
|
/** Numerischer Vergleich pro Segment, damit 1.2.11 > 1.2.9 gilt. */
|
||||||
|
fun isNewer(remote: String, local: String): Boolean {
|
||||||
|
val r = parse(remote)
|
||||||
|
val l = parse(local)
|
||||||
|
for (i in 0 until maxOf(r.size, l.size)) {
|
||||||
|
val a = r.getOrElse(i) { 0 }
|
||||||
|
val b = l.getOrElse(i) { 0 }
|
||||||
|
if (a != b) return a > b
|
||||||
|
}
|
||||||
|
// Gleiche Nummer: stabiles Release ist neuer als eine installierte Beta
|
||||||
|
return local.contains("-") && !remote.contains("-")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun parse(version: String): List<Int> =
|
||||||
|
version.trim().removePrefix("v").substringBefore("-")
|
||||||
|
.split(".").map { it.toIntOrNull() ?: 0 }
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
package de.schanbro.weekfocus.update
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.widget.Toast
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.material3.*
|
||||||
|
import androidx.compose.runtime.*
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import de.schanbro.weekfocus.R
|
||||||
|
import de.schanbro.weekfocus.settings.SettingsRepository
|
||||||
|
import kotlinx.coroutines.CancellationException
|
||||||
|
import kotlinx.coroutines.Job
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
private const val CHECK_INTERVAL_MS = 24L * 60 * 60 * 1000
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun UpdateHandler() {
|
||||||
|
val context = LocalContext.current
|
||||||
|
val settings = remember { SettingsRepository.get(context) }
|
||||||
|
val prefs = remember {
|
||||||
|
context.getSharedPreferences("WeekFocusPrefs", Context.MODE_PRIVATE)
|
||||||
|
}
|
||||||
|
var release by remember { mutableStateOf<ReleaseInfo?>(null) }
|
||||||
|
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
if (!settings.autoCheckUpdates) return@LaunchedEffect
|
||||||
|
|
||||||
|
val now = System.currentTimeMillis()
|
||||||
|
if (now - prefs.getLong("last_update_check", 0L) < CHECK_INTERVAL_MS) return@LaunchedEffect
|
||||||
|
|
||||||
|
val latest = UpdateChecker.fetchLatestRelease(settings.includePrereleases)
|
||||||
|
?: return@LaunchedEffect
|
||||||
|
prefs.edit().putLong("last_update_check", now).apply()
|
||||||
|
|
||||||
|
if (UpdateChecker.isNewer(latest.version, UpdateChecker.currentVersion(context))) {
|
||||||
|
release = latest
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
release?.let { UpdateDialog(info = it, onDismiss = { release = null }) }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun UpdateDialog(info: ReleaseInfo, onDismiss: () -> Unit) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
val scope = rememberCoroutineScope()
|
||||||
|
var progress by remember { mutableStateOf<Float?>(null) } // null = kein Download
|
||||||
|
var downloadJob by remember { mutableStateOf<Job?>(null) }
|
||||||
|
val downloading = progress != null
|
||||||
|
|
||||||
|
AlertDialog(
|
||||||
|
onDismissRequest = { if (!downloading) onDismiss() },
|
||||||
|
title = { Text(stringResource(R.string.update_title)) },
|
||||||
|
text = {
|
||||||
|
Column(Modifier.verticalScroll(rememberScrollState())) {
|
||||||
|
Text(stringResource(R.string.update_message, info.version.removePrefix("v")))
|
||||||
|
if (info.notes.isNotBlank()) {
|
||||||
|
Spacer(Modifier.height(12.dp))
|
||||||
|
Text(
|
||||||
|
text = info.notes,
|
||||||
|
style = MaterialTheme.typography.bodySmall,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
}
|
||||||
|
progress?.let { p ->
|
||||||
|
Spacer(Modifier.height(16.dp))
|
||||||
|
LinearProgressIndicator(
|
||||||
|
progress = { p },
|
||||||
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
confirmButton = {
|
||||||
|
TextButton(
|
||||||
|
enabled = !downloading,
|
||||||
|
onClick = {
|
||||||
|
if (!ApkInstaller.canInstall(context)) {
|
||||||
|
Toast.makeText(
|
||||||
|
context, R.string.update_permission_hint, Toast.LENGTH_LONG
|
||||||
|
).show()
|
||||||
|
ApkInstaller.openInstallPermissionSettings(context)
|
||||||
|
} else {
|
||||||
|
downloadJob = scope.launch {
|
||||||
|
progress = 0f
|
||||||
|
try {
|
||||||
|
val apk = ApkInstaller.download(context, info.apkUrl) {
|
||||||
|
progress = it
|
||||||
|
}
|
||||||
|
progress = null
|
||||||
|
onDismiss()
|
||||||
|
ApkInstaller.install(context, apk)
|
||||||
|
} catch (e: CancellationException) {
|
||||||
|
throw e
|
||||||
|
} catch (e: Exception) {
|
||||||
|
progress = null
|
||||||
|
Toast.makeText(
|
||||||
|
context, R.string.update_failed, Toast.LENGTH_LONG
|
||||||
|
).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
) { Text(stringResource(R.string.update_action)) }
|
||||||
|
},
|
||||||
|
dismissButton = {
|
||||||
|
TextButton(
|
||||||
|
onClick = {
|
||||||
|
downloadJob?.cancel()
|
||||||
|
progress = null
|
||||||
|
onDismiss()
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
stringResource(
|
||||||
|
if (downloading) R.string.action_cancel else R.string.update_later
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,11 +1,67 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="hint_new_word">Enter new Word</string>
|
<string name="hint_new_word">Enter new word</string>
|
||||||
<string name="hint_add_word">Add word</string>
|
<string name="hint_add_word">Add word</string>
|
||||||
<string name="msg_no_words_yet">No words yet.</string>
|
<string name="msg_no_words_yet">No words yet.</string>
|
||||||
<string name="msg_no_words">No words</string>
|
<string name="msg_no_words">No words</string>
|
||||||
<string name="title_weekly_focus">Weekly Focus</string>
|
<string name="title_weekly_focus">Weekly focus</string>
|
||||||
<string name="title_settings">Settings</string>
|
<string name="title_settings">Settings</string>
|
||||||
<string name="title_words">Words</string>
|
<string name="title_words">Words</string>
|
||||||
<string name="title_home">Home</string>
|
<string name="title_home">Home</string>
|
||||||
|
|
||||||
|
<string name="action_delete">Delete</string>
|
||||||
|
<string name="action_cancel">Cancel</string>
|
||||||
|
<string name="action_save">Save</string>
|
||||||
|
|
||||||
|
<string name="dialog_delete_title">Delete word?</string>
|
||||||
|
<string name="dialog_delete_message">“%1$s” will be permanently removed.</string>
|
||||||
|
<string name="dialog_edit_title">Edit word</string>
|
||||||
|
|
||||||
|
<string name="update_title">Update available</string>
|
||||||
|
<string name="update_message">Version %1$s is available. Download and install now?</string>
|
||||||
|
<string name="update_action">Update</string>
|
||||||
|
<string name="update_later">Later</string>
|
||||||
|
<string name="update_failed">Update failed. Please try again later.</string>
|
||||||
|
<string name="update_permission_hint">Please allow installs from this source, then tap “Update” again.</string>
|
||||||
|
|
||||||
|
<string name="permission_network_title">Network access needed</string>
|
||||||
|
<string name="permission_network_message">WeekFocus needs network access to check for updates. Without it the app keeps working, but won’t look for new versions.</string>
|
||||||
|
<string name="permission_allow">Allow</string>
|
||||||
|
<string name="permission_not_now">Not now</string>
|
||||||
|
|
||||||
|
<string name="settings_section_updates">Updates</string>
|
||||||
|
<string name="settings_auto_update_title">Check for updates automatically</string>
|
||||||
|
<string name="settings_auto_update_summary">On app start, at most once a day</string>
|
||||||
|
<string name="settings_prerelease_title">Include beta versions</string>
|
||||||
|
<string name="settings_prerelease_summary">Also offer pre-releases. These may contain bugs.</string>
|
||||||
|
<string name="settings_check_now_title">Check for updates now</string>
|
||||||
|
<string name="settings_check_idle">Installed version: %1$s</string>
|
||||||
|
<string name="settings_check_checking">Checking …</string>
|
||||||
|
<string name="settings_check_up_to_date">The app is up to date</string>
|
||||||
|
<string name="settings_check_failed">Check failed. Please check your network connection.</string>
|
||||||
|
<string name="settings_check_available">Update available</string>
|
||||||
|
|
||||||
|
<string name="settings_section_appearance">Appearance</string>
|
||||||
|
<string name="settings_theme_title">Theme</string>
|
||||||
|
<string name="settings_theme_system">System</string>
|
||||||
|
<string name="settings_theme_light">Light</string>
|
||||||
|
<string name="settings_theme_dark">Dark</string>
|
||||||
|
<string name="settings_language_title">Language</string>
|
||||||
|
<string name="settings_language_summary">Change in system settings</string>
|
||||||
|
|
||||||
|
<string name="settings_section_about">About</string>
|
||||||
|
<string name="settings_version_title">Version</string>
|
||||||
|
<string name="settings_source_title">Source code</string>
|
||||||
|
<string name="settings_source_summary">Open repository on Gitea</string>
|
||||||
|
|
||||||
|
<string name="action_back">Back</string>
|
||||||
|
<string name="settings_about_summary">Version, source code and more</string>
|
||||||
|
|
||||||
|
<string name="about_version">Version %1$s</string>
|
||||||
|
<string name="about_description">Keep your words of the week in view, right on your home screen.</string>
|
||||||
|
<string name="about_section_links">Links</string>
|
||||||
|
<string name="about_issues_title">Report a problem</string>
|
||||||
|
<string name="about_issues_summary">Bugs and requests in the issue tracker</string>
|
||||||
|
<string name="about_releases_title">Releases</string>
|
||||||
|
<string name="about_releases_summary">See all releases and changes</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="splash_background">#121212</color>
|
||||||
|
</resources>
|
||||||
@@ -7,4 +7,5 @@
|
|||||||
<color name="teal_700">#FF018786</color>
|
<color name="teal_700">#FF018786</color>
|
||||||
<color name="black">#FF000000</color>
|
<color name="black">#FF000000</color>
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
<color name="splash_background">#FFFFFF</color>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -9,4 +9,66 @@
|
|||||||
<string name="title_settings">Einstellungen</string>
|
<string name="title_settings">Einstellungen</string>
|
||||||
<string name="title_words">Wörter</string>
|
<string name="title_words">Wörter</string>
|
||||||
<string name="title_home">Start</string>
|
<string name="title_home">Start</string>
|
||||||
|
<string name="title_about">Über</string>
|
||||||
|
|
||||||
|
<!-- Aktionen -->
|
||||||
|
<string name="action_delete">Löschen</string>
|
||||||
|
<string name="action_cancel">Abbrechen</string>
|
||||||
|
<string name="action_save">Speichern</string>
|
||||||
|
|
||||||
|
<!-- Dialoge -->
|
||||||
|
<string name="dialog_delete_title">Wort löschen?</string>
|
||||||
|
<string name="dialog_delete_message">„%1$s“ wird dauerhaft entfernt.</string>
|
||||||
|
<string name="dialog_edit_title">Wort bearbeiten</string>
|
||||||
|
|
||||||
|
<!-- Auto-Update -->
|
||||||
|
<string name="update_title">Update verfügbar</string>
|
||||||
|
<string name="update_message">Version %1$s ist verfügbar. Jetzt herunterladen und installieren?</string>
|
||||||
|
<string name="update_action">Aktualisieren</string>
|
||||||
|
<string name="update_later">Später</string>
|
||||||
|
<string name="update_failed">Update fehlgeschlagen. Bitte später erneut versuchen.</string>
|
||||||
|
<string name="update_permission_hint">Bitte die Installation aus dieser Quelle erlauben und danach erneut auf „Aktualisieren“ tippen.</string>
|
||||||
|
|
||||||
|
<!-- Berechntigungen -->
|
||||||
|
<string name="permission_network_title">Netzwerkzugriff benötigt</string>
|
||||||
|
<string name="permission_network_message">WeekFocus braucht Netzwerkzugriff, um nach Updates zu suchen. Ohne Zugriff funktioniert die App weiterhin, sucht aber nicht nach neuen Versionen.</string>
|
||||||
|
<string name="permission_allow">Erlauben</string>
|
||||||
|
<string name="permission_not_now">Nicht jetzt</string>
|
||||||
|
|
||||||
|
<!-- Einstellungen -->
|
||||||
|
<string name="settings_section_updates">Updates</string>
|
||||||
|
<string name="settings_auto_update_title">Automatisch nach Updates suchen</string>
|
||||||
|
<string name="settings_auto_update_summary">Beim Start der App, höchstens einmal täglich</string>
|
||||||
|
<string name="settings_prerelease_title">Beta-Versionen einbeziehen</string>
|
||||||
|
<string name="settings_prerelease_summary">Auch Vorabversionen anbieten. Diese können Fehler enthalten.</string>
|
||||||
|
<string name="settings_check_now_title">Jetzt nach Updates suchen</string>
|
||||||
|
<string name="settings_check_idle">Installierte Version: %1$s</string>
|
||||||
|
<string name="settings_check_checking">Suche läuft …</string>
|
||||||
|
<string name="settings_check_up_to_date">Die App ist auf dem neuesten Stand</string>
|
||||||
|
<string name="settings_check_failed">Suche fehlgeschlagen. Bitte Netzwerkverbindung prüfen.</string>
|
||||||
|
<string name="settings_check_available">Update verfügbar</string>
|
||||||
|
|
||||||
|
<string name="settings_section_appearance">Darstellung</string>
|
||||||
|
<string name="settings_theme_title">Design</string>
|
||||||
|
<string name="settings_theme_system">System</string>
|
||||||
|
<string name="settings_theme_light">Hell</string>
|
||||||
|
<string name="settings_theme_dark">Dunkel</string>
|
||||||
|
<string name="settings_language_title">Sprache</string>
|
||||||
|
<string name="settings_language_summary">In den Systemeinstellungen ändern</string>
|
||||||
|
|
||||||
|
<string name="settings_section_about">Über die App</string>
|
||||||
|
<string name="settings_version_title">Version</string>
|
||||||
|
<string name="settings_source_title">Quellcode</string>
|
||||||
|
<string name="settings_source_summary">Repository auf Gitea öffnen</string>
|
||||||
|
|
||||||
|
<string name="action_back">Zurück</string>
|
||||||
|
<string name="settings_about_summary">Version, Quellcode und mehr</string>
|
||||||
|
|
||||||
|
<string name="about_version">Version %1$s</string>
|
||||||
|
<string name="about_description">Behalte deine Wörter der Woche im Blick, direkt auf dem Startbildschirm.</string>
|
||||||
|
<string name="about_section_links">Links</string>
|
||||||
|
<string name="about_issues_title">Fehler melden</string>
|
||||||
|
<string name="about_issues_summary">Probleme und Wünsche im Issue-Tracker</string>
|
||||||
|
<string name="about_releases_title">Versionen</string>
|
||||||
|
<string name="about_releases_summary">Alle Releases und Änderungen ansehen</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="Theme.WeekFocus" parent="android:Theme.Material.Light.NoActionBar" />
|
<style name="Theme.WeekFocus" parent="android:Theme.Material.Light.NoActionBar" />
|
||||||
|
<style name="Theme.WeekFocus.Splash" parent="Theme.SplashScreen">
|
||||||
|
<item name="windowSplashScreenBackground">@color/splash_background</item>
|
||||||
|
<item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
|
||||||
|
<item name="postSplashScreenTheme">@style/Theme.WeekFocus</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<paths>
|
||||||
|
<cache-path name="updates" path="updates/" />
|
||||||
|
</paths>
|
||||||
Reference in new issue
Block a user