Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

Added option to set maximum icon size #300

Merged
merged 2 commits into from Mar 5, 2015
Merged

Added option to set maximum icon size #300

merged 2 commits into from Mar 5, 2015

Conversation

lordcodes
Copy link
Contributor

This pull request allows setting maximum icon size through the following methods:

  • to a default limit of 32dp (based from the platform AlertDialog)
    • limitIconToDefaultSize() builder method
    • md_icon_limit_icon_to_default_size global theme attribute
  • to a specified maximum size
    • maxIconSize(int maxIconSize) builder method
    • md_icon_max_size global theme attribute

This feature was requested in #297.

Andrew Lord and others added 2 commits March 5, 2015 20:12
… through builder method or through a global theme attribute. Added option to limit dialog to a specified max size through a builder method and a global theme attribute.
@Gaudon
Copy link

Gaudon commented Mar 5, 2015

Great work, if it all checks out I hope afollestad merges it in. Something I will be utilizing immediately.

@afollestad
Copy link
Owner

Looks great, it's simple and clean enough to trust, I'll merge it now and test it later. Thanks!

afollestad added a commit that referenced this pull request Mar 5, 2015
Added option to set maximum icon size
@afollestad afollestad merged commit c87dd3e into afollestad:master Mar 5, 2015
@lordcodes
Copy link
Contributor Author

Thanks!

@afollestad
Copy link
Owner

I improved this with a maxIconSizeRes() method too

@afollestad
Copy link
Owner

Release 0.6.3.5 is now available.

https://github.com/afollestad/material-dialogs/releases/tag/v0.6.3.5

@Gaudon
Copy link

Gaudon commented Mar 6, 2015

Yeah I tested this earlier this evening, seconds after it was released and it seems to be working perfectly. Quite handy for my use case!

Cheers gentleman.

@sevar83
Copy link

sevar83 commented Mar 12, 2015

A small mistake in the README. The lines

< attr name="md_icon_max_size" format="dimension" />
< attr name="md_icon_limit_icon_to_default_size" format="boolean" />

should be something like this:

< item name="md_icon_max_size">32dp
< item name="md_icon_limit_icon_to_default_size">true

@usernotnull
Copy link

please update readme as suggested above, cheers

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants