diff options
author | Allan Wang <me@allanwang.ca> | 2021-01-11 00:49:07 -0800 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-01-11 00:49:07 -0800 |
commit | 451e9869bca0ea16eb24eaa8fe9e866ce36a9a7a (patch) | |
tree | 9f6eefc3a3eefb965841ebc4338b5f21aa0959d1 | |
parent | 89d4a2e596d07585c4a3ed91e6e091111da0c2ad (diff) | |
download | kau-451e9869bca0ea16eb24eaa8fe9e866ce36a9a7a.tar.gz kau-451e9869bca0ea16eb24eaa8fe9e866ce36a9a7a.tar.bz2 kau-451e9869bca0ea16eb24eaa8fe9e866ce36a9a7a.zip |
Apply spotless and allow wildcard imports
6 files changed, 28 insertions, 29 deletions
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml index 6e6eec1..79ee123 100644 --- a/.idea/codeStyles/codeStyleConfig.xml +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -1,6 +1,5 @@ <component name="ProjectCodeStyleConfiguration"> <state> <option name="USE_PER_PROJECT_SETTINGS" value="true" /> - <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" /> </state> </component>
\ No newline at end of file diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt index 4f6233a..70b40e7 100644 --- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt +++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefActivity.kt @@ -31,10 +31,10 @@ import ca.allanwang.kau.ui.views.RippleCanvas import ca.allanwang.kau.utils.* import com.mikepenz.fastadapter.adapters.FastItemAdapter import com.mikepenz.fastadapter.select.getSelectExtension +import java.util.* import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext -import java.util.* abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract { @@ -118,9 +118,9 @@ abstract class KPrefActivity : KauBaseActivity(), KPrefActivityContract { binding.showNextPrefs(toolbarTitleRes, builder, false) private fun KauPrefActivityBinding.showNextPrefs( - @StringRes toolbarTitleRes: Int, - builder: KPrefAdapterBuilder.() -> Unit, - first: Boolean + @StringRes toolbarTitleRes: Int, + builder: KPrefAdapterBuilder.() -> Unit, + first: Boolean ) { launch { val items = withContext(Dispatchers.Default) { diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/BlurredImageView.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/BlurredImageView.kt index 50e8d10..8e78abf 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/BlurredImageView.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/BlurredImageView.kt @@ -52,7 +52,7 @@ class BlurredImageView @JvmOverloads constructor( private set val imageBase: ImageView get() = binding.imageBase - + private val binding: KauBlurredImageviewBinding = KauBlurredImageviewBinding.inflate(LayoutInflater.from(context), this) init { @@ -67,7 +67,7 @@ class BlurredImageView @JvmOverloads constructor( override fun clearAnimation() { super.clearAnimation() - with (binding) { + with(binding) { imageBase.clearAnimation() imageBlur.clearAnimation() imageForeground.clearAnimation() @@ -91,7 +91,7 @@ class BlurredImageView @JvmOverloads constructor( factor.width = width factor.height = height BlurTask(imageBase, factor) { - with (binding) { + with(binding) { imageBlur.setImageDrawable(it) scaleAnimate(ANIMATION_SCALE).start() imageBlur.alphaAnimate(1f).start() @@ -112,7 +112,7 @@ class BlurredImageView @JvmOverloads constructor( factor.width = width factor.height = height BlurTask(imageBase, factor) { drawable -> - with (binding) { + with(binding) { imageBlur.setImageDrawable(drawable) scaleXY = ANIMATION_SCALE imageBlur.alpha = 1f @@ -128,7 +128,7 @@ class BlurredImageView @JvmOverloads constructor( if (!isBlurred) return isBlurred = false scaleAnimate(1.0f).start() - with (binding) { + with(binding) { imageBlur.alphaAnimate(0f).withEndAction { imageBlur.setImageDrawable(null) }.start() imageForeground.alphaAnimate(0f).start() } @@ -142,7 +142,7 @@ class BlurredImageView @JvmOverloads constructor( clearAnimation() scaleX = 1.0f scaleX = 1.0f - with (binding) { + with(binding) { imageBlur.alpha = 0f imageBlur.setImageDrawable(null) imageForeground.alpha = 0f diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityBase.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityBase.kt index 1357d4d..fe25d97 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityBase.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerActivityBase.kt @@ -39,8 +39,8 @@ import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial * Having three layered images makes this slightly slower than [MediaPickerActivityOverlayBase] */ abstract class MediaPickerActivityBase( - mediaType: MediaType, - mediaActions: List<MediaAction> = emptyList() + mediaType: MediaType, + mediaActions: List<MediaAction> = emptyList() ) : MediaPickerCore<MediaItem>(mediaType, mediaActions) { private lateinit var binding: KauActivityImagePickerBinding diff --git a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt index edf7408..12f835b 100644 --- a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt +++ b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt @@ -55,9 +55,9 @@ import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial * https://github.com/lapism/SearchView */ class SearchView @JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 ) : FrameLayout(context, attrs, defStyleAttr) { /** @@ -388,10 +388,10 @@ class SearchView @JvmOverloads constructor( * If not, see the extension function [bindSearchView] */ fun bind( - menu: Menu, - @IdRes id: Int, - @ColorInt menuIconColor: Int = Color.WHITE, - config: Configs.() -> Unit = {} + menu: Menu, + @IdRes id: Int, + @ColorInt menuIconColor: Int = Color.WHITE, + config: Configs.() -> Unit = {} ): SearchView { config(config) val menuItem = menu.findItem(id) @@ -537,10 +537,10 @@ annotation class KauSearch */ @KauSearch fun Activity.bindSearchView( - menu: Menu, - @IdRes id: Int, - @ColorInt menuIconColor: Int = Color.WHITE, - config: Configs.() -> Unit = {} + menu: Menu, + @IdRes id: Int, + @ColorInt menuIconColor: Int = Color.WHITE, + config: Configs.() -> Unit = {} ): SearchView = findViewById<ViewGroup>(android.R.id.content).bindSearchView(menu, id, menuIconColor, config) @@ -551,10 +551,10 @@ fun Activity.bindSearchView( */ @KauSearch fun ViewGroup.bindSearchView( - menu: Menu, - @IdRes id: Int, - @ColorInt menuIconColor: Int = Color.WHITE, - config: Configs.() -> Unit = {} + menu: Menu, + @IdRes id: Int, + @ColorInt menuIconColor: Int = Color.WHITE, + config: Configs.() -> Unit = {} ): SearchView { val searchView = SearchView(context) searchView.layoutParams = diff --git a/spotless.gradle b/spotless.gradle index 2947489..ea95c38 100644 --- a/spotless.gradle +++ b/spotless.gradle @@ -3,7 +3,7 @@ apply plugin: "com.diffplug.spotless" spotless { kotlin { target "**/*.kt" - ktlint() + ktlint().userData(["disabled_rules": "no-wildcard-imports"]) licenseHeaderFile '../spotless.license.kt' trimTrailingWhitespace() endWithNewline() |