1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-2239 Membership | Feature | Introduce membership and payments (#1189)

This commit is contained in:
Konstantin Ivanov 2024-05-30 15:05:07 +02:00 committed by GitHub
parent a15a3f22f1
commit 6493728687
Signed by: github
GPG key ID: B5690EEEBB952194
72 changed files with 7540 additions and 2118 deletions

View file

@ -3,11 +3,17 @@ package com.anytypeio.anytype.device
import android.content.Context
import androidx.core.os.ConfigurationCompat
import com.anytypeio.anytype.domain.misc.LocaleProvider
import java.util.Locale
class DefaultLocalProvider(
private val context: Context
): LocaleProvider {
override fun language(): String? {
return ConfigurationCompat.getLocales(context.resources.configuration)[0]?.language
) : LocaleProvider {
private val defaultLocale by lazy {
ConfigurationCompat.getLocales(context.resources.configuration).get(0)
?: Locale.getDefault()
}
override fun language(): String = defaultLocale.language
override fun locale(): Locale = defaultLocale
}