Skip to content

Commit

Permalink
Merge pull request #47 from aeri/wip
Browse files Browse the repository at this point in the history
add: new light theme and dark theme optimized for OLED displays
  • Loading branch information
NAVAL authored May 21, 2024
2 parents 0df2e35 + 62fa35f commit 3d3e951
Show file tree
Hide file tree
Showing 26 changed files with 448 additions and 468 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ To recognize the Kana syllabary without difficulty is a costly task. While there
<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Logo" width=200
</a>

## Built With

* [Flutter](https://flutter.dev/) - SDK
* [Android Studio](https://developer.android.com/studio) - IDE

## Author

* **Aeri** - *Project Nihonoari* - [aeri](https://github.com/aeri)
Expand Down
28 changes: 10 additions & 18 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,11 +22,6 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
Expand All @@ -47,16 +43,16 @@ android {
main.java.srcDirs += 'src/main/kotlin'
}

compileSdkVersion 33
compileSdkVersion 34

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
applicationId "com.LAPARCELA.nihonoari"
minSdkVersion 16
targetSdkVersion 33
minSdkVersion flutter.minSdkVersion
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down Expand Up @@ -84,8 +80,4 @@ android {

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
}
Binary file removed android/app/src/main/ic_launcher-web.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public final class GeneratedPluginRegistrant {
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
} catch(Exception e) {
} catch (Exception e) {
Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">

</vector>
7 changes: 7 additions & 0 deletions android/app/src/main/res/drawable-night/launch_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/black" />

<!-- You can insert your own image assets here -->
</layer-list>
67 changes: 1 addition & 66 deletions android/app/src/main/res/drawable/ic_launcher_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,70 +5,5 @@
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>

</vector>
2 changes: 1 addition & 1 deletion android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/darker_gray" />
<item android:drawable="@android:color/white" />

<!-- You can insert your own image assets here -->
</layer-list>
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
Expand Down
Binary file removed android/app/src/main/splash.png
Binary file not shown.
16 changes: 1 addition & 15 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
buildscript {
ext.kotlin_version = '1.6.10'

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
Expand All @@ -25,6 +11,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.2.1" apply false
id "org.jetbrains.kotlin.android" version "1.6.10" apply false
}

include ":app"
1 change: 1 addition & 0 deletions fastlane/metadata/android/de/changelogs/13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Neues helles Thema und dunkles Thema hinzugefügt, das für OLED-Displays optimiert ist
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Added a new light theme and dark theme optimized for OLED displays
1 change: 1 addition & 0 deletions fastlane/metadata/android/es/changelogs/13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Se añade un nuevo tema claro y se optimiza el tema oscuro para pantallas OLED
1 change: 1 addition & 0 deletions fastlane/metadata/android/fr/changelogs/13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Ajout d'un nouveau thème clair et d'un thème foncé optimisé pour les écrans OLED
3 changes: 1 addition & 2 deletions lib/Models/GlobalKanas.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:nihonoari/Models/Transliteration.dart';


class GlobalKanas {
static Map<String, List<Transliteration>> hiraganaMap = {};
static Map<String, List<Transliteration>> katakanaMap = {};
}
}
18 changes: 18 additions & 0 deletions lib/Models/KanaList.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
Copyright (C) 2020 Naval Alcalá
This file is part of Nihonoari.
Nihonoari is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Nihonoari is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Nihonoari. If not, see <https://www.gnu.org/licenses/>.
*/
class KanaList {
static Map hiragana = {
"あ い う え お" : [
Expand Down
59 changes: 45 additions & 14 deletions lib/Models/Transliteration.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
// To parse this JSON data, do
//
// final kanas = kanasFromJson(jsonString);
/*
Copyright (C) 2020 Naval Alcalá
This file is part of Nihonoari.
Nihonoari is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Nihonoari is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Nihonoari. If not, see <https://www.gnu.org/licenses/>.
*/

import 'dart:convert';

Map<String, List<Transliteration>> kanasFromJson(String str) => Map.from(json.decode(str)).map((k, v) => MapEntry<String, List<Transliteration>>(k, List<Transliteration>.from(v.map((x) => Transliteration.fromJson(x)))));
Map<String, List<Transliteration>> kanasFromJson(String str) => Map.from(
json.decode(str))
.map((k, v) => MapEntry<String, List<Transliteration>>(k,
List<Transliteration>.from(v.map((x) => Transliteration.fromJson(x)))));

String kanasToJson(Map<String, List<Transliteration>> data) => json.encode(Map.from(data).map((k, v) => MapEntry<String, dynamic>(k, List<dynamic>.from(v.map((x) => x.toJson())))));
String kanasToJson(Map<String, List<Transliteration>> data) =>
json.encode(Map.from(data).map((k, v) => MapEntry<String, dynamic>(
k, List<dynamic>.from(v.map((x) => x.toJson())))));

class Transliteration {
Transliteration({
Expand All @@ -17,18 +37,29 @@ class Transliteration {
System? system;
String? value;

factory Transliteration.fromJson(Map<String, dynamic> json) => Transliteration(
system: systemValues.map[json["system"]],
value: json["value"],
);
factory Transliteration.fromJson(Map<String, dynamic> json) =>
Transliteration(
system: systemValues.map[json["system"]],
value: json["value"],
);

Map<String, dynamic> toJson() => {
"system": systemValues.reverse[system],
"value": value,
};
"system": systemValues.reverse[system],
"value": value,
};
}

enum System { Romaji, Bondarenko, Nakazawa, Fedorishyn, Gojuon, Kovalenko, Ruble, DibrovaOdinets, Polivanov }
enum System {
Romaji,
Bondarenko,
Nakazawa,
Fedorishyn,
Gojuon,
Kovalenko,
Ruble,
DibrovaOdinets,
Polivanov
}

final systemValues = EnumValues({
"Бондаренко": System.Bondarenko,
Expand All @@ -49,7 +80,7 @@ class EnumValues<T> {
EnumValues(this.map);

Map<T, String> get reverse {
reverseMap = map.map((k, v) => new MapEntry(v, k));
reverseMap = map.map((k, v) => new MapEntry(v, k));
return reverseMap;
}
}
3 changes: 1 addition & 2 deletions lib/Question.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
along with Nihonoari. If not, see <https://www.gnu.org/licenses/>.
*/

class Question{

class Question {
String question = "";
List<String?> answer = [];
String type = "";
Expand Down
Loading

0 comments on commit 3d3e951

Please sign in to comment.