-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
199 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon Aug 26 13:01:08 NZST 2019 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 16 additions & 15 deletions
31
...ain/java/nz/co/trademe/konfigure/android/ui/adapter/viewholder/BooleanConfigViewHolder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
package nz.co.trademe.konfigure.android.ui.adapter.viewholder | ||
|
||
import android.view.ViewGroup | ||
import kotlinx.android.synthetic.main.view_holder_boolean.* | ||
import nz.co.trademe.konfigure.android.R | ||
import nz.co.trademe.konfigure.android.ui.adapter.ConfigAdapterModel | ||
import nz.co.trademe.konfigure.android.databinding.ViewHolderBooleanBinding | ||
import nz.co.trademe.konfigure.android.extensions.applicationConfig | ||
import nz.co.trademe.konfigure.android.ui.adapter.ConfigAdapterModel | ||
|
||
internal class BooleanConfigViewHolder( | ||
parent: ViewGroup | ||
) : BaseViewHolder(parent.inflate(R.layout.view_holder_boolean)) { | ||
parent: ViewGroup, | ||
) : BaseViewHolder<ViewHolderBooleanBinding>(parent.inflate(ViewHolderBooleanBinding::inflate)) { | ||
|
||
fun bind(model: ConfigAdapterModel.BooleanConfig) { | ||
itemView.setOnClickListener { | ||
valueSwitch.toggle() | ||
} | ||
with(binding) { | ||
itemView.setOnClickListener { | ||
valueSwitch.toggle() | ||
} | ||
|
||
titleTextView.text = model.metadata.title | ||
titleTextView.showAsModified(model.isModified) | ||
titleTextView.text = model.metadata.title | ||
titleTextView.showAsModified(model.isModified) | ||
|
||
descriptionTextView.text = model.metadata.description | ||
descriptionTextView.text = model.metadata.description | ||
|
||
valueSwitch.setOnCheckedChangeListener(null) | ||
valueSwitch.isChecked = model.value | ||
valueSwitch.setOnCheckedChangeListener { _, newValue -> | ||
itemView.context.applicationConfig.setValueOf(model.item, Boolean::class, newValue) | ||
valueSwitch.setOnCheckedChangeListener(null) | ||
valueSwitch.isChecked = model.value | ||
valueSwitch.setOnCheckedChangeListener { _, newValue -> | ||
itemView.context.applicationConfig.setValueOf(model.item, Boolean::class, newValue) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
...d/src/main/java/nz/co/trademe/konfigure/android/ui/adapter/viewholder/HeaderViewHolder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
package nz.co.trademe.konfigure.android.ui.adapter.viewholder | ||
|
||
import android.view.ViewGroup | ||
import kotlinx.android.synthetic.main.view_holder_header.* | ||
import nz.co.trademe.konfigure.android.R | ||
import nz.co.trademe.konfigure.android.databinding.ViewHolderHeaderBinding | ||
|
||
internal class HeaderViewHolder( | ||
parent: ViewGroup | ||
) : BaseViewHolder(parent.inflate(R.layout.view_holder_header)) { | ||
) : BaseViewHolder<ViewHolderHeaderBinding>(parent.inflate(ViewHolderHeaderBinding::inflate)) { | ||
|
||
fun bind(title: String) { | ||
titleTextView.text = title | ||
binding.titleTextView.text = title | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
...a/nz/co/trademe/konfigure/android/ui/adapter/viewholder/ResetToDefaultFooterViewHolder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.