Auto-review
This commit is contained in:
parent
de1d79b637
commit
1bd85082c3
|
@ -61,9 +61,6 @@ class DevicesController @Inject constructor(private val errorFormatter: ErrorFor
|
|||
listener { callback?.retry() }
|
||||
}
|
||||
is Success ->
|
||||
// Build the devices portion of the settings.
|
||||
// Each row correspond to a device ID and its corresponding device name. Clicking on the row
|
||||
// display a dialog containing: the device ID, the device name and the "last seen" information.
|
||||
devices()
|
||||
// sort before display: most recent first
|
||||
.sortByLastSeen()
|
||||
|
|
|
@ -80,8 +80,8 @@ class DevicesViewModel @AssistedInject constructor(@Assisted initialState: Devic
|
|||
|
||||
/**
|
||||
* Force the refresh of the devices list.
|
||||
* The devices list is the list of the devices where the user as logged in.
|
||||
* It can be any mobile device, as any browser.
|
||||
* The devices list is the list of the devices where the user is logged in.
|
||||
* It can be any mobile devices, and any browsers.
|
||||
*/
|
||||
private fun refreshDevicesList() {
|
||||
if (session.isCryptoEnabled() && !session.sessionParams.credentials.deviceId.isNullOrEmpty()) {
|
||||
|
|
|
@ -91,13 +91,6 @@ class VectorSettingsDevicesFragment @Inject constructor(
|
|||
.show()
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a dialog containing the device ID, the device name and the "last seen" information.
|
||||
* This dialog allow to delete the corresponding device (see [.displayDeviceDeletionDialog])
|
||||
*
|
||||
* @param deviceInfo the device information
|
||||
* @param isCurrentDevice true if this is the current device
|
||||
*/
|
||||
override fun onDeviceClicked(deviceInfo: DeviceInfo) {
|
||||
devicesViewModel.handle(DevicesAction.ToggleDevice(deviceInfo))
|
||||
}
|
||||
|
@ -117,14 +110,14 @@ class VectorSettingsDevicesFragment @Inject constructor(
|
|||
/**
|
||||
* Display an alert dialog to rename a device
|
||||
*
|
||||
* @param aDeviceInfoToRename device info
|
||||
* @param deviceInfo device info
|
||||
*/
|
||||
private fun displayDeviceRenameDialog(aDeviceInfoToRename: DeviceInfo) {
|
||||
private fun displayDeviceRenameDialog(deviceInfo: DeviceInfo) {
|
||||
val inflater = requireActivity().layoutInflater
|
||||
val layout = inflater.inflate(R.layout.dialog_base_edit_text, null)
|
||||
|
||||
val input = layout.findViewById<EditText>(R.id.edit_text)
|
||||
input.setText(aDeviceInfoToRename.displayName)
|
||||
input.setText(deviceInfo.displayName)
|
||||
|
||||
AlertDialog.Builder(requireActivity())
|
||||
.setTitle(R.string.devices_details_device_name)
|
||||
|
@ -132,7 +125,7 @@ class VectorSettingsDevicesFragment @Inject constructor(
|
|||
.setPositiveButton(R.string.ok) { _, _ ->
|
||||
val newName = input.text.toString()
|
||||
|
||||
devicesViewModel.handle(DevicesAction.Rename(aDeviceInfoToRename, newName))
|
||||
devicesViewModel.handle(DevicesAction.Rename(deviceInfo, newName))
|
||||
}
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.show()
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
android:key="SETTINGS_USE_RAGE_SHAKE_KEY"
|
||||
android:title="@string/send_bug_report_rage_shake" />
|
||||
|
||||
<SeekBarPreference
|
||||
<androidx.preference.SeekBarPreference
|
||||
android:defaultValue="13"
|
||||
android:dependency="SETTINGS_USE_RAGE_SHAKE_KEY"
|
||||
android:key="SETTINGS_RAGE_SHAKE_DETECTION_THRESHOLD_KEY"
|
||||
|
|
Loading…
Reference in New Issue