avast / android-styled-dialogs

Backport of Material dialogs with easy-to-use API based on DialogFragment
Apache License 2.0
2.15k stars 450 forks source link

Extracted styles for title and message into theme declaration #16

Closed mr-const closed 11 years ago

mr-const commented 11 years ago

This PR allows simpler way to customize title and message text by overriding theme properties. It also gives simple way to add title and message icon by using drawable[Left|Right...]

example:

<style name="SDL.TextView.Title.Alert">
    <item name="android:drawableLeft">@drawable/ic_alert</item>
    <item name="android:textSize">16sp</item>
</style>
davidvavra commented 11 years ago

I like it, just to verify: Are you sure it won't break the current way how to style dialog title? Will overriding SDL.TextView.Title still work?

mr-const commented 11 years ago

It should work, the only thing changed - style of the title and message is 'by-reference' now, so it's became possible to override it.

davidvavra commented 11 years ago

Thanks!

jiqimaogou commented 10 years ago

in my theme file, I add <item name="sdlMessageTextStyle">@style/SDL.TextView.Message.Custom</item>, but it doesn't work?

davidvavra commented 10 years ago

@jiqimaogou: Do you use current master?

mr-const commented 10 years ago

There is (in android projects) a problem with override of themes in projects. You have to copy-paste <style name="SDL.Dialog" parent="android:Theme"> .... </style> and change copied styles to yours.