Skip to content

Commit

Permalink
Bump version to 2.3.0-Beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
alialbaali committed May 24, 2023
1 parent a36f934 commit 227242b
Show file tree
Hide file tree
Showing 27 changed files with 1,700 additions and 415 deletions.
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -88,7 +88,8 @@ Noto is also part of my [portfolio](https://alialbaali.com) projects. It showcas
* Light/Dark/Black/System themes.
* Support for devices with API 21 (Lollipop) and up.
* All data is stored locally on the device.
* Language support for English, Turkish, Arabic, Indonesian, Czech, German, Italian, Spanish, and French.
* Language support for English, Turkish, Arabic, Indonesian, Russian, Czech, German, Italian, Spanish, and French, Lithuanian, SimplifiedChinese, and
Portuguese.
* Material You (Material 3) support.
* Navigating to the top when clicking on the top app bar.

Expand Down Expand Up @@ -120,6 +121,7 @@ Noto is also part of my [portfolio](https://alialbaali.com) projects. It showcas
* All notes view with search functionality.
* Recently accessed notes view with search functionality.
* Saving selected text by using Quick note option. Default folder is General, can be overridden in Settings.
* Find in Note, and automatic scrolling to the searched text in notes.

### Labels

Expand Down Expand Up @@ -187,6 +189,8 @@ Noto is also part of my [portfolio](https://alialbaali.com) projects. It showcas
- <a href="https://steamcommunity.com/id/oliverberry">李華</a> for the Simplified Chinese localization.
- Uli N for the German localization.
- <a href="https://angellabs.xyz">Angel C</a>.
- Alexthegib for the Portuguese localization.
- <a href="https://github.com/x-0D">&lt;x0D&gt; Nikita Bragin</a> for the Russian localization.

## Contributions

Expand Down
7 changes: 4 additions & 3 deletions app/build.gradle.kts
Expand Up @@ -4,7 +4,7 @@ plugins {
id(Plugins.AndroidApplication)
kotlin(Plugins.KotlinAndroid)
id(Plugins.NavigationSafeArgs)
kotlin("plugin.serialization") version "1.8.10"
kotlin("plugin.serialization") version "1.8.21"
id("com.google.devtools.ksp") version "1.8.10-1.0.9"
}

Expand Down Expand Up @@ -51,10 +51,11 @@ android {
"in",
"it",
"lt",
// "ru",
"ru",
// "ta",
"tr",
"zh",
"pt",
)
)
}
Expand Down Expand Up @@ -103,7 +104,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
kotlinCompilerExtensionVersion = Versions.Compose
}

