From 81518f74fa76b6c2274a0e02ad4169f5d7f61e59 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 8 Oct 2018 01:06:44 -0400 Subject: Update translations (#169) * New translations strings_about.xml (Polish) * New translations strings_commons.xml (Hebrew) * New translations strings_commons.xml (Tagalog) * New translations strings_commons.xml (Swedish) * New translations strings_commons.xml (Serbian (Cyrillic)) * New translations strings_commons.xml (Russian) * New translations strings_commons.xml (Romanian) * New translations strings_commons.xml (Portuguese, Brazilian) * New translations strings_commons.xml (Portuguese) * New translations strings_commons.xml (Norwegian) * New translations strings_commons.xml (Korean) * New translations strings_commons.xml (Japanese) * New translations strings_commons.xml (Italian) * New translations strings_commons.xml (Hungarian) * New translations strings_commons.xml (Greek) * New translations strings_commons.xml (German) * New translations strings_commons.xml (Galician) * New translations strings_commons.xml (French) * New translations strings_commons.xml (Finnish) * New translations strings_commons.xml (English) * New translations strings_commons.xml (Dutch) * New translations strings_commons.xml (Czech) * New translations strings_commons.xml (Chinese Traditional) * New translations strings_commons.xml (Chinese Simplified) * New translations strings_commons.xml (Catalan) * New translations strings_commons.xml (Arabic) * New translations strings_commons.xml (Afrikaans) * New translations strings_colorpicker.xml (Ukrainian) * New translations strings_commons.xml (Ukrainian) * New translations strings_mediapicker.xml (Ukrainian) * New translations strings_mediapicker.xml (Tagalog) * New translations strings_mediapicker.xml (Swedish) * New translations strings_mediapicker.xml (Serbian (Cyrillic)) * New translations strings_mediapicker.xml (Russian) * New translations strings_mediapicker.xml (Romanian) * New translations strings_mediapicker.xml (Portuguese, Brazilian) * New translations strings_mediapicker.xml (Portuguese) * New translations strings_mediapicker.xml (Norwegian) * New translations strings_mediapicker.xml (Korean) * New translations strings_mediapicker.xml (Japanese) * New translations strings_mediapicker.xml (Italian) * New translations strings_mediapicker.xml (Hungarian) * New translations strings_commons.xml (Vietnamese) * New translations strings_mediapicker.xml (Hebrew) * New translations strings_mediapicker.xml (Greek) * New translations strings_mediapicker.xml (German) * New translations strings_mediapicker.xml (Galician) * New translations strings_mediapicker.xml (French) * New translations strings_mediapicker.xml (Finnish) * New translations strings_mediapicker.xml (English) * New translations strings_mediapicker.xml (Dutch) * New translations strings_mediapicker.xml (Czech) * New translations strings_mediapicker.xml (Chinese Traditional) * New translations strings_mediapicker.xml (Chinese Simplified) * New translations strings_mediapicker.xml (Catalan) * New translations strings_mediapicker.xml (Arabic) * New translations strings_mediapicker.xml (Afrikaans) * New translations strings_colorpicker.xml (Tagalog) * New translations strings_mediapicker.xml (Polish) * New translations strings_about.xml (English) * New translations strings_about.xml (Portuguese, Brazilian) * New translations strings_about.xml (Portuguese) * New translations strings_about.xml (Norwegian) * New translations strings_about.xml (Korean) * New translations strings_about.xml (Japanese) * New translations strings_about.xml (Italian) * New translations strings_about.xml (Hungarian) * New translations strings_about.xml (Hebrew) * New translations strings_about.xml (Greek) * New translations strings_about.xml (German) * New translations strings_about.xml (Galician) * New translations strings_about.xml (French) * New translations strings_about.xml (Finnish) * New translations strings_about.xml (Dutch) * New translations strings_about.xml (Russian) * New translations strings_about.xml (Czech) * New translations strings_about.xml (Chinese Simplified) * New translations strings_about.xml (Catalan) * New translations strings_about.xml (Arabic) * New translations strings_about.xml (Afrikaans) * New translations strings_mediapicker.xml (Danish) * New translations strings_commons.xml (Danish) * New translations strings_colorpicker.xml (Danish) * New translations strings_about.xml (Danish) * New translations strings_mediapicker.xml (Spanish) * New translations strings_commons.xml (Spanish) * New translations strings_about.xml (Spanish) * New translations strings_about.xml (Chinese Traditional) * New translations strings_about.xml (Romanian) * New translations strings_about.xml (Serbian (Cyrillic)) * New translations strings_colorpicker.xml (Swedish) * New translations strings_colorpicker.xml (Serbian (Cyrillic)) * New translations strings_colorpicker.xml (Russian) * New translations strings_colorpicker.xml (Romanian) * New translations strings_colorpicker.xml (Portuguese) * New translations strings_colorpicker.xml (Japanese) * New translations strings_colorpicker.xml (Hebrew) * New translations strings_colorpicker.xml (Greek) * New translations strings_about.xml (Swedish) * New translations strings_colorpicker.xml (Arabic) * New translations strings_about.xml (Tagalog) * New translations strings_about.xml (Ukrainian) * New translations strings_about.xml (Vietnamese) * New translations strings_colorpicker.xml (Afrikaans) * New translations strings_colorpicker.xml (Catalan) * New translations strings_colorpicker.xml (Chinese Traditional) * New translations strings_colorpicker.xml (Czech) * New translations strings_colorpicker.xml (Dutch) * New translations strings_colorpicker.xml (English) * New translations strings_colorpicker.xml (Finnish) * New translations strings_mediapicker.xml (Vietnamese) * New translations strings_commons.xml (Danish) * New translations strings_about.xml (Swedish) * New translations strings_about.xml (Ukrainian) * New translations strings_colorpicker.xml (Swedish) * New translations strings_colorpicker.xml (Ukrainian) * New translations strings_commons.xml (Swedish) * New translations strings_commons.xml (Ukrainian) * New translations strings_mediapicker.xml (Swedish) * New translations strings_mediapicker.xml (Ukrainian) * Delete empty files * Optimize all source files --- .../kotlin/ca/allanwang/kau/xml/FaqTest.kt | 1 - .../ca/allanwang/kau/kotlin/LazyResettable.kt | 6 +- .../main/kotlin/ca/allanwang/kau/kotlin/Utils.kt | 2 +- .../kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt | 6 +- .../ca/allanwang/kau/kpref/KPrefSingleDelegate.kt | 3 +- .../allanwang/kau/permissions/PermissionManager.kt | 9 +- .../ca/allanwang/kau/permissions/Permissions.kt | 6 +- .../ca/allanwang/kau/swipe/SwipeBackHelper.kt | 3 +- .../kotlin/ca/allanwang/kau/swipe/SwipeBackPage.kt | 3 +- .../kotlin/ca/allanwang/kau/utils/ColorUtils.kt | 12 +- .../kotlin/ca/allanwang/kau/utils/FileUtils.kt | 3 +- .../kotlin/ca/allanwang/kau/utils/FontUtils.kt | 3 +- .../ca/allanwang/kau/utils/NotificationUtils.kt | 3 +- .../kotlin/ca/allanwang/kau/utils/ViewUtils.kt | 51 +++++--- core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt | 3 +- .../res-public/values-da-rDK/strings_commons.xml | 69 +++++++++++ .../res-public/values-in-rID/strings_commons.xml | 122 ++++++++++--------- .../res-public/values-pl-rPL/strings_commons.xml | 98 ++++++++-------- .../res-public/values-sv-rSE/strings_commons.xml | 69 +++++++++++ .../res-public/values-th-rTH/strings_commons.xml | 122 ++++++++++--------- .../res-public/values-tr-rTR/strings_commons.xml | 130 ++++++++++----------- .../res-public/values-uk-rUA/strings_commons.xml | 53 +++++++++ core/src/main/res-public/values/public.xml | 2 +- 23 files changed, 489 insertions(+), 290 deletions(-) create mode 100644 core/src/main/res-public/values-da-rDK/strings_commons.xml create mode 100644 core/src/main/res-public/values-sv-rSE/strings_commons.xml create mode 100644 core/src/main/res-public/values-uk-rUA/strings_commons.xml (limited to 'core') diff --git a/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt b/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt index b396985..f9ce24b 100644 --- a/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt +++ b/core/src/androidTest/kotlin/ca/allanwang/kau/xml/FaqTest.kt @@ -3,7 +3,6 @@ package ca.allanwang.kau.xml import android.support.test.InstrumentationRegistry import android.support.test.filters.MediumTest import android.support.test.runner.AndroidJUnit4 -import ca.allanwang.kau.test.R import org.junit.Test import org.junit.runner.RunWith import kotlin.test.assertEquals diff --git a/core/src/main/kotlin/ca/allanwang/kau/kotlin/LazyResettable.kt b/core/src/main/kotlin/ca/allanwang/kau/kotlin/LazyResettable.kt index ceeaa30..979f7a7 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/kotlin/LazyResettable.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/kotlin/LazyResettable.kt @@ -14,7 +14,8 @@ internal object UNINITIALIZED fun lazyResettable(initializer: () -> T): LazyResettable = LazyResettable(initializer) class LazyResettable(private val initializer: () -> T, lock: Any? = null) : ILazyResettable, Serializable { - @Volatile private var _value: Any = UNINITIALIZED + @Volatile + private var _value: Any = UNINITIALIZED private val lock = lock ?: this override fun invalidate() { @@ -69,8 +70,7 @@ class LazyResettableRegistry : ILazyResettableRegistry { var lazyRegistry: MutableList> = mutableListOf() - override fun lazy(initializer: () -> T): LazyResettable - = add(lazyResettable(initializer)) + override fun lazy(initializer: () -> T): LazyResettable = add(lazyResettable(initializer)) override fun add(resettable: LazyResettable): LazyResettable { lazyRegistry.add(resettable) diff --git a/core/src/main/kotlin/ca/allanwang/kau/kotlin/Utils.kt b/core/src/main/kotlin/ca/allanwang/kau/kotlin/Utils.kt index db28914..1ba1de6 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/kotlin/Utils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/kotlin/Utils.kt @@ -3,4 +3,4 @@ package ca.allanwang.kau.kotlin /** * Created by Allan Wang on 07/04/18. */ -inline fun javaClass(): Class = T::class.java \ No newline at end of file +inline fun javaClass(): Class = T::class.java \ No newline at end of file diff --git a/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt b/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt index 33ba807..60d03ad 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefDelegate.kt @@ -26,7 +26,8 @@ class KPrefDelegate internal constructor( private object UNINITIALIZED - @Volatile private var _value: Any = UNINITIALIZED + @Volatile + private var _value: Any = UNINITIALIZED private val lock = lock ?: this init { @@ -89,5 +90,6 @@ class KPrefDelegate internal constructor( } class KPrefException(message: String) : IllegalAccessException(message) { - constructor(element: Any?) : this("Invalid type in pref cache: ${element?.javaClass?.simpleName ?: "null"}") + constructor(element: Any?) : this("Invalid type in pref cache: ${element?.javaClass?.simpleName + ?: "null"}") } \ No newline at end of file diff --git a/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefSingleDelegate.kt b/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefSingleDelegate.kt index 6525305..ed30a44 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefSingleDelegate.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefSingleDelegate.kt @@ -14,7 +14,8 @@ fun KPref.kprefSingle(key: String) = KPrefSingleDelegate(key, this) */ class KPrefSingleDelegate internal constructor(private val key: String, private val pref: KPref, lock: Any? = null) : ILazyResettable { - @Volatile private var _value: Boolean? = null + @Volatile + private var _value: Boolean? = null private val lock = lock ?: this init { diff --git a/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt b/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt index 3b15e0b..36456ec 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt @@ -29,7 +29,8 @@ internal object PermissionManager { */ private val manifestPermission = lazyContext> { try { - it.packageManager.getPackageInfo(it.packageName, PackageManager.GET_PERMISSIONS)?.requestedPermissions ?: emptyArray() + it.packageManager.getPackageInfo(it.packageName, PackageManager.GET_PERMISSIONS)?.requestedPermissions + ?: emptyArray() } catch (e: Exception) { emptyArray() } @@ -47,7 +48,8 @@ internal object PermissionManager { } else KL.d { "Request is postponed since another one is still in progress; did you remember to override onRequestPermissionsResult?" } } - @Synchronized private fun requestPermissions(context: Context, permissions: Array) { + @Synchronized + private fun requestPermissions(context: Context, permissions: Array) { permissions.forEach { if (!manifestPermission(context).contains(it)) { KL.e { "Requested permission $it is not stated in the manifest" } @@ -55,7 +57,8 @@ internal object PermissionManager { //we'll let the request pass through so it can be denied and so the callback can be triggered } } - val activity = (context as? Activity) ?: throw KauException("Context is not an instance of an activity; cannot request permissions") + val activity = (context as? Activity) + ?: throw KauException("Context is not an instance of an activity; cannot request permissions") KL.i { "Requesting permissions ${permissions.contentToString()}" } ActivityCompat.requestPermissions(activity, permissions, 1) } diff --git a/core/src/main/kotlin/ca/allanwang/kau/permissions/Permissions.kt b/core/src/main/kotlin/ca/allanwang/kau/permissions/Permissions.kt index 4de6695..248e484 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/permissions/Permissions.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/permissions/Permissions.kt @@ -22,8 +22,7 @@ import android.support.annotation.RequiresApi /** * Hook that should be added inside all [Activity.onRequestPermissionsResult] so that the Permission manager can handle the responses */ -fun Activity.kauOnRequestPermissionsResult(permissions: Array, grantResults: IntArray) - = PermissionManager.onRequestPermissionsResult(this, permissions, grantResults) +fun Activity.kauOnRequestPermissionsResult(permissions: Array, grantResults: IntArray) = PermissionManager.onRequestPermissionsResult(this, permissions, grantResults) /** * Request a permission with a callback @@ -32,8 +31,7 @@ fun Activity.kauOnRequestPermissionsResult(permissions: Array, grant * The [callback] returns [granted], which is true if all permissions are granted * [deniedPerm] is the first denied permission, if granted is false */ -fun Context.kauRequestPermissions(vararg permissions: String, callback: (granted: Boolean, deniedPerm: String?) -> Unit) - = PermissionManager(this, permissions, callback) +fun Context.kauRequestPermissions(vararg permissions: String, callback: (granted: Boolean, deniedPerm: String?) -> Unit) = PermissionManager(this, permissions, callback) /** * See http://developer.android.com/guide/topics/security/permissions.html#normal-dangerous for a diff --git a/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackHelper.kt b/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackHelper.kt index 41cd2e0..018d7c7 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackHelper.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackHelper.kt @@ -16,8 +16,7 @@ internal object SwipeBackHelper { private val pageStack = Stack() - private operator fun get(activity: Activity): SwipeBackPage? - = pageStack.firstOrNull { it.activityRef.get() === activity } + private operator fun get(activity: Activity): SwipeBackPage? = pageStack.firstOrNull { it.activityRef.get() === activity } fun onCreate(activity: Activity, builder: SwipeBackContract.() -> Unit = {}) { val page = this[activity] ?: pageStack.push(SwipeBackPage(activity).apply { builder() }) diff --git a/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackPage.kt b/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackPage.kt index 7b6654d..4dba622 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackPage.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackPage.kt @@ -40,7 +40,8 @@ internal class SwipeBackPage(activity: Activity) : SwipeBackContractInternal by } private fun handleLayout() { - val activity = activityRef.get() ?: return KL.v { "KauSwipe activity ref gone during handleLayout" } + val activity = activityRef.get() + ?: return KL.v { "KauSwipe activity ref gone during handleLayout" } if (swipeEnabled) swipeBackLayout.attachToActivity(activity) else swipeBackLayout.removeFromActivity(activity) } diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt index d0e1f8f..236f2ca 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt @@ -94,12 +94,10 @@ fun Int.blendWith(@ColorInt color: Int, @FloatRange(from = 0.0, to = 1.0) ratio: } @ColorInt -fun Int.withAlpha(@IntRange(from = 0L, to = 255L) alpha: Int): Int - = Color.argb(alpha, Color.red(this), Color.green(this), Color.blue(this)) +fun Int.withAlpha(@IntRange(from = 0L, to = 255L) alpha: Int): Int = Color.argb(alpha, Color.red(this), Color.green(this), Color.blue(this)) @ColorInt -fun Int.withMinAlpha(@IntRange(from = 0L, to = 255L) alpha: Int): Int - = Color.argb(Math.max(alpha, Color.alpha(this)), Color.red(this), Color.green(this), Color.blue(this)) +fun Int.withMinAlpha(@IntRange(from = 0L, to = 255L) alpha: Int): Int = Color.argb(Math.max(alpha, Color.alpha(this)), Color.red(this), Color.green(this), Color.blue(this)) @ColorInt fun Int.lighten(@FloatRange(from = 0.0, to = 1.0) factor: Float = 0.1f): Int { @@ -116,12 +114,10 @@ fun Int.darken(@FloatRange(from = 0.0, to = 1.0) factor: Float = 0.1f): Int { } @ColorInt -fun Int.colorToBackground(@FloatRange(from = 0.0, to = 1.0) factor: Float = 0.1f): Int - = if (isColorDark) darken(factor) else lighten(factor) +fun Int.colorToBackground(@FloatRange(from = 0.0, to = 1.0) factor: Float = 0.1f): Int = if (isColorDark) darken(factor) else lighten(factor) @ColorInt -fun Int.colorToForeground(@FloatRange(from = 0.0, to = 1.0) factor: Float = 0.1f): Int - = if (isColorDark) lighten(factor) else darken(factor) +fun Int.colorToForeground(@FloatRange(from = 0.0, to = 1.0) factor: Float = 0.1f): Int = if (isColorDark) lighten(factor) else darken(factor) @Throws(IllegalArgumentException::class) fun String.toColor(): Int { diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/FileUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/FileUtils.kt index b97f4aa..bfbc009 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/FileUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/FileUtils.kt @@ -6,5 +6,4 @@ import java.io.InputStream /** * Created by Allan Wang on 2017-08-04. */ -fun File.copyFromInputStream(inputStream: InputStream) - = inputStream.use { input -> outputStream().use { output -> input.copyTo(output) } } \ No newline at end of file +fun File.copyFromInputStream(inputStream: InputStream) = inputStream.use { input -> outputStream().use { output -> input.copyTo(output) } } \ No newline at end of file diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/FontUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/FontUtils.kt index 05073c7..1db7694 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/FontUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/FontUtils.kt @@ -17,7 +17,8 @@ object FontUtils { context.applicationContext.assets, "fonts/$font.ttf") sTypefaceCache.put(font, tf) } - return sTypefaceCache.get(font) ?: throw IllegalArgumentException("Font error; typeface does not exist at assets/fonts$font.ttf") + return sTypefaceCache.get(font) + ?: throw IllegalArgumentException("Font error; typeface does not exist at assets/fonts$font.ttf") } } diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/NotificationUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/NotificationUtils.kt index 23a8370..1eb0076 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/NotificationUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/NotificationUtils.kt @@ -7,5 +7,4 @@ import android.support.v4.app.NotificationManagerCompat /** * Created by Allan Wang on 2017-08-04. */ -fun Context.cancelNotification(notifId: Int) - = NotificationManagerCompat.from(this).cancel(notifId) \ No newline at end of file +fun Context.cancelNotification(notifId: Int) = NotificationManagerCompat.from(this).cancel(notifId) \ No newline at end of file diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt index 9a1e9b0..4e020bc 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ViewUtils.kt @@ -23,7 +23,6 @@ import android.view.ViewGroup import android.view.inputmethod.InputMethodManager import android.widget.EditText import android.widget.ImageView -import android.widget.TextView import ca.allanwang.kau.ui.createSimpleRippleDrawable import com.mikepenz.iconics.IconicsDrawable import com.mikepenz.iconics.typeface.IIcon @@ -33,34 +32,47 @@ import com.mikepenz.iconics.typeface.IIcon * Created by Allan Wang on 2017-05-31. */ -@KauUtils inline fun T.visible(): T { +@KauUtils +inline fun T.visible(): T { visibility = View.VISIBLE return this } -@KauUtils inline fun T.invisible(): T { +@KauUtils +inline fun T.invisible(): T { visibility = View.INVISIBLE return this } -@KauUtils inline fun T.gone(): T { +@KauUtils +inline fun T.gone(): T { visibility = View.GONE return this } -@KauUtils inline fun T.invisibleIf(invisible: Boolean): T = if (invisible) invisible() else visible() +@KauUtils +inline fun T.invisibleIf(invisible: Boolean): T = if (invisible) invisible() else visible() -@KauUtils inline fun T.visibleIf(visible: Boolean): T = if (visible) visible() else gone() +@KauUtils +inline fun T.visibleIf(visible: Boolean): T = if (visible) visible() else gone() -@KauUtils inline fun T.goneIf(gone: Boolean): T = visibleIf(!gone) +@KauUtils +inline fun T.goneIf(gone: Boolean): T = visibleIf(!gone) -@KauUtils inline val View.isVisible: Boolean get() = visibility == View.VISIBLE +@KauUtils +inline val View.isVisible: Boolean + get() = visibility == View.VISIBLE -@KauUtils inline val View.isInvisible: Boolean get() = visibility == View.INVISIBLE +@KauUtils +inline val View.isInvisible: Boolean + get() = visibility == View.INVISIBLE -@KauUtils inline val View.isGone: Boolean get() = visibility == View.GONE +@KauUtils +inline val View.isGone: Boolean + get() = visibility == View.GONE -@KauUtils inline fun View.setBackgroundColorRes(@ColorRes color: Int) = setBackgroundColor(context.color(color)) +@KauUtils +inline fun View.setBackgroundColorRes(@ColorRes color: Int) = setBackgroundColor(context.color(color)) fun View.snackbar(text: String, duration: Int = Snackbar.LENGTH_LONG, builder: Snackbar.() -> Unit = {}): Snackbar { val snackbar = Snackbar.make(this, text, duration) @@ -69,8 +81,7 @@ fun View.snackbar(text: String, duration: Int = Snackbar.LENGTH_LONG, builder: S return snackbar } -fun View.snackbar(@StringRes textId: Int, duration: Int = Snackbar.LENGTH_LONG, builder: Snackbar.() -> Unit = {}) - = snackbar(context.string(textId), duration, builder) +fun View.snackbar(@StringRes textId: Int, duration: Int = Snackbar.LENGTH_LONG, builder: Snackbar.() -> Unit = {}) = snackbar(context.string(textId), duration, builder) @KauUtils fun ImageView.setIcon(icon: IIcon?, sizeDp: Int = 24, @ColorInt color: Int = Color.WHITE, builder: IconicsDrawable.() -> Unit = {}) { @@ -78,7 +89,9 @@ fun ImageView.setIcon(icon: IIcon?, sizeDp: Int = 24, @ColorInt color: Int = Col setImageDrawable(icon.toDrawable(context, sizeDp = sizeDp, color = color, builder = builder)) } -@KauUtils inline val FloatingActionButton.isHidden get() = !isShown +@KauUtils +inline val FloatingActionButton.isHidden + get() = !isShown fun FloatingActionButton.showIf(show: Boolean) = if (show) show() else hide() @@ -133,7 +146,8 @@ fun View.setMargin(margin: Int) = setMargins(margin, KAU_ALL) * Base margin setter * returns true if setting is successful, false otherwise */ -@KauUtils private fun View.setMargins(margin: Int, flag: Int): Boolean { +@KauUtils +private fun View.setMargins(margin: Int, flag: Int): Boolean { val p = (layoutParams as? ViewGroup.MarginLayoutParams) ?: return false p.setMargins( if (flag and KAU_LEFT > 0) margin else p.leftMargin, @@ -189,7 +203,8 @@ fun View.setPadding(padding: Int) = setPadding(padding, KAU_ALL) /** * Base padding setter */ -@KauUtils private fun View.setPadding(padding: Int, flag: Int) { +@KauUtils +private fun View.setPadding(padding: Int, flag: Int) { setPadding( if (flag and KAU_LEFT > 0) padding else paddingLeft, if (flag and KAU_TOP > 0) padding else paddingTop, @@ -217,7 +232,9 @@ fun View.setRippleBackground(@ColorInt foregroundColor: Int, @ColorInt backgroun background = createSimpleRippleDrawable(foregroundColor, backgroundColor) } -@KauUtils inline val View.parentViewGroup: ViewGroup get() = parent as ViewGroup +@KauUtils +inline val View.parentViewGroup: ViewGroup + get() = parent as ViewGroup inline val EditText.value: String get() = text.toString().trim() diff --git a/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt b/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt index f804b70..7caf5d6 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/xml/FAQ.kt @@ -47,7 +47,8 @@ fun Context.kauParseFaq( } 1 -> { items.add(FaqItem(items.size + 1, - question ?: throw IllegalArgumentException("KAU FAQ answer found without a question"), + question + ?: throw IllegalArgumentException("KAU FAQ answer found without a question"), Html.fromHtml(parser.text.replace("\n", if (parseNewLine) "
" else "")))) question = null flag = -1 diff --git a/core/src/main/res-public/values-da-rDK/strings_commons.xml b/core/src/main/res-public/values-da-rDK/strings_commons.xml new file mode 100644 index 0000000..5be1277 --- /dev/null +++ b/core/src/main/res-public/values-da-rDK/strings_commons.xml @@ -0,0 +1,69 @@ + + + Om app + Om %s + Tilføj konto + Tilbage + Annuller + Ændringslog + Luk + Kontakt os + Kopier + Tilpasset + Mørk + Standard + Vis ikke igen + Færdig + Fejl + Afslut + Er du sikker på, at du vil afslutte? + Er du sikker på, at du vil afslutte %s? + Glas + Forstået + Fantastisk + Skjul + Lys + Log på + Log af + Er du sikker på, at du vil logge %s af? + Administrér konto + Måske + Menu + Nej + Ingen resultater fundet + Ingen + OK + Play Butik + Bedøm + Rapportér en fejl + Søg + Send feedback + Send med + Indstillinger + Del + Tekst kopieret til udklipsholder. + Tak + Åh nej + Advarsel + + %d dag + %d dage + + + %d time + %d timer + + + %d minut + %d minutter + + + %d sekund + %d sekunder + + Ja + Adgang nægtet + diff --git a/core/src/main/res-public/values-in-rID/strings_commons.xml b/core/src/main/res-public/values-in-rID/strings_commons.xml index dc8d46a..b734377 100644 --- a/core/src/main/res-public/values-in-rID/strings_commons.xml +++ b/core/src/main/res-public/values-in-rID/strings_commons.xml @@ -1,67 +1,65 @@ - - - - Tentang Aplikasi - Tentang %s - Tambahkan Akun - Kembali - Batal - Log perubahan - Tutup - Hubungi Kami - Salin - Adat - Gelap - Standar - Jangan tampilkan lagi - Selesai - Kesalahan - Keluar - Anda yakin ingin keluar? - Anda yakin ingin keluar %s? - Kaca - Mengerti - Hebat - Sembunyikan - Terang - Masuk - Keluar - Anda yakin ingin keluar sebagai %s? - Kelola Akun - Mungkin - Menu - Tidak - Tidak ada hasil yang ditemukan - Tidak ada - Oke - Play Store - Menilai - Laporkan bug - Pencarian - Kirim Umpan balik - Kirim melalui - Pengaturan - Bagikan - Salin teks ke papan tulis. - Terima Kasih - Uh Oh - Peringatan - - %d hari - - - %d jam - - - %d menit - - - %d detik - - Iya - Izin ditolak + Tentang Aplikasi + Tentang %s + Tambahkan Akun + Kembali + Batal + Log perubahan + Tutup + Hubungi Kami + Salin + Adat + Gelap + Standar + Jangan tampilkan lagi + Selesai + Kesalahan + Keluar + Anda yakin ingin keluar? + Anda yakin ingin keluar %s? + Kaca + Mengerti + Hebat + Sembunyikan + Terang + Masuk + Keluar + Anda yakin ingin keluar sebagai %s? + Kelola Akun + Mungkin + Menu + Tidak + Tidak ada hasil yang ditemukan + Tidak ada + Oke + Play Store + Menilai + Laporkan bug + Pencarian + Kirim Umpan balik + Kirim melalui + Pengaturan + Bagikan + Salin teks ke papan tulis. + Terima Kasih + Uh Oh + Peringatan + + %d hari + + + %d jam + + + %d menit + + + %d detik + + Iya + Izin ditolak diff --git a/core/src/main/res-public/values-pl-rPL/strings_commons.xml b/core/src/main/res-public/values-pl-rPL/strings_commons.xml index caac77f..248e409 100644 --- a/core/src/main/res-public/values-pl-rPL/strings_commons.xml +++ b/core/src/main/res-public/values-pl-rPL/strings_commons.xml @@ -1,55 +1,53 @@ - - - - O aplikacji - O %s - Dodaj konto - Wstecz - Anuluj - Lista zmian - Zamknij - Skontaktuj się z nami - Kopiuj - Własny - Ciemny - Domyślnie - Nie pokazuj ponownie - Gotowe - Błąd - Wyjdź - Czy na pewno chcesz wyjść? - Czy na pewno chcesz wyjść %s? - Szkło - Rozumiem - Świetnie - Ukryj - Jasny - Zaloguj się - Wyloguj się - Czy na pewno chcesz się wylogować jako %s? - Zarządzaj kontem - Może - Menu - Nie - Nie znaleziono wyników - Żadne - OK - Sklep Google Play - Oceń - Zgłoś błąd - Szukaj - Prześlij opinię - Wyślij przez - Ustawienia - Udostępnij - Tekst skopiowano do schowka. - Dziękuję - Uh Oh - Ostrzeżenie - Tak - Odmowa uprawnienia + O aplikacji + O %s + Dodaj konto + Wstecz + Anuluj + Lista zmian + Zamknij + Skontaktuj się z nami + Kopiuj + Własny + Ciemny + Domyślnie + Nie pokazuj ponownie + Gotowe + Błąd + Wyjdź + Czy na pewno chcesz wyjść? + Czy na pewno chcesz wyjść %s? + Szkło + Rozumiem + Świetnie + Ukryj + Jasny + Zaloguj się + Wyloguj się + Czy na pewno chcesz się wylogować jako %s? + Zarządzaj kontem + Może + Menu + Nie + Nie znaleziono wyników + Żadne + OK + Sklep Google Play + Oceń + Zgłoś błąd + Szukaj + Prześlij opinię + Wyślij przez + Ustawienia + Udostępnij + Tekst skopiowano do schowka. + Dziękuję + Uh Oh + Ostrzeżenie + Tak + Odmowa uprawnienia diff --git a/core/src/main/res-public/values-sv-rSE/strings_commons.xml b/core/src/main/res-public/values-sv-rSE/strings_commons.xml new file mode 100644 index 0000000..6cc2bb3 --- /dev/null +++ b/core/src/main/res-public/values-sv-rSE/strings_commons.xml @@ -0,0 +1,69 @@ + + + Om appen + Om %s + Lägg till konto + Tillbaka + Avbryt + Uppdateringslog + Stäng + Kontakta oss + Kopiera + Anpassa + Mörk + Standard + Visa inte igen + Klar + Fel + Avsluta + Är du säker på att du vill avsluta? + Är du säker på att du vill avsluta %s? + Glas + Jag förstår + Bra + Dölj + Ljus + Logga in + Logga ut + Är du säker på att du vill logga ut %s? + Hantera konto + Kanske + Meny + Nej + Inga resultat hittades + Inga + OK + Play Store + Betygsätt + Rapportera ett fel + Sök + Skicka Feedback + Skicka via + Inställningar + Dela + Text kopierad till urklipp. + Tack så mycket + Uh-oh + Varning + + %d dag + %d dagar + + + %d timme + %d timmar + + + %d minut + %d minuter + + + %d sekund + %d sekunder + + Ja + Åtkomst nekad + diff --git a/core/src/main/res-public/values-th-rTH/strings_commons.xml b/core/src/main/res-public/values-th-rTH/strings_commons.xml index 33a54e0..2f4bdec 100644 --- a/core/src/main/res-public/values-th-rTH/strings_commons.xml +++ b/core/src/main/res-public/values-th-rTH/strings_commons.xml @@ -1,67 +1,65 @@ - - - - เกี่ยวกับแอพ - เกี่ยวกับ%s - เพิ่มบัญชี - กลับ - ยกเลิก - บันทึกการเปลี่ยนแปลง - ปิด - ติดต่อเรา - คัดลอก - กำหนด​เอง - สีเข้ม - ค่าเริ่มต้น - ไม่ต้องแสดงอีก - เสร็จ - ข้อผิดพลาด - ออก - แน่ใจหรือไม่ว่าคุณต้องการจะออก? - แน่ใจหรือไม่ว่าคุณต้องการจะออกจาก%s? - แก้ว - เข้าใจแล้ว - ดีมาก - ซ่อน - สว่าง - เข้าสู่ระบบ - ออกจากระบบ - คุณแน่ใจว่าต้องการให้%sออกจากระบบ? - จัดการบัญชี - บางที - เมนู - ไม่ - ไม่พบผลลัพธ์ - ไม่มี - ตกลง - Play Store - ให้คะแนน - รายงานข้อบกพร่อง - ค้นหา - ส่งข้อเสนอแนะ - ส่งผ่านทาง - ตั้งค่า - แชร์ - คัดลอกข้อความไปยังคลิปบอร์ดแล้ว - ขอบคุณ - โอ้โห! - คำเตือน - - %d วัน - - - %d ชั่วโมง - - - %d นาที - - - %d วินาที - - ใช่ - สิทธิ์การใช้งานถูกปฏิเสธ! + เกี่ยวกับแอพ + เกี่ยวกับ%s + เพิ่มบัญชี + กลับ + ยกเลิก + บันทึกการเปลี่ยนแปลง + ปิด + ติดต่อเรา + คัดลอก + กำหนด​เอง + สีเข้ม + ค่าเริ่มต้น + ไม่ต้องแสดงอีก + เสร็จ + ข้อผิดพลาด + ออก + แน่ใจหรือไม่ว่าคุณต้องการจะออก? + แน่ใจหรือไม่ว่าคุณต้องการจะออกจาก%s? + แก้ว + เข้าใจแล้ว + ดีมาก + ซ่อน + สว่าง + เข้าสู่ระบบ + ออกจากระบบ + คุณแน่ใจว่าต้องการให้%sออกจากระบบ? + จัดการบัญชี + บางที + เมนู + ไม่ + ไม่พบผลลัพธ์ + ไม่มี + ตกลง + Play Store + ให้คะแนน + รายงานข้อบกพร่อง + ค้นหา + ส่งข้อเสนอแนะ + ส่งผ่านทาง + ตั้งค่า + แชร์ + คัดลอกข้อความไปยังคลิปบอร์ดแล้ว + ขอบคุณ + โอ้โห! + คำเตือน + + %d วัน + + + %d ชั่วโมง + + + %d นาที + + + %d วินาที + + ใช่ + สิทธิ์การใช้งานถูกปฏิเสธ! diff --git a/core/src/main/res-public/values-tr-rTR/strings_commons.xml b/core/src/main/res-public/values-tr-rTR/strings_commons.xml index d74981f..1e8395e 100644 --- a/core/src/main/res-public/values-tr-rTR/strings_commons.xml +++ b/core/src/main/res-public/values-tr-rTR/strings_commons.xml @@ -1,71 +1,69 @@ - - - - App Hakkında - Hakkında%s - Hesap eklemek - Geri - İptal etmek - Değişiklikler - Kapat - Bize ulaşın - Kopyala - Özel - Koyu - Varsayılan - Bir daha gösterme - Bitti - Hata - Çıkış - Çıkmak istediğine emin misin? - Çıkmak istediğine emin misin? %s? - Cam - Anladım - Güzel - Gizle - Açık - Giriş yap - Çıkış yap - Çıkış yapmak istediğine emin misin %s? - Hesabını yönet - Belki - Menü - Hayır - Hiç bir sonuç bulunamadı - Hiçbir - Tamam - Play Store - Oran - Bir hatayı bildir - Araştır - Geri bildirim gönder - Yoluyla Gönder - Ayarlar - Paylaş - Metin panoya kopyalandı. - Teşekkür ederim - Ah ah - Uyarı - - %d gün - %d gün - - - Saat %d - Saat %d - - - %d dakika - %d dakika - - - %d saniye - %d saniye - - Evet - İzin reddedildi + App Hakkında + Hakkında%s + Hesap eklemek + Geri + İptal etmek + Değişiklikler + Kapat + Bize ulaşın + Kopyala + Özel + Koyu + Varsayılan + Bir daha gösterme + Bitti + Hata + Çıkış + Çıkmak istediğine emin misin? + Çıkmak istediğine emin misin? %s? + Cam + Anladım + Güzel + Gizle + Açık + Giriş yap + Çıkış yap + Çıkış yapmak istediğine emin misin %s? + Hesabını yönet + Belki + Menü + Hayır + Hiç bir sonuç bulunamadı + Hiçbir + Tamam + Play Store + Oran + Bir hatayı bildir + Araştır + Geri bildirim gönder + Yoluyla Gönder + Ayarlar + Paylaş + Metin panoya kopyalandı. + Teşekkür ederim + Ah ah + Uyarı + + %d gün + %d gün + + + Saat %d + Saat %d + + + %d dakika + %d dakika + + + %d saniye + %d saniye + + Evet + İzin reddedildi diff --git a/core/src/main/res-public/values-uk-rUA/strings_commons.xml b/core/src/main/res-public/values-uk-rUA/strings_commons.xml new file mode 100644 index 0000000..60ca520 --- /dev/null +++ b/core/src/main/res-public/values-uk-rUA/strings_commons.xml @@ -0,0 +1,53 @@ + + + Про додаток + Про %s + Додати обліковий запис + Назад + Скасувати + Історія змін + Закрити + Зв\'яжіться з нами + Скопіювати + Користувальницький + Темний + За замовчуванням + Не показувати знову + Готово + Помилка + Вихід + Ви впевнені що хочете вийти? + Ви впевнені що хочете вийти %s? + Скляна + Зрозуміло + Чудово + Сховати + Світла + Увійти + Вийти + Ви впевнені, що хочете вийти з %s? + Керування акаунтами + Можливо + Меню + Ні + Нічого не знайдено + Жоден + OK + Play Маркет + Оцінити + Повідомити про помилки + Пошук + Надіслати відгук + Надіслати через + Налаштування + Поділитися + Текст скопійовано до буфера обміну. + Дякуємо Вам + Ой-ой + Увага + Так + У доступі відмовлено + diff --git a/core/src/main/res-public/values/public.xml b/core/src/main/res-public/values/public.xml index 158ab6f..485be78 100644 --- a/core/src/main/res-public/values/public.xml +++ b/core/src/main/res-public/values/public.xml @@ -1,5 +1,5 @@ - + -- cgit v1.2.3