Skip to content

Commit

Permalink
Fix answer at all angles being unset
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastProject committed Oct 14, 2020
1 parent 624ba19 commit 6f8190e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "me.hackerchick.raisetoanswer"
minSdkVersion 26
targetSdkVersion 29
versionCode 20
versionName "3.2.2"
versionCode 21
versionName "3.2.3"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
12 changes: 7 additions & 5 deletions app/src/main/java/me/hackerchick/raisetoanswer/MainActivity.kt
Expand Up @@ -60,7 +60,7 @@ class MainActivity : AppCompatActivity() {
val beepBehaviour: CheckedTextView = findViewById(R.id.behaviour_beep)

answerFeature.setOnClickListener { _->
setAnswerFeature(!answerFeature.isChecked)
setAnswerFeature(!answerFeature.isChecked, true)
}

answerAllAnglesFeature.setOnClickListener {
Expand All @@ -75,7 +75,7 @@ class MainActivity : AppCompatActivity() {
setBeepBehaviour(!beepBehaviour.isChecked)
}

setAnswerFeature(Util.answerFeatureEnabled(applicationContext))
setAnswerFeature(Util.answerFeatureEnabled(applicationContext), false)
setAnswerAllAnglesFeatureIfSupported(Util.answerAllAnglesFeatureEnabled(applicationContext))
setDeclineFeatureIfSupported(Util.declineFeatureEnabled(applicationContext))

Expand Down Expand Up @@ -113,13 +113,15 @@ class MainActivity : AppCompatActivity() {
}
}

private fun setAnswerFeature(value: Boolean) {
private fun setAnswerFeature(value: Boolean, propagate: Boolean) {
val answerFeature: CheckedTextView = findViewById(R.id.feature_answer)
answerFeature.isChecked = value

Util.setAnswerFeatureEnabled(applicationContext, value)

setAnswerAllAnglesFeatureIfSupported(false)

if (propagate) {
setAnswerAllAnglesFeatureIfSupported(false)
}
}

private fun setAnswerAllAnglesFeatureIfSupported(value: Boolean) {
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fastlane/metadata/android/en-US/images/phoneScreenshots/2_en-US.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6f8190e

Please sign in to comment.