Skip to content

Commit

Permalink
* Fix nullability of metadata in application level manifest.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bojan committed Apr 7, 2023
1 parent 873753c commit c0d2175
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

## Version 1.1.0

_2023-04-07_

* Fix nullability of metadata in application level manifest.

## Version 1.0.9

_2023-03-21_
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ Then add the following dependencies in your app `build.gradle` or `build.gradle.

**Groovy**
```groovy
implementation "com.infinum.localian:localian:1.0.9"
implementation "com.infinum.localian:localian:1.1.0"
```
**KotlinDSL**
```kotlin
implementation("com.infinum.localian:localian:1.0.9")
implementation("com.infinum.localian:localian:1.1.0")
```

## Setup
Expand Down
6 changes: 3 additions & 3 deletions config.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ext {
def major = 1
def minor = 0
def patch = 9
def minor = 1
def patch = 0

buildConfig = [
"minSdk" : 21,
"compileSdk": 33,
"targetSdk" : 33,
"buildTools": "33.0.0"
"buildTools": "33.0.2"
]
releaseConfig = [
"group" : "com.infinum.localian",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ private const val KEY_FOLLOW_SYSTEM_LOCALE: String =

internal fun Context.languageTagMetadata(): String? =
info.metaData
.getString(KEY_INITIAL_LANGUAGE_TAG, null)
?.getString(KEY_INITIAL_LANGUAGE_TAG, null)
?.takeIf { it.isNotBlank() }

internal fun Context.followSystemLocaleMetadata(): Boolean =
info.metaData
.getBoolean(KEY_FOLLOW_SYSTEM_LOCALE, false)
?.getBoolean(KEY_FOLLOW_SYSTEM_LOCALE, false) ?: false

@Suppress("DEPRECATION")
private val Context.info: ApplicationInfo
Expand Down

0 comments on commit c0d2175

Please sign in to comment.