Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explanatory text to "Filter notifications" dialog #285

Open
nikclayton opened this issue Dec 1, 2023 · 11 comments
Open

Add explanatory text to "Filter notifications" dialog #285

nikclayton opened this issue Dec 1, 2023 · 11 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@nikclayton
Copy link
Contributor

Describe the bug

The "Filter notifications" dialog doesn't clarify whether a checked box means that the notification will be shown or hidden.

Add a line of explanatory text underneath the dialog title, something like "Checked items are shown, unchecked items are hidden".

Versions

2.0.0

@nikclayton nikclayton added enhancement New feature or request good first issue Good for newcomers labels Dec 1, 2023
@sanao1006
Copy link
Contributor

Can I ask you a question?

In AlertDialog, it is not possible to put text between title and checkbox, is it?

Is it necessary to create a custom dialog to solve this issue?

@nikclayton
Copy link
Contributor Author

You can. But you can also set a custom view in an AlertDialog, see https://developer.android.com/develop/ui/views/components/dialogs#CustomLayout

@sanao1006
Copy link
Contributor

Thanks!

You can.

When I tried to insert a description using setMessage(), I thought it was impossible because the checkbox did not appear.
image

However, I would like to know how to accomplish this issue without using a custom dialog (which would surely be good knowledge for me as a developer!)

@nikclayton
Copy link
Contributor Author

Ah, I think I might have confused you.

"You can" was in reference to "Is it necessary to create a custom dialog". You can create a custom dialog to do this.

However, you don't have to. You can also AlertDialog and provide a custom layout that includes the list and the explanatory text. AlertDialog will provide the title and the buttons.

As you've already seen, you can't mix a message and a list of items in AlertDialog

@sanao1006
Copy link
Contributor

Ah, I think I might have confused you.
"You can" was in reference to "Is it necessary to create a custom dialog". You can create a custom dialog to do this.

Oh, sorry (English is difficult...)

You can also AlertDialog and provide a custom layout that includes the list and the explanatory text. AlertDialog will provide the title and the buttons.

It seems worthwhile!

I would like to work on this issue!!

@nikclayton
Copy link
Contributor Author

Great, thanks.

When creating the custom layout you can use https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/res/res/layout/alert_dialog_material.xml for inspiration.

There are quite few existing places in the code where setView is used to set a custom layout on an alert dialog, like AddPollDialog, CaptionDialog, and FocusDialog, and you can check their layouts too.

To make sure the padding at the start/end of each view is correct you can use the dialogPreferredPadding attribute:

        android:layout_marginStart="?dialogPreferredPadding"
        android:layout_marginEnd="?dialogPreferredPadding"

@nikclayton
Copy link
Contributor Author

@sanao1006 FYI, I'll be generally unavailable until the second week of January, so if you have anything ready for review earlier I won't be able to look at it until then.

Thanks for your contributions so far. Looking forward to seeing what you do in 2024.

@sanao1006
Copy link
Contributor

I understand.

I will do my best to contribute more next year!

@nikclayton
Copy link
Contributor Author

Hey @sanao1006 , were you able to get any further with this? No problem if you couldn't, I just don't want to start working on it if you have something that's almost ready for review.

@sanao1006
Copy link
Contributor

Hi @nikclayton
Sorry, no progress.
It's a private matter, but I have been looking for a new job to become an Android developer and was successful just the other day, so my schedule has settled down.
So I would like to work on this issue again.
Is it ok?

@nikclayton
Copy link
Contributor Author

Sure, that's great. And congratulations on the new job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

2 participants