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

[TextInputLayout] Exposed the style of the ExposedDropDownMenu #1566

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gabrielemariotti
Copy link
Contributor

@gabrielemariotti gabrielemariotti commented Aug 5, 2020

Currently the ExposedDropDownMenu provided by DropdownMenuEndIconDelegate doesn't use the shapeAppearance defined in the app theme and the corner radius are defined by code.

With this change:

  • the ExposedDropDownMenu uses the shapeAppearance defined in the app theme
  • there is a new attribute exposedDropDownMenuStyle defined in the TextInputLayout style with allows to customize the shapeAppearance /shapeAppearanceOverlay (and some other properties) of the ExposedDropDownMenu.

This change can be tested with the current catalog (changing the shapeAppearance).

Schermata 2020-08-05 alle 21 32 38

Schermata 2020-08-05 alle 21 32 48

Schermata 2020-08-05 alle 21 52 43

@wcshi wcshi requested a review from leticiarossi August 6, 2020 17:24
@leticiarossi
Copy link
Contributor

Thanks for the PR! I think it would be confusing to have a exposedDropDownMenuStyle since we have the TextInputLayout ExposedDropdownMenu styles and the AutoCompleteTextView styles.

Since we only want to affect the dropdown's popup background, I think it would make more sense to have an attribute like popupBackgroundShapeAppearance. I wonder if we could remove the logic that sets the background from the DropdownMenuEndIconDelegate and move it to the MaterialAutoCompleteTextView class instead, where it could read that attribute (that would then be set inside of the existent Widget.MaterialComponents.AutoCompleteTextView.* styles.

Would you be interested in trying that?

@gabrielemariotti
Copy link
Contributor Author

Thanks for your feedback.
I will update the PR.

Are you interested to set in the Widget.MaterialComponents.AutoCompleteTextView.* styles also attributes like
popupVerticalPaddingand popupElevation?

@leticiarossi
Copy link
Contributor

We already set android:dropDownVerticalOffset and android:popupElevation so it'd make sense to also read then in the class! I think it would also make sense to have popup*Padding attrs (right now we only set vertical padding but developers may want to set different paddings too)

@gabrielemariotti
Copy link
Contributor Author

Moving all the logic that sets the background to the MaterialAutoCompleteTextView class, how do you prefer to set the popupBackground with an AppCompatAutoCompleteTextView (for example with a Bridge theme)?

@gabrielemariotti
Copy link
Contributor Author

I've just updated the PR moving the all the logic that sets the background to the MaterialAutoCompleteTextView class.

@jsdeyro
Copy link

jsdeyro commented Oct 2, 2020

Will these be able to customize the ExposedDropDownMenu dropdown's popup background? If so, when this will be updated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants