This pull request adds functionality to the FirmwareImportPreference class to handle long-click events. When a user long-clicks the preference, a dialog is displayed asking for confirmation to remove the installed firmware. If confirmed, the firmware is deleted, and a Snackbar notification is shown.
Changes
Override onBindViewHolder to set a long-click listener on the preference view.
Implement showRemoveFirmwareDialog to display a confirmation dialog for removing the firmware.
Add removeFirmware method to delete the firmware and show a Snackbar notification.
Ensure necessary imports for PreferenceViewHolder and MaterialAlertDialogBuilder.
Testing
Verified that long-clicking the firmware import preference shows the confirmation dialog.
Tested the removal of firmware and confirmed that it updates the UI and shows a Snackbar notification.
Summary
This pull request adds functionality to the
FirmwareImportPreference
class to handle long-click events. When a user long-clicks the preference, a dialog is displayed asking for confirmation to remove the installed firmware. If confirmed, the firmware is deleted, and a Snackbar notification is shown.Changes
onBindViewHolder
to set a long-click listener on the preference view.showRemoveFirmwareDialog
to display a confirmation dialog for removing the firmware.removeFirmware
method to delete the firmware and show a Snackbar notification.PreferenceViewHolder
andMaterialAlertDialogBuilder
.Testing