Skip to content

Commit

Permalink
Add setUseExperimental option for spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Aug 27, 2022
1 parent 86071cd commit 5965edf
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public class DefaultSpinnerAdapter(
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DefaultSpinnerViewHolder {
val binding =
PowerspinnerItemDefaultPowerBinding.inflate(
LayoutInflater.from(parent.context), parent,
LayoutInflater.from(parent.context),
parent,
false
)
return DefaultSpinnerViewHolder(binding).apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public class IconSpinnerAdapter(
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): IconSpinnerViewHolder {
val binding =
PowerspinnerItemDefaultPowerBinding.inflate(
LayoutInflater.from(parent.context), parent,
LayoutInflater.from(parent.context),
parent,
false
)
return IconSpinnerViewHolder(binding).apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ public data class IconSpinnerItem @JvmOverloads constructor(
val textTypeface: Typeface? = null,
val gravity: Int? = null,
val textSize: Float? = null,
@ColorInt val textColor: Int? = null,
@ColorInt val textColor: Int? = null
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ internal class PowerSpinnerPersistence private constructor() {

/** gets selected index from the preference. */
fun getSelectedIndex(name: String): Int = sharedPreferenceManager.getInt(
INDEX + name, NO_SELECTED_INDEX
INDEX + name,
NO_SELECTED_INDEX
)

/** puts selected index from the preference. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ package com.skydoves.powerspinner.internals
internal inline fun String?.whatIfNotNullOrEmpty(
whatIf: (String) -> Unit
) {

this.whatIfNotNullOrEmpty(
whatIf = whatIf,
whatIfNot = { }
Expand All @@ -44,7 +43,6 @@ internal inline fun String?.whatIfNotNullOrEmpty(
whatIf: (String) -> Unit,
whatIfNot: () -> Unit
) {

if (!this.isNullOrEmpty()) {
whatIf(this)
} else {
Expand Down
2 changes: 1 addition & 1 deletion spotless/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spotless {
kotlin {
target "**/*.kt"
targetExclude "**/build/**/*.kt"
ktlint().userData(['indent_size': '2', 'continuation_indent_size': '2'])
ktlint().setUseExperimental(true).editorConfigOverride(['indent_size': '2', 'continuation_indent_size': '2'])
licenseHeaderFile "$rootDir/spotless/spotless.license.kt"
trimTrailingWhitespace()
endWithNewline()
Expand Down

0 comments on commit 5965edf

Please sign in to comment.