diff --git a/app/build.gradle b/app/build.gradle
index d37bb1c..7ccafe4 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -2,7 +2,6 @@ plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.plugin.serialization' version '2.4.10'
id 'org.jetbrains.kotlin.plugin.compose' version '2.4.10'
- id 'com.mikepenz.aboutlibraries.plugin' version '15.2.0'
}
android {
@@ -74,16 +73,17 @@ android {
kotlinCompilerExtensionVersion = "2.2.20"
}
+ androidResources {
+ // The app ships English strings only; without this the libraries drag
+ // in some eighty locales of their own.
+ localeFilters += ["en"]
+ }
+
lint {
disable 'UsingMaterialAndMaterial3Libraries'
}
}
-aboutLibraries {
- library {
- exclusionPatterns = [~"androidx.*", ~"com.google.android.*", ~"org.jetbrains.*"]
- }
-}
dependencies {
implementation 'androidx.compose.material3:material3:1.4.0'
@@ -94,17 +94,10 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0'
- implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.compose.ui:ui'
implementation "androidx.activity:activity-ktx:1.13.0"
implementation 'androidx.compose.ui:ui-tooling-preview'
- implementation 'com.google.android.material:material:1.14.0'
- implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0'
-
- implementation 'com.mikepenz:aboutlibraries:14.2.1'
- implementation 'com.mikepenz:aboutlibraries-compose-m3:15.2.0'
- implementation 'com.mikepenz:aboutlibraries-core:15.2.0'
implementation platform('androidx.compose:compose-bom:2026.08.00')
diff --git a/app/src/main/java/net/helcel/beans/activity/SettingsScreen.kt b/app/src/main/java/net/helcel/beans/activity/SettingsScreen.kt
index b2c98fd..61d04ae 100644
--- a/app/src/main/java/net/helcel/beans/activity/SettingsScreen.kt
+++ b/app/src/main/java/net/helcel/beans/activity/SettingsScreen.kt
@@ -53,16 +53,15 @@ import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
-import androidx.preference.PreferenceManager
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import net.helcel.beans.R
import net.helcel.beans.activity.sub.AboutScreen
import net.helcel.beans.activity.sub.EditPlaceColorDialog
-import net.helcel.beans.activity.sub.LicenseScreen
import net.helcel.beans.countries.GeoLocImporter
import net.helcel.beans.helper.Data
+import net.helcel.beans.helper.defaultPreferences
import net.helcel.beans.helper.Settings
@Composable
@@ -70,7 +69,7 @@ fun SysTheme(
content: @Composable () -> Unit
) {
val context = LocalContext.current
- val prefs = PreferenceManager.getDefaultSharedPreferences(context)
+ val prefs = defaultPreferences(context)
val themeKey = prefs.getString(stringResource(R.string.key_theme), stringResource(R.string.system))
val darkTheme = when (themeKey) {
stringResource(R.string.system) -> isSystemInDarkTheme()
@@ -111,7 +110,6 @@ fun settingsNav(): NavHostController {
val navController = rememberNavController()
NavHost(navController, startDestination= "settings"){
composable("settings"){SettingsScreen(navController)}
- composable("licenses"){ LicenseScreen() }
composable("about"){ AboutScreen() }
}
return navController
@@ -150,7 +148,7 @@ fun SettingsMainScreen(onExit: ()->Unit = {}) {
@Composable
fun SettingsScreen(navController: NavHostController = settingsNav()) {
val context = LocalContext.current
- val prefs = PreferenceManager.getDefaultSharedPreferences(context)
+ val prefs = defaultPreferences(context)
val keyTheme = stringResource(R.string.key_theme)
val defaultTheme = stringResource(R.string.system)
val keyProjection = stringResource(R.string.key_projection)
@@ -351,10 +349,6 @@ fun SettingsScreen(navController: NavHostController = settingsNav()) {
HorizontalDivider()
}
item {
- PreferenceButton(stringResource(R.string.licenses)) {
- if (navController.currentDestination?.route != "licenses")
- navController.navigate("licenses")
- }
PreferenceButton(stringResource(R.string.about)) {
if (navController.currentDestination?.route != "about")
navController.navigate("about")
diff --git a/app/src/main/java/net/helcel/beans/activity/sub/LicenseScreen.kt b/app/src/main/java/net/helcel/beans/activity/sub/LicenseScreen.kt
deleted file mode 100644
index 3c6dbb8..0000000
--- a/app/src/main/java/net/helcel/beans/activity/sub/LicenseScreen.kt
+++ /dev/null
@@ -1,45 +0,0 @@
-package net.helcel.beans.activity.sub
-
-import androidx.compose.foundation.layout.fillMaxSize
-import androidx.compose.material.MaterialTheme
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.tooling.preview.Preview
-import com.mikepenz.aboutlibraries.ui.compose.DefaultChipColors
-import com.mikepenz.aboutlibraries.ui.compose.DefaultLibraryColors
-import com.mikepenz.aboutlibraries.ui.compose.android.produceLibraries
-import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer
-import net.helcel.beans.R
-import net.helcel.beans.activity.SysTheme
-
-
-@Preview
-@Composable
-fun LicenseScreen() {
- val libraries = produceLibraries(R.raw.aboutlibraries)
- SysTheme {
- LibrariesContainer(
- libraries = libraries.value,
- modifier = Modifier.fillMaxSize(),
- colors = DefaultLibraryColors(
- libraryBackgroundColor = MaterialTheme.colors.background,
- libraryContentColor = MaterialTheme.colors.onBackground,
- licenseChipColors = DefaultChipColors(
- containerColor = MaterialTheme.colors.primary,
- contentColor = MaterialTheme.colors.onPrimary,
- ),
- versionChipColors = DefaultChipColors(
- containerColor = MaterialTheme.colors.secondary,
- contentColor = MaterialTheme.colors.onSecondary,
- ),
- fundingChipColors = DefaultChipColors(
- containerColor = MaterialTheme.colors.secondary,
- contentColor = MaterialTheme.colors.onSecondary,
- ),
- dialogConfirmButtonColor = MaterialTheme.colors.primary,
- dialogBackgroundColor = MaterialTheme.colors.onPrimary,
- dialogContentColor = MaterialTheme.colors.primary,
- )
- )
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/net/helcel/beans/helper/Data.kt b/app/src/main/java/net/helcel/beans/helper/Data.kt
index a110ea0..0e19790 100644
--- a/app/src/main/java/net/helcel/beans/helper/Data.kt
+++ b/app/src/main/java/net/helcel/beans/helper/Data.kt
@@ -8,7 +8,6 @@ import android.os.Build
import android.os.Environment
import android.provider.MediaStore
import androidx.core.content.ContextCompat
-import androidx.preference.PreferenceManager
import net.helcel.beans.R
import net.helcel.beans.countries.GeoLoc
import java.util.HashMap
@@ -31,7 +30,7 @@ object Data {
private lateinit var sharedPreferences: SharedPreferences
fun loadData(ctx: Context, id:Int) {
- sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ctx)
+ sharedPreferences = defaultPreferences(ctx)
val groupsString = sharedPreferences.getString("groups_$id",null)
val visitsString = sharedPreferences.getString("visits_$id",null)
diff --git a/app/src/main/java/net/helcel/beans/helper/Settings.kt b/app/src/main/java/net/helcel/beans/helper/Settings.kt
index 88542ce..aa1d7ea 100644
--- a/app/src/main/java/net/helcel/beans/helper/Settings.kt
+++ b/app/src/main/java/net/helcel/beans/helper/Settings.kt
@@ -2,7 +2,6 @@ package net.helcel.beans.helper
import android.content.Context
import android.content.SharedPreferences
-import androidx.preference.PreferenceManager
import net.helcel.beans.R
import net.helcel.beans.activity.MainScreen
@@ -22,7 +21,7 @@ object Settings {
private lateinit var mainActivity: MainScreen
fun start(ctx: MainScreen) {
mainActivity = ctx
- sp = PreferenceManager.getDefaultSharedPreferences(ctx)
+ sp = defaultPreferences(ctx)
}
fun isSingleGroup(ctx: Context): Boolean {
diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml
index ff11436..cf5f142 100644
--- a/app/src/main/res/values-night/themes.xml
+++ b/app/src/main/res/values-night/themes.xml
@@ -1,6 +1,6 @@
-
\ No newline at end of file
diff --git a/app/src/main/res/values/en.xml b/app/src/main/res/values/en.xml
index 800dbfe..163a95b 100644
--- a/app/src/main/res/values/en.xml
+++ b/app/src/main/res/values/en.xml
@@ -13,7 +13,6 @@
Statistics
Prefer counters (#)
Prefer percentages (%)
- Licenses
Groups
Regional mode
Enable tracking of states and provinces
@@ -37,7 +36,6 @@
Beans is free and open source software, licensed under the GNU General Public License (version 3 or later)
https://github.com/helcel-net/beans
Project repository: %1$s\n Feel free to report issues or contribute.
- Free and open source dependencies and licenses
About the Beans application
Select the group to assign.
Long press on a group to edit its name and color.
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index 494a7ad..45f1061 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -1,6 +1,6 @@
-
\ No newline at end of file