Changed enable to disable

This commit is contained in:
Agnieszka C
2021-12-22 22:54:49 +01:00
parent f0fda44685
commit fa79c1484e
31 changed files with 48 additions and 40 deletions

View File

@ -98,11 +98,13 @@ class CallActivity : SimpleActivity() {
}
private fun initButtons() {
if (config.enableSwipeToAnswer) {
if (!config.disableSwipeToAnswer) {
handleSwipe()
} else {
call_draggable.beGone()
call_draggable_background.beGone()
call_left_arrow.beGone()
call_right_arrow.beGone()
call_decline.setOnClickListener {
endCall()
@ -183,6 +185,9 @@ class CallActivity : SimpleActivity() {
leftArrowTranslation = -call_decline.x
rightArrowTranslation = call_decline.x
call_left_arrow.applyColorFilter(getColor(R.color.md_red_400))
call_right_arrow.applyColorFilter(getColor(R.color.md_green_400))
startArrowAnimation(call_left_arrow, initialLeftArrowX, initialLeftArrowScaleX, initialLeftArrowScaleY, leftArrowTranslation)
startArrowAnimation(call_right_arrow, initialRightArrowX, initialRightArrowScaleX, initialRightArrowScaleY, rightArrowTranslation)
}

View File

@ -40,7 +40,7 @@ class SettingsActivity : SimpleActivity() {
setupStartNameWithSurname()
setupShowCallConfirmation()
setupDisableProximitySensor()
setupEnableSwipeToAnswer()
setupDisableSwipeToAnswer()
updateTextColors(settings_holder)
invalidateOptionsMenu()
@ -222,11 +222,11 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupEnableSwipeToAnswer() {
settings_enable_swipe_to_answer.isChecked = config.enableSwipeToAnswer
settings_enable_swipe_to_answer_holder.setOnClickListener {
settings_enable_swipe_to_answer.toggle()
config.enableSwipeToAnswer = settings_enable_swipe_to_answer.isChecked
private fun setupDisableSwipeToAnswer() {
settings_disable_swipe_to_answer.isChecked = config.disableSwipeToAnswer
settings_disable_swipe_to_answer_holder.setOnClickListener {
settings_disable_swipe_to_answer.toggle()
config.disableSwipeToAnswer = settings_disable_swipe_to_answer.isChecked
}
}
}

View File

@ -52,9 +52,9 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getBoolean(DISABLE_PROXIMITY_SENSOR, false)
set(disableProximitySensor) = prefs.edit().putBoolean(DISABLE_PROXIMITY_SENSOR, disableProximitySensor).apply()
var enableSwipeToAnswer: Boolean
get() = prefs.getBoolean(ENABLE_SWIPE_TO_ANSWER, false)
set(enableSwipeToAnswer) = prefs.edit().putBoolean(ENABLE_SWIPE_TO_ANSWER, enableSwipeToAnswer).apply()
var disableSwipeToAnswer: Boolean
get() = prefs.getBoolean(DISABLE_SWIPE_TO_ANSWER, false)
set(disableSwipeToAnswer) = prefs.edit().putBoolean(DISABLE_SWIPE_TO_ANSWER, disableSwipeToAnswer).apply()
var showTabs: Int
get() = prefs.getInt(SHOW_TABS, ALL_TABS_MASK)

View File

@ -10,7 +10,7 @@ const val REMEMBER_SIM_PREFIX = "remember_sim_"
const val GROUP_SUBSEQUENT_CALLS = "group_subsequent_calls"
const val OPEN_DIAL_PAD_AT_LAUNCH = "open_dial_pad_at_launch"
const val DISABLE_PROXIMITY_SENSOR = "disable_proximity_sensor"
const val ENABLE_SWIPE_TO_ANSWER = "enable_swipe_to_answer"
const val DISABLE_SWIPE_TO_ANSWER = "disable_swipe_to_answer"
const val SHOW_TABS = "show_tabs"
const val ALL_TABS_MASK = TAB_CONTACTS or TAB_FAVORITES or TAB_CALL_HISTORY