testOptions {
Expand Down
9 changes: 3 additions & 6 deletions app/src/main/java/com/noto/app/domain/model/Enums.kt
Expand Up @@ -27,20 +27,17 @@ enum class Font { Nunito, Monospace, }
enum class Grouping { None, CreationDate, Label, AccessDate }

enum class Language {
System, English, Turkish, Arabic, Indonesian,

@Deprecated("Not supported anymore.")
Russian,
System, English, Turkish, Arabic, Indonesian, Russian,

@Deprecated("Not supported anymore.")
Tamil,

Spanish, French, German, Italian, Czech,
Lithuanian, SimplifiedChinese;
Lithuanian, SimplifiedChinese, Portuguese;

companion object {
@Suppress("DEPRECATION")
val Deprecated = listOf(Tamil, Russian)
val Deprecated = listOf(Tamil)
}
}

Expand Down
26 changes: 22 additions & 4 deletions app/src/main/java/com/noto/app/domain/model/Release.kt
Expand Up @@ -21,14 +21,25 @@ sealed interface Release {
val changelogFormatted: String get() = changelog.format()

@Serializable
data class Version(val major: Int, val minor: Int, val patch: Int) {
data class Version(val major: Int, val minor: Int, val patch: Int, val status: Status = Status.Stable) {

companion object {
val Current = Version(2, 2, 3)
val Last = Version(2, 2, 2)
val Current = Version(2, 3, 0, Status.Beta(1))
val Last = Version(2, 2, 3)
}

fun format(): String = "$major.$minor.$patch"
fun format(): String = if (status is Status.Beta) "$major.$minor.$patch-${status.format()}" else "$major.$minor.$patch"

@Serializable
sealed interface Status {
@Serializable
data class Beta(val version: Int) : Status {
fun format() = "Beta$version"
}

@Serializable
object Stable : Status
}
}

@JvmInline
Expand Down Expand Up @@ -142,4 +153,11 @@ data class Release_2_2_2(override val changelog: Changelog) : Release {
data class Release_2_2_3(override val changelog: Changelog) : Release {
override val version: Version = Version(2, 2, 3)
override val date: LocalDate = LocalDate(2023, Month.APRIL, 29)
}

@Suppress("ClassName")
@Serializable
data class Release_2_3_0(override val changelog: Changelog) : Release {
override val version: Version = Version(2, 3, 0, Version.Status.Beta(1))
override val date: LocalDate = LocalDate(2023, Month.MAY, 24)
}
2 changes: 2 additions & 0 deletions app/src/main/java/com/noto/app/util/ModelUtils.kt
Expand Up @@ -306,6 +306,7 @@ fun Language.toLocale(): Locale = when (this) {
Language.Czech -> Locale("cs")
Language.Lithuanian -> Locale("lt")
Language.SimplifiedChinese -> Locale("zh")
Language.Portuguese -> Locale("pt")
}

fun List<Language>.toLocalListCompat(): LocaleListCompat {
Expand Down Expand Up @@ -333,6 +334,7 @@ fun LocaleListCompat.toLanguages(): List<Language> {
tag.startsWith("cs", ignoreCase = true) -> Language.Czech
tag.startsWith("lt", ignoreCase = true) -> Language.Lithuanian
tag.startsWith("zh", ignoreCase = true) -> Language.SimplifiedChinese
tag.startsWith("pt", ignoreCase = true) -> Language.Portuguese
else -> Language.System
}
}
Expand Down
21 changes: 19 additions & 2 deletions app/src/main/java/com/noto/app/util/ReleaseUtils.kt
Expand Up @@ -10,17 +10,34 @@ fun Release.toJson(): String = NotoDefaultJson.encodeToString(this)
fun String.toRelease(): Release = NotoDefaultJson.decodeFromString(this)

fun Release.Companion.Current(context: Context): Release {
return Release_2_2_3(
return Release_2_3_0(
Release.Changelog(
listOf(
context.stringResource(R.string.release_2_2_3),
context.stringResource(R.string.release_2_3_0_new_languages),
context.stringResource(R.string.release_2_3_0_reminder),
context.stringResource(R.string.release_2_3_0_selection),
context.stringResource(R.string.release_2_3_0_find_in_note),
context.stringResource(R.string.release_2_3_0_archive),
context.stringResource(R.string.release_2_3_0_sorting),
context.stringResource(R.string.release_2_3_0_reading_mode),
context.stringResource(R.string.release_2_3_0_whats_new),
context.stringResource(R.string.release_2_3_0_report_issues),
context.stringResource(R.string.release_2_3_0_quick_note),
context.stringResource(R.string.release_2_3_0_bug_fixes),
)
)
)
}

fun Release.Companion.Previous(context: Context): List<Release> {
return listOf(
Release_2_2_3(
Release.Changelog(
listOf(
context.stringResource(R.string.release_2_2_3),
)
)
),
Release_2_2_2(
Release.Changelog(
listOf(
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/noto/app/util/ResourceUtils.kt
Expand Up @@ -108,6 +108,7 @@ fun Language.toResource(): Int = when (this) {
Language.Czech -> R.string.czech
Language.Lithuanian -> R.string.lithuanian
Language.SimplifiedChinese -> R.string.simplified_chinese
Language.Portuguese -> R.string.portuguese
}

fun ScreenBrightnessLevel.toResource(): Int = when (this) {
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/java/com/noto/app/util/TranslationsUtils.kt
Expand Up @@ -75,6 +75,20 @@ val Translation.Companion.Default
Translator(R.string.german_translator, null),
),
),
Translation(
language = Language.Portuguese,
iconId = R.drawable.ic_portugal,
translators = listOf(
Translator(R.string.portuguese_translator, null),
),
),
Translation(
language = Language.Russian,
iconId = R.drawable.ic_russia,
translators = listOf(
Translator(R.string.russian_translator, R.string.russian_translator_url),
),
),
)

fun Translation.Companion.Comparator(context: Context): Comparator<Translation> {
Expand Down

0 comments on commit 227242b

Please sign in to comment.