Remove commented out code and useless code

This commit is contained in:
Benoit Marty 2020-08-27 17:38:35 +02:00
parent cd28ad4c07
commit cb64f472fe
1 changed files with 1 additions and 99 deletions

View File

@ -17,7 +17,6 @@
package im.vector.app.features.settings package im.vector.app.features.settings
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.preference.VectorSwitchPreference
import javax.inject.Inject import javax.inject.Inject
class VectorSettingsLabsFragment @Inject constructor( class VectorSettingsLabsFragment @Inject constructor(
@ -28,103 +27,6 @@ class VectorSettingsLabsFragment @Inject constructor(
override val preferenceXmlRes = R.xml.vector_settings_labs override val preferenceXmlRes = R.xml.vector_settings_labs
override fun bindPref() { override fun bindPref() {
// Lab // Nothing to do
findPreference<VectorSwitchPreference>(VectorPreferences.SETTINGS_LABS_ALLOW_EXTENDED_LOGS)?.let {
it.isChecked = vectorPreferences.labAllowedExtendedLogging()
}
findPreference<VectorSwitchPreference>(VectorPreferences.SETTINGS_LABS_UNREAD_NOTIFICATIONS_AS_TAB)?.let {
it.isChecked = vectorPreferences.labAddNotificationTab()
}
// val useCryptoPref = findPreference(VectorPreferences.SETTINGS_ROOM_SETTINGS_LABS_END_TO_END_PREFERENCE_KEY) as SwitchPreference
// val cryptoIsEnabledPref = findPreference(VectorPreferences.SETTINGS_ROOM_SETTINGS_LABS_END_TO_END_IS_ACTIVE_PREFERENCE_KEY)
if (session.cryptoService().isCryptoEnabled()) {
// mLabsCategory.removePreference(useCryptoPref)
//
// cryptoIsEnabledPref.isEnabled = false
} else {
// mLabsCategory.removePreference(cryptoIsEnabledPref)
//
// useCryptoPref.isChecked = false
//
// useCryptoPref.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValueAsVoid ->
// if (TextUtils.isEmpty(mSession.sessionParams.deviceId)) {
// activity?.let { activity ->
// AlertDialog.Builder(activity)
// .setMessage(R.string.room_settings_labs_end_to_end_warnings)
// .setPositiveButton(R.string.logout) { _, _ ->
// notImplemented()
// // TODO CommonActivityUtils.logout(activity)
// }
// .setNegativeButton(R.string.cancel) { _, _ ->
// useCryptoPref.isChecked = false
// }
// .setOnCancelListener {
// useCryptoPref.isChecked = false
// }
// .show()
// }
// } else {
// val newValue = newValueAsVoid as Boolean
//
// if (mSession.isCryptoEnabled() != newValue) {
// notImplemented()
// /* TODO
// displayLoadingView()
//
// session.enableCrypto(newValue, object : MatrixCallback<Unit> {
// private fun refresh() {
// activity?.runOnUiThread {
// hideLoadingView()
// useCryptoPref.isChecked = session.isCryptoEnabled
//
// if (session.isCryptoEnabled) {
// mLabsCategory.removePreference(useCryptoPref)
// mLabsCategory.addPreference(cryptoIsEnabledPref)
// }
// }
// }
//
// override fun onSuccess(info: Void?) {
// useCryptoPref.isEnabled = false
// refresh()
// }
//
// override fun onNetworkError(e: Exception) {
// useCryptoPref.isChecked = false
// }
//
// override fun onMatrixError(e: MatrixError) {
// useCryptoPref.isChecked = false
// }
//
// override fun onUnexpectedError(e: Exception) {
// useCryptoPref.isChecked = false
// }
// })
// */
// }
// }
//
// true
// }
}
// SaveMode Management
// findPreference(VectorPreferences.SETTINGS_DATA_SAVE_MODE_PREFERENCE_KEY)
// .onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->
// notImplemented()
// /* TODO
// val sessions = Matrix.getMXSessions(activity)
// for (session in sessions) {
// session.setUseDataSaveMode(newValue as Boolean)
// }
// */
//
// true
// }
} }
} }