feat: Add visibility reminder dialog - #2992
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a localized reminder-visibility dialog to the message send-options flow.
Changes:
- Adds “Me only” translations across all supported locales.
- Introduces the radio-selection dialog and layout.
- Stores and displays the selected visibility in the send-options state.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
app/src/main/res/values/strings.xml |
Adds English label. |
app/src/main/res/values-sv/strings.xml |
Adds Swedish label. |
app/src/main/res/values-pt/strings.xml |
Adds Portuguese label. |
app/src/main/res/values-pl/strings.xml |
Adds Polish label. |
app/src/main/res/values-nl/strings.xml |
Adds Dutch label. |
app/src/main/res/values-nb/strings.xml |
Adds Norwegian label. |
app/src/main/res/values-it/strings.xml |
Adds Italian label. |
app/src/main/res/values-fr/strings.xml |
Adds French label. |
app/src/main/res/values-fi/strings.xml |
Adds Finnish label. |
app/src/main/res/values-es/strings.xml |
Adds Spanish label. |
app/src/main/res/values-el/strings.xml |
Adds Greek label. |
app/src/main/res/values-de/strings.xml |
Adds German label. |
app/src/main/res/values-da/strings.xml |
Adds Danish label. |
app/src/main/res/layout/dialog_select_visibility_reminder.xml |
Defines the visibility choices. |
DraftSendOptionsFragment.kt |
Integrates selection and state handling. |
NewMessageViewModel.kt |
Holds the selected visibility. |
SelectVisibilityReminderDialog.kt |
Implements the selection dialog. |
6394ac6 to
a010bde
Compare
a010bde to
8a7e7bf
Compare
8a7e7bf to
45c7e45
Compare
45c7e45 to
c65b503
Compare
287df90 to
099759a
Compare
| private fun initDialog() = with(binding) { | ||
| MaterialAlertDialogBuilder(activityContext) | ||
| .setTitle(R.string.reminderVisibilityTitle) | ||
| .setView(root) |
There was a problem hiding this comment.
Since you're only using binding for root, you don't need your with.
| ~ You should have received a copy of the GNU General Public License | ||
| ~ along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| --> | ||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
There was a problem hiding this comment.
I think you could use a LinearLayout. You could use the SettingRadioGroupView as the root view.
|
|
||
| val scheduleConfig: MutableLiveData<ScheduleConfig> = MutableLiveData(ScheduleConfig.None) | ||
| val reminderConfig: MutableLiveData<ReminderConfig> = MutableLiveData(ReminderConfig.None) | ||
| val shouldRemindRecipient: MutableLiveData<Boolean> = MutableLiveData(true) |
There was a problem hiding this comment.
Why is this a LiveData ?
There was a problem hiding this comment.
I changed it to a flow
| setReminderOptionsVisible(isVisible = false) | ||
| setScheduleOptionsVisible(isVisible = false) | ||
|
|
||
| pendingShouldRemindRecipient = newMessageViewModel.shouldRemindRecipient.value ?: true |
There was a problem hiding this comment.
Any reasons to use another value instead of newMessageViewModel.shouldRemindRecipient?
There was a problem hiding this comment.
It was used to work with the save button, but we removed that behavior
099759a to
3a39a05
Compare
3a39a05 to
fde3c80
Compare
| private fun setupListeners() = with(binding) { | ||
| reminderVisibilityGroup.onItemCheckedListener { id, _, _ -> | ||
| this@SelectVisibilityReminderDialog.isRecipientsAndMeSelected = (id == R.id.selectionReminderRecipientsAndMe) | ||
| } | ||
|
|
||
| positiveButton.setOnClickListener { | ||
| onVisibilitySelected?.invoke(this@SelectVisibilityReminderDialog.isRecipientsAndMeSelected) | ||
| alertDialog.dismiss() | ||
| } | ||
|
|
||
| negativeButton.setOnClickListener { alertDialog.cancel() } | ||
| } |
There was a problem hiding this comment.
| private fun setupListeners() = with(binding) { | |
| reminderVisibilityGroup.onItemCheckedListener { id, _, _ -> | |
| this@SelectVisibilityReminderDialog.isRecipientsAndMeSelected = (id == R.id.selectionReminderRecipientsAndMe) | |
| } | |
| positiveButton.setOnClickListener { | |
| onVisibilitySelected?.invoke(this@SelectVisibilityReminderDialog.isRecipientsAndMeSelected) | |
| alertDialog.dismiss() | |
| } | |
| negativeButton.setOnClickListener { alertDialog.cancel() } | |
| } | |
| private fun setupListeners() { | |
| binding.reminderVisibilityGroup.onItemCheckedListener { id, _, _ -> | |
| isRecipientsAndMeSelected = id == R.id.selectionReminderRecipientsAndMe | |
| } | |
| positiveButton.setOnClickListener { | |
| onVisibilitySelected?.invoke(isRecipientsAndMeSelected) | |
| alertDialog.dismiss() | |
| } | |
| negativeButton.setOnClickListener { alertDialog.cancel() } | |
| } |
| private var shouldRemindRecipient: Boolean | ||
| get() = newMessageViewModel.shouldRemindRecipient.value ?: true | ||
| set(value) { | ||
| newMessageViewModel.shouldRemindRecipient.value = value | ||
| } |
There was a problem hiding this comment.
As the other, it should be a stateFlow in the viewModel that's observed and update the UI accordingly
fde3c80 to
204d4eb
Compare
204d4eb to
5418d90
Compare
5418d90 to
b5180c2
Compare
b5180c2 to
f64fc7e
Compare
1942087 to
c2842b3
Compare
c2842b3 to
d934dd8
Compare
|



No description provided.