Skip to content

Commit

Permalink
Merge pull request #3364 from nextcloud/bug_fix_privacy_button_in_set…
Browse files Browse the repository at this point in the history
…tings

Small Bug fix - Privacy button in settings not working
  • Loading branch information
AndyScherzinger authored Oct 5, 2023
2 parents 0c2e0aa + 22cba48 commit 691a66e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/src/main/java/com/nextcloud/talk/settings/SettingsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import androidx.work.OneTimeWorkRequest
import androidx.work.WorkInfo
import androidx.work.WorkManager
import autodagger.AutoInjector
import com.afollestad.materialdialogs.utils.MDUtil.getStringArray
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.snackbar.Snackbar
import com.google.android.material.textfield.TextInputLayout
Expand Down Expand Up @@ -104,6 +103,7 @@ import java.net.URISyntaxException
import java.util.Locale
import javax.inject.Inject

@Suppress("LargeClass", "TooManyFunctions")
@AutoInjector(NextcloudTalkApplication::class)
class SettingsActivity : BaseActivity() {
private lateinit var binding: ActivitySettingsBinding
Expand Down Expand Up @@ -393,9 +393,11 @@ class SettingsActivity : BaseActivity() {
screenSecurityChangeListener = it
}
)
var pos = getStringArray(R.array.screen_lock_timeout_entry_values).indexOf(appPreferences.screenLockTimeout)
var pos = resources.getStringArray(R.array.screen_lock_timeout_entry_values).indexOf(
appPreferences.screenLockTimeout
)
binding.settingsScreenLockTimeoutLayoutDropdown.setText(
getStringArray(R.array.screen_lock_timeout_descriptions)[pos]
resources.getStringArray(R.array.screen_lock_timeout_descriptions)[pos]
)
binding.settingsScreenLockTimeoutLayoutDropdown.setSimpleItems(R.array.screen_lock_timeout_descriptions)
binding.settingsScreenLockTimeoutLayoutDropdown.setOnItemClickListener { _, _, position, _ ->
Expand All @@ -408,11 +410,11 @@ class SettingsActivity : BaseActivity() {
screenLockTimeoutChangeListener = it
}
)
pos = getStringArray(R.array.theme_entry_values).indexOf(appPreferences.theme)
binding.settingsTheme.setText(getStringArray(R.array.theme_descriptions)[pos])
pos = resources.getStringArray(R.array.theme_entry_values).indexOf(appPreferences.theme)
binding.settingsTheme.setText(resources.getStringArray(R.array.theme_descriptions)[pos])
binding.settingsTheme.setSimpleItems(R.array.theme_descriptions)
binding.settingsTheme.setOnItemClickListener { _, _, position, _ ->
val entryVal: String = getStringArray(R.array.theme_entry_values)[position]
val entryVal: String = resources.getStringArray(R.array.theme_entry_values)[position]
appPreferences.theme = entryVal
}
appPreferences.registerThemeChangeListener(ThemeChangeListener().also { themeChangeListener = it })
Expand All @@ -426,9 +428,7 @@ class SettingsActivity : BaseActivity() {
readPrivacyChangeListener = it
}
)
binding.settingsPrivacy.setOnClickListener {
readPrivacyChangeListener!!.onChanged(!binding.settingsReadPrivacySwitch.isChecked)
}

appPreferences.registerTypingStatusChangeListener(
TypingStatusChangeListener().also {
typingStatusChangeListener = it
Expand Down Expand Up @@ -527,7 +527,7 @@ class SettingsActivity : BaseActivity() {
binding.settingsProxyChoice.setText(appPreferences.proxyType)
binding.settingsProxyChoice.setSimpleItems(R.array.proxy_type_descriptions)
binding.settingsProxyChoice.setOnItemClickListener { _, _, position, _ ->
val entryVal = getStringArray(R.array.proxy_type_descriptions)[position]
val entryVal = resources.getStringArray(R.array.proxy_type_descriptions)[position]
appPreferences.proxyType = entryVal
}

Expand Down

0 comments on commit 691a66e

Please sign in to comment.