Add an amoled black theme

This commit is contained in:
Bnyro
2023-04-13 18:19:24 +02:00
parent 537628f378
commit 3b28143a4e
11 changed files with 36 additions and 0 deletions

View File

@@ -122,6 +122,7 @@
"followSystem": "System folgen", "followSystem": "System folgen",
"obtainium": "Obtainium", "obtainium": "Obtainium",
"materialYou": "Material You", "materialYou": "Material You",
"useBlackTheme": "Use pure black dark theme",
"appSortBy": "App sortieren nach", "appSortBy": "App sortieren nach",
"authorName": "Autor/Name", "authorName": "Autor/Name",
"nameAuthor": "Name/Autor", "nameAuthor": "Name/Autor",

View File

@@ -122,6 +122,7 @@
"followSystem": "Follow System", "followSystem": "Follow System",
"obtainium": "Obtainium", "obtainium": "Obtainium",
"materialYou": "Material You", "materialYou": "Material You",
"useBlackTheme": "Use pure black dark theme",
"appSortBy": "App Sort By", "appSortBy": "App Sort By",
"authorName": "Author/Name", "authorName": "Author/Name",
"nameAuthor": "Name/Author", "nameAuthor": "Name/Author",

View File

@@ -122,6 +122,7 @@
"followSystem": "هماهنگ با سیستم", "followSystem": "هماهنگ با سیستم",
"obtainium": "Obtainium", "obtainium": "Obtainium",
"materialYou": "Material You", "materialYou": "Material You",
"useBlackTheme": "Use pure black dark theme",
"appSortBy": "مرتب سازی برنامه بر اساس", "appSortBy": "مرتب سازی برنامه بر اساس",
"authorName": "سازنده/اسم", "authorName": "سازنده/اسم",
"nameAuthor": "اسم/سازنده", "nameAuthor": "اسم/سازنده",

View File

@@ -122,6 +122,7 @@
"followSystem": "Suivre le système", "followSystem": "Suivre le système",
"obtainium": "Obtainium", "obtainium": "Obtainium",
"materialYou": "Material You", "materialYou": "Material You",
"useBlackTheme": "Use pure black dark theme",
"appSortBy": "Applications triées par", "appSortBy": "Applications triées par",
"authorName": "Auteur/Nom", "authorName": "Auteur/Nom",
"nameAuthor": "Nom/Auteur", "nameAuthor": "Nom/Auteur",

View File

@@ -122,6 +122,7 @@
"followSystem": "Rendszer szerint", "followSystem": "Rendszer szerint",
"obtainium": "Obtainium", "obtainium": "Obtainium",
"materialYou": "Material You", "materialYou": "Material You",
"useBlackTheme": "Use pure black dark theme",
"appSortBy": "App rendezés...", "appSortBy": "App rendezés...",
"authorName": "Szerző/Név", "authorName": "Szerző/Név",
"nameAuthor": "Név/Szerző", "nameAuthor": "Név/Szerző",

View File

@@ -122,6 +122,7 @@
"followSystem": "Segui sistema", "followSystem": "Segui sistema",
"obtainium": "Obtainium", "obtainium": "Obtainium",
"materialYou": "Material You", "materialYou": "Material You",
"useBlackTheme": "Use pure black dark theme",
"appSortBy": "App ordinate per", "appSortBy": "App ordinate per",
"authorName": "Autore/Nome", "authorName": "Autore/Nome",
"nameAuthor": "Nome/Autore", "nameAuthor": "Nome/Autore",

View File

@@ -122,6 +122,7 @@
"followSystem": "システムに従う", "followSystem": "システムに従う",
"obtainium": "Obtainium", "obtainium": "Obtainium",
"materialYou": "Material You", "materialYou": "Material You",
"useBlackTheme": "Use pure black dark theme",
"appSortBy": "アプリの並び方", "appSortBy": "アプリの並び方",
"authorName": "作者名/アプリ名", "authorName": "作者名/アプリ名",
"nameAuthor": "アプリ名/作者名", "nameAuthor": "アプリ名/作者名",

View File

@@ -123,6 +123,7 @@
"followSystem": "跟随系统", "followSystem": "跟随系统",
"obtainium": "Obtainium", "obtainium": "Obtainium",
"materialYou": "Material You", "materialYou": "Material You",
"useBlackTheme": "Use pure black dark theme",
"appSortBy": "排列方式", "appSortBy": "排列方式",
"authorName": "作者 / 名字", "authorName": "作者 / 名字",
"nameAuthor": "名字 / 作者", "nameAuthor": "名字 / 作者",

View File

@@ -263,6 +263,14 @@ class _ObtainiumState extends State<Obtainium> {
darkColorScheme = ColorScheme.fromSeed( darkColorScheme = ColorScheme.fromSeed(
seedColor: defaultThemeColour, brightness: Brightness.dark); seedColor: defaultThemeColour, brightness: Brightness.dark);
} }
// set the background and surface colors to pure black in the amoled theme
if (settingsProvider.useBlackTheme) {
darkColorScheme = darkColorScheme
.copyWith(background: Colors.black, surface: Colors.black)
.harmonized();
}
return MaterialApp( return MaterialApp(
title: 'Obtainium', title: 'Obtainium',
localizationsDelegates: context.localizationDelegates, localizationsDelegates: context.localizationDelegates,

View File

@@ -224,6 +224,17 @@ class _SettingsPageState extends State<SettingsPage> {
), ),
themeDropdown, themeDropdown,
height16, height16,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(tr('useBlackTheme')),
Switch(
value: settingsProvider.useBlackTheme,
onChanged: (value) {
settingsProvider.useBlackTheme = value;
})
],
),
colourDropdown, colourDropdown,
height16, height16,
Row( Row(

View File

@@ -64,6 +64,15 @@ class SettingsProvider with ChangeNotifier {
notifyListeners(); notifyListeners();
} }
bool get useBlackTheme {
return prefs?.getBool('useBlackTheme') ?? false;
}
set useBlackTheme(bool useBlackTheme) {
prefs?.setBool('useBlackTheme', useBlackTheme);
notifyListeners();
}
int get updateInterval { int get updateInterval {
var min = prefs?.getInt('updateInterval') ?? 360; var min = prefs?.getInt('updateInterval') ?? 360;
if (!updateIntervals.contains(min)) { if (!updateIntervals.contains(min)) {