From 8d4874b60785297750bf1f053ed1e38405a79ca3 Mon Sep 17 00:00:00 2001 From: James Fenn Date: Mon, 22 Jun 2020 10:53:49 -0400 Subject: [PATCH] super fun visibility modifiers --- androidutils/build.gradle | 4 ++-- .../java/me/jfenn/androidutils/ViewUtils.kt | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/androidutils/build.gradle b/androidutils/build.gradle index edd60ea..b39d85d 100644 --- a/androidutils/build.gradle +++ b/androidutils/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 29 - versionCode 2 - versionName "0.0.2" + versionCode 3 + versionName "0.0.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/androidutils/src/main/java/me/jfenn/androidutils/ViewUtils.kt b/androidutils/src/main/java/me/jfenn/androidutils/ViewUtils.kt index e082757..df8b441 100644 --- a/androidutils/src/main/java/me/jfenn/androidutils/ViewUtils.kt +++ b/androidutils/src/main/java/me/jfenn/androidutils/ViewUtils.kt @@ -10,7 +10,7 @@ import androidx.annotation.RequiresApi import androidx.core.graphics.drawable.DrawableCompat import androidx.fragment.app.Fragment -internal inline fun ignore(what: () -> T?) = +inline fun ignore(what: () -> T?) = try { what() } catch (e: Exception) { @@ -18,21 +18,21 @@ internal inline fun ignore(what: () -> T?) = null } -internal inline fun Activity.bind(@IdRes res: Int): Lazy = lazy { findView(res) } +inline fun Activity.bind(@IdRes res: Int): Lazy = lazy { findView(res) } -internal inline fun Fragment.bind(@IdRes res: Int): Lazy? = lazy { findView(res) } +inline fun Fragment.bind(@IdRes res: Int): Lazy? = lazy { findView(res) } -internal inline fun View.bind(@IdRes res: Int): Lazy = lazy { findView(res) } +inline fun View.bind(@IdRes res: Int): Lazy = lazy { findView(res) } -internal inline fun Dialog.bind(@IdRes res: Int): Lazy = lazy { findView(res) } +inline fun Dialog.bind(@IdRes res: Int): Lazy = lazy { findView(res) } -internal inline fun Activity.findView(@IdRes res: Int): T? = ignore { findViewById(res) } +inline fun Activity.findView(@IdRes res: Int): T? = ignore { findViewById(res) } -internal inline fun Fragment.findView(@IdRes res: Int): T? = ignore { view?.findView(res) } +inline fun Fragment.findView(@IdRes res: Int): T? = ignore { view?.findView(res) } -internal inline fun View.findView(@IdRes res: Int): T? = ignore { findViewById(res) } +inline fun View.findView(@IdRes res: Int): T? = ignore { findViewById(res) } -internal inline fun Dialog.findView(@IdRes res: Int): T? = ignore { findViewById(res) } +inline fun Dialog.findView(@IdRes res: Int): T? = ignore { findViewById(res) } @RequiresApi(Build.VERSION_CODES.JELLY_BEAN) fun View.setBackgroundTint(@ColorInt color: Int) {