Compare commits

...
11 Commits
Author SHA1 Message Date
robin 8cacb6f582 Merge pull request 'chore(l10n): update translations' (#17) from weblate-translations into main
Reviewed-on: #17
2026-10-04 15:32:04 +00:00
robin 86882fafcb chore(l10n): update German (formal) translation
chore(l10n): update English translation

Co-authored-by: Weblate Admin <robin@schanbros.de>
Language: English
Language: German (formal)
Progress: 100.0% (7 of 7 strings)
Translate-URL: https://weblate.schamagusa.de/projects/weekfocus/weekfocus/de@formal/
Translate-URL: https://weblate.schamagusa.de/projects/weekfocus/weekfocus/en/
Translation: WeekFocus/WeekFocus
2026-10-04 15:31:23 +00:00
robin edb11b360b CHANGELOG update
Build & Release Android App / build (push) Successful in 19m15s
2026-10-04 17:22:47 +02:00
robin 18c375979c Merge pull request 'feat: better layout' (#16) from feat/better-layout into main
Reviewed-on: #16
2026-10-04 15:18:58 +00:00
robin 2545498dc2 feat: navigation
feat: remove word
2026-10-04 17:17:23 +02:00
robin fd20b5d91e chore: debug/dev builds besides normal builds 2026-10-04 15:53:24 +02:00
robin 76cf592cd1 Merge pull request 'chore(l10n): update translations' (#14) from weblate-translations into main
Reviewed-on: #14
2026-10-04 12:58:52 +00:00
robin d134b0cd0a chore(l10n): update English translation
chore(l10n): update German (formal) translation

Co-authored-by: Weblate Admin <robin@schanbros.de>
Language: English
Language: German (formal)
Progress: 100.0% (7 of 7 strings)
Translate-URL: https://weblate.schamagusa.de/projects/weekfocus/weekfocus/de@formal/
Translate-URL: https://weblate.schamagusa.de/projects/weekfocus/weekfocus/en/
Translation: WeekFocus/WeekFocus
2026-10-04 12:54:11 +00:00
robin 4a62373992 refactor: move hardcoded texts to strings.xml 2026-10-04 14:19:38 +02:00
robin e589693c67 README.md aktualisiert 2026-10-04 10:19:26 +00:00
robin f5568cf211 README.md aktualisiert 2026-10-03 17:45:08 +00:00
11 changed files with 346 additions and 122 deletions

No files matched your search

+6
View File
@@ -1,5 +1,11 @@
# Changelog
## [1.2.0] - 2026-10-04
### New
* navigation
* ability to delete words
* better layout
## [1.1.3] - 2026-10-03
### Changed
- chore: refactor: switch from release github action to bash
+42 -25
View File
@@ -11,20 +11,19 @@
<img src="https://raw.githubusercontent.com/ImranR98/Obtainium/main/assets/graphics/badge_obtainium.png" alt="Get it on Obtainium" height="64">
</a>
[![Release](https://img.shields.io/gitea/v/release/Schanbro/WeekFocus?gitea_url=https://git.schamagusa.de&label=Release)](https://git.schamagusa.de/Schanbro/WeekFocus/releases)
[![License: GPL-3.0](https://img.shields.io/badge/License-GPL--3.0-blue)](LICENSE)
[![Translation status](https://weblate.schamagusa.de/widgets/weekfocus/-/svg-badge.svg)](https://weblate.schamagusa.de/engage/weekfocus/)
![Android 8.0+](https://img.shields.io/badge/Android-8.0%2B-3DDC84?logo=android&logoColor=white)
![Kotlin](https://img.shields.io/badge/Kotlin-7F52FF?logo=kotlin&logoColor=white)
![Jetpack Compose](https://img.shields.io/badge/Jetpack%20Compose-4285F4?logo=jetpackcompose&logoColor=white)
![Stars](https://img.shields.io/gitea/stars/Schanbro/WeekFocus?gitea_url=https://git.schamagusa.de)
![Forks](https://img.shields.io/gitea/forks/Schanbro/WeekFocus?gitea_url=https://git.schamagusa.de)
![Open issues](https://img.shields.io/gitea/issues/open/Schanbro/WeekFocus?gitea_url=https://git.schamagusa.de)
![Last commit](https://img.shields.io/gitea/last-commit/Schanbro/WeekFocus?gitea_url=https://git.schamagusa.de)
[![Release](https://img.shields.io/gitea/v/release/Schanbro/WeekFocus?gitea_url=https://git.schamagusa.de&style=for-the-badge&label=Release)](https://git.schamagusa.de/Schanbro/WeekFocus/releases)
[![License: GPL-3.0](https://img.shields.io/badge/License-GPL--3.0-blue?style=for-the-badge)](LICENSE)
<!--[![Translation status](https://weblate.schamagusa.de/widgets/weekfocus/-/svg-badge.svg)](https://weblate.schamagusa.de/engage/weekfocus/)-->
![Android](https://img.shields.io/badge/Android-10%2B-3DDC84?style=for-the-badge&logo=android&logoColor=white)
![Language: Kotlin](https://img.shields.io/badge/Language-Kotlin-7F52FF?style=for-the-badge&logo=kotlin&logoColor=white)
![UI: Jetpack Compose](https://img.shields.io/badge/UI-Jetpack%20Compose-4285F4?style=for-the-badge&logo=jetpackcompose&logoColor=white)
![Design: Material 3](https://img.shields.io/badge/Design-Material%203-3DDC84?style=for-the-badge)
<!--[![Stars](https://img.shields.io/gitea/stars/Schanbro/WeekFocus?gitea_url=https://git.schamagusa.de&style=for-the-badge)](https://git.schamagusa.de/Schanbro/WeekFocus)
[![Forks](https://img.shields.io/gitea/forks/Schanbro/WeekFocus?gitea_url=https://git.schamagusa.de&style=for-the-badge)](https://git.schamagusa.de/Schanbro/WeekFocus)-->
[![Open Issues](https://img.shields.io/gitea/issues/open/Schanbro/WeekFocus?gitea_url=https://git.schamagusa.de&style=for-the-badge)](https://git.schamagusa.de/Schanbro/WeekFocus/issues)
[![Last Commit](https://img.shields.io/gitea/last-commit/Schanbro/WeekFocus?gitea_url=https://git.schamagusa.de&style=for-the-badge)](https://git.schamagusa.de/Schanbro/WeekFocus)
</div>
@@ -35,9 +34,9 @@
- [About](#about)
- [How It Works](#how-it-works)
- [Features](#features)
- [Screenshots](#screenshots)
- [Installation](#installation)
- [Building from Source](#building-from-source)
- [Releases](#releases)
- [Contributing](#contributing)
- [License](#license)
- [Translations](#translations)
@@ -65,16 +64,6 @@ No streaks, no pressure, no clutter. Just a gentle daily reminder of what you wa
- 🔒 No ads, no tracking, no unnecessary permissions
- ⚡ Lightweight and battery-friendly
## Screenshots
<!-- Add screenshots here, for example:
<p align="center">
<img src="docs/screenshots/1.png" width="24%" />
<img src="docs/screenshots/2.png" width="24%" />
<img src="docs/screenshots/3.png" width="24%" />
</p>
-->
## Installation
### Recommended: Obtainium
@@ -82,8 +71,7 @@ No streaks, no pressure, no clutter. Just a gentle daily reminder of what you wa
With [Obtainium](https://github.com/ImranR98/Obtainium) you get updates directly from this repository, no app store required.
1. Install Obtainium on your Android device.
2. Tap the badge above or open this link:
[Add WeekFocus to Obtainium](https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://git.schamagusa.de/Schanbro/WeekFocus)
2. Tap the badge above.
3. Confirm and install the app.
Alternatively, tap **Add App** in Obtainium and paste this URL:
@@ -104,6 +92,7 @@ https://git.schamagusa.de/Schanbro/WeekFocus
- [Android Studio](https://developer.android.com/studio) (latest stable)
- JDK 17 or newer
- Android SDK platform 37 (`minSdk` 29, `targetSdk` 37)
**Steps**
@@ -115,6 +104,34 @@ cd WeekFocus
The resulting APK is located in `app/build/outputs/apk/debug/`.
## Releases
Releases are built automatically with Gitea Actions. Pushing a tag that starts with `v` triggers the workflow, which builds and signs the APK and publishes it as a release together with the notes from `CHANGELOG.md`.
### Starting a release build
Create a tag and push it. The tag name determines the app version (`v1.1.3` builds version `1.1.3`):
```bash
git tag v1.1.3
git push origin v1.1.3
```
You can follow the build under **Actions** in the repository. When it finishes, the signed `WeekFocus-1.1.3.apk` appears on the [Releases](https://git.schamagusa.de/Schanbro/WeekFocus/releases) page.
### Release notes
The workflow takes the notes from the section of `CHANGELOG.md` whose heading starts with the version number:
```markdown
## 1.1.3
- Added Weblate translations
- Fixed widget update at the start of a new week
```
If no matching section exists, the release gets a short placeholder text instead.
## Contributing
Contributions are welcome!
+6 -1
View File
@@ -24,7 +24,7 @@ android {
applicationId = "de.schanbro.weekfocus"
minSdk = 29
targetSdk = 37
versionCode = major * 10000 + minor * 100 + patch
versionCode = (major * 10000 + minor * 100 + patch).coerceAtLeast(1)
versionName = tagVersion
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
@@ -43,6 +43,10 @@ android {
}
buildTypes {
debug {
applicationIdSuffix = ".debug"
versionNameSuffix = "-dev"
}
release {
signingConfig = signingConfigs.getByName("release")
optimization {
@@ -75,4 +79,5 @@ dependencies {
androidTestImplementation(libs.androidx.junit)
debugImplementation(libs.androidx.compose.ui.test.manifest)
debugImplementation(libs.androidx.compose.ui.tooling)
implementation("androidx.compose.material:material-icons-extended")
}
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" translatable="false">WeekFocus-dev</string>
</resources>
@@ -1,22 +1,29 @@
package de.schanbro.weekfocus
import android.appwidget.AppWidgetManager
import android.content.ComponentName
import android.content.Context
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Home
import androidx.compose.material.icons.filled.List
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.outlined.Home
import androidx.compose.material.icons.outlined.List
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import android.appwidget.AppWidgetManager
import android.content.ComponentName
import de.schanbro.weekfocus.ui.theme.WeekFocusTheme
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.res.stringResource
import de.schanbro.weekfocus.ui.theme.WeekFocusTheme
import de.schanbro.weekfocus.screens.WordListScreen
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
@@ -24,99 +31,108 @@ class MainActivity : ComponentActivity() {
enableEdgeToEdge()
setContent {
WeekFocusTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
WordListScreen(
modifier = Modifier.padding(innerPadding)
MainScreen()
}
}
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun MainScreen() {
var selectedTab by remember { mutableIntStateOf(0) }
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()
Scaffold(
modifier = Modifier
.fillMaxSize()
.nestedScroll(scrollBehavior.nestedScrollConnection),
topBar = {
LargeTopAppBar(
title = {
Text(
when (selectedTab) {
0 -> stringResource(R.string.title_home)
1 -> stringResource(R.string.title_words)
2 -> stringResource(R.string.title_settings)
else -> stringResource(R.string.app_name)
}
)
}
},
scrollBehavior = scrollBehavior,
colors = TopAppBarDefaults.largeTopAppBarColors(
containerColor = MaterialTheme.colorScheme.surface,
scrolledContainerColor = MaterialTheme.colorScheme.surfaceContainer
)
)
},
bottomBar = {
NavigationBar {
NavigationBarItem(
selected = selectedTab == 0,
onClick = { selectedTab = 0 },
icon = {
Icon(
imageVector = if (selectedTab == 0) Icons.Filled.Home else Icons.Outlined.Home,
contentDescription = stringResource(R.string.title_home)
)
},
label = { Text(stringResource(R.string.title_home)) }
)
NavigationBarItem(
selected = selectedTab == 1,
onClick = { selectedTab = 1 },
icon = {
Icon(
imageVector = if (selectedTab == 1) Icons.Filled.List else Icons.Outlined.List,
contentDescription = stringResource(R.string.title_words)
)
},
label = { Text(stringResource(R.string.title_words)) }
)
NavigationBarItem(
selected = selectedTab == 2,
onClick = { selectedTab = 2 },
icon = {
Icon(
imageVector = if (selectedTab == 2) Icons.Filled.Settings else Icons.Outlined.Settings,
contentDescription = stringResource(R.string.title_settings)
)
},
label = { Text(stringResource(R.string.title_settings)) }
)
}
}
) { innerPadding ->
Surface(
modifier = Modifier
.fillMaxSize()
.padding(innerPadding),
color = MaterialTheme.colorScheme.background
) {
when (selectedTab) {
0 -> PlaceholderScreen(title = stringResource(R.string.title_weekly_focus))
1 -> WordListScreen()
2 -> PlaceholderScreen(title = stringResource(R.string.title_settings))
}
}
}
}
@Composable
fun WordListScreen(modifier: Modifier = Modifier) {
val context = LocalContext.current
val sharedPrefs = remember {
context.getSharedPreferences("WeekFocusPrefs", Context.MODE_PRIVATE)
}
// Wörter aus SharedPreferences laden und Zustand verwalten
var textInput by remember { mutableStateOf("") }
val wordList = remember {
mutableStateListOf<String>().apply {
val savedSet = sharedPrefs.getStringSet("words_key", emptySet()) ?: emptySet()
addAll(savedSet)
}
}
// Funktion zum Speichern in SharedPreferences
fun saveWords() {
sharedPrefs.edit().putStringSet("words_key", wordList.toSet()).apply()
}
Column(
modifier = modifier
.fillMaxSize()
.padding(16.dp)
fun PlaceholderScreen(title: String) {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
// Eingabefeld für ein neues Wort
OutlinedTextField(
value = textInput,
onValueChange = { textInput = it },
label = { Text(stringResource(R.string.hint_new_word)) },
modifier = Modifier.fillMaxWidth(),
singleLine = true
)
Spacer(modifier = Modifier.height(8.dp))
// Button zum Hinzufügen
Button(
onClick = {
val trimmed = textInput.trim()
if (trimmed.isNotEmpty()) {
wordList.add(trimmed)
saveWords()
updateWidget(context)
textInput = ""
}
},
modifier = Modifier.fillMaxWidth()
) {
Text(stringResource(R.string.hint_add_word))
}
Spacer(modifier = Modifier.height(24.dp))
Text(
text = stringResource(R.string.title_saved_words),
style = MaterialTheme.typography.titleMedium
text = title,
style = MaterialTheme.typography.headlineMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
Spacer(modifier = Modifier.height(8.dp))
// Liste der Wörter
if (wordList.isEmpty()) {
Text(
text = stringResource(R.string.msg_no_words_yet),
style = MaterialTheme.typography.bodyMedium
)
} else {
LazyColumn {
items(wordList) { word ->
Text(
text = "• $word",
style = MaterialTheme.typography.bodyLarge,
modifier = Modifier.padding(vertical = 4.dp)
)
}
}
}
}
}
// Hilfsfunktion zum Aktualisieren des Widgets
fun updateWidget(context: Context) {
val appWidgetManager = AppWidgetManager.getInstance(context)
val componentName = ComponentName(context, SimpleWidget::class.java)
@@ -4,6 +4,7 @@ import android.appwidget.AppWidgetManager
import android.appwidget.AppWidgetProvider
import android.content.Context
import android.widget.RemoteViews
import androidx.compose.ui.res.stringResource
import java.util.Calendar
import java.util.Random
@@ -43,7 +44,7 @@ class SimpleWidget : AppWidgetProvider() {
val randomIndex = random.nextInt(wordList.size)
wordList[randomIndex]
} else {
"Keine Wörter"
context.getString(R.string.msg_no_words)
}
// 4. RemoteViews aktualisieren
@@ -0,0 +1,169 @@
package de.schanbro.weekfocus.screens
import android.content.Context
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.unit.dp
import de.schanbro.weekfocus.R
import de.schanbro.weekfocus.updateWidget
@Composable
fun WordListScreen(modifier: Modifier = Modifier) {
val context = LocalContext.current
val focusManager = LocalFocusManager.current // FocusManager holen
val sharedPrefs = remember {
context.getSharedPreferences("WeekFocusPrefs", Context.MODE_PRIVATE)
}
var textInput by remember { mutableStateOf("") }
val wordList = remember {
mutableStateListOf<String>().apply {
val savedSet = sharedPrefs.getStringSet("words_key", emptySet()) ?: emptySet()
addAll(savedSet)
}
}
fun saveWords() {
sharedPrefs.edit().putStringSet("words_key", wordList.toSet()).apply()
}
fun addCurrentWord() {
val trimmed = textInput.trim()
if (trimmed.isNotEmpty()) {
wordList.add(0, trimmed)
saveWords()
updateWidget(context)
textInput = ""
focusManager.clearFocus() // Fokus aufheben & Tastatur schließen
}
}
Column(
modifier = modifier
.fillMaxSize()
// Auf Klicks im leeren Bereich reagieren -> Fokus aufheben
.pointerInput(Unit) {
detectTapGestures(onTap = {
focusManager.clearFocus()
})
}
.padding(horizontal = 16.dp)
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
OutlinedTextField(
value = textInput,
onValueChange = { textInput = it },
label = { Text(stringResource(R.string.hint_new_word)) },
modifier = Modifier.fillMaxWidth(),
singleLine = true,
shape = MaterialTheme.shapes.medium,
// "Fertig" / "Hinzufügen" Taste auf der Tastatur konfigurieren
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
keyboardActions = KeyboardActions(
onDone = { addCurrentWord() }
)
)
Button(
onClick = { addCurrentWord() },
modifier = Modifier
.fillMaxWidth()
.height(50.dp),
shape = MaterialTheme.shapes.medium
) {
Icon(Icons.Default.Add, contentDescription = null)
Spacer(Modifier.width(8.dp))
Text(stringResource(R.string.hint_add_word))
}
}
Spacer(modifier = Modifier.height(16.dp))
AnimatedVisibility(
visible = wordList.isEmpty(),
enter = fadeIn(),
exit = fadeOut()
) {
Box(
modifier = Modifier
.fillMaxWidth()
.padding(top = 32.dp),
contentAlignment = Alignment.Center
) {
Text(
text = stringResource(R.string.msg_no_words_yet),
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
}
}
LazyColumn(
verticalArrangement = Arrangement.spacedBy(8.dp),
contentPadding = PaddingValues(bottom = 16.dp)
) {
itemsIndexed(wordList) { index, word ->
ElevatedCard(
modifier = Modifier.fillMaxWidth(),
shape = MaterialTheme.shapes.medium,
colors = CardDefaults.elevatedCardColors(
containerColor = MaterialTheme.colorScheme.surfaceContainerLow
)
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp, vertical = 12.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
text = word,
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurface,
modifier = Modifier.weight(1f)
)
IconButton(
onClick = {
wordList.removeAt(index)
saveWords()
updateWidget(context)
}
) {
Icon(
imageVector = Icons.Default.Delete,
contentDescription = "Entfernen",
tint = MaterialTheme.colorScheme.error
)
}
}
}
}
}
}
}
+2 -3
View File
@@ -11,10 +11,9 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="WOCHENFOKUS"
android:text="@string/title_weekly_focus"
android:textSize="11sp"
android:letterSpacing="0.1"
android:textAllCaps="true"
android:textColor="?android:attr/textColorSecondary"
android:textStyle="bold" />
@@ -24,7 +23,7 @@
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:text="Hallo"
android:text="@string/msg_no_words"
android:textColor="?android:attr/textColorPrimary"
android:textSize="22sp"
android:textStyle="bold" />
+5 -2
View File
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">WeekFocus</string>
<string name="hint_new_word">Enter new Word</string>
<string name="hint_add_word">Add word</string>
<string name="title_saved_words">Saved words:</string>
<string name="msg_no_words_yet">No words yet.</string>
<string name="msg_no_words">No words</string>
<string name="title_weekly_focus">Weekly Focus</string>
<string name="title_settings">Settings</string>
<string name="title_words">Words</string>
<string name="title_home">Home</string>
</resources>
+6 -2
View File
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">WeekFocus</string>
<string name="app_name" translatable="false">WeekFocus</string>
<string name="hint_new_word">Neues Wort eingeben</string>
<string name="hint_add_word">Wort hinzufügen</string>
<string name="title_saved_words">Gespeicherte Wörter:</string>
<string name="msg_no_words_yet">Noch keine Wörter vorhanden.</string>
<string name="msg_no_words">Keine Wörter</string>
<string name="title_weekly_focus">Wochenfokus</string>
<string name="title_settings">Einstellungen</string>
<string name="title_words">Wörter</string>
<string name="title_home">Start</string>
</resources>
+1 -1
View File
@@ -7,5 +7,5 @@
android:resizeMode="horizontal|vertical"
android:widgetCategory="home_screen"
android:targetCellWidth="2"
android:targetCellHeight="2">
android:targetCellHeight="1">
</appwidget-provider>