Skip to content

Commit

Permalink
Update ExtSwitchPreference.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
gitofleonardo committed Jul 3, 2022
1 parent 36da25a commit 8e373d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 5 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField("String", "PACKAGE_NAME", "\"com.hhvvg.ecm\"")
}
debug {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField("String", "PACKAGE_NAME", "\"com.hhvvg.ecm\"")
}
Expand Down Expand Up @@ -54,7 +56,7 @@ dependencies {
implementation 'com.google.code.gson:gson:2.9.0'

// Preference
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.preference:preference:1.2.0'

// Navigation
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
Expand Down
10 changes: 3 additions & 7 deletions app/src/main/java/com/hhvvg/ecm/ui/view/ExtSwitchPreference.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ class ExtSwitchPreference(context: Context, attrs: AttributeSet?, defStyleAttr:I
}


override fun onBindViewHolder(holder: PreferenceViewHolder?) {
override fun onBindViewHolder(holder: PreferenceViewHolder) {
super.onBindViewHolder(holder)
if (holder == null) {
return
}

iconView = holder.findViewById(R.id.icon_view) as ImageView
titleView = holder.findViewById(R.id.title_text) as TextView
summaryView = holder.findViewById(R.id.summary_text) as TextView
Expand All @@ -48,8 +46,6 @@ class ExtSwitchPreference(context: Context, attrs: AttributeSet?, defStyleAttr:I
titleView.text = title
summaryView.text = summary
switchView.isChecked = isChecked
switchView.setOnClickListener {
isChecked = !isChecked
}
switchView.setOnClickListener(null)
}
}

0 comments on commit 8e373d6

Please sign in to comment.