Skip to content

Theming MonthView#313

Open
carlonzo wants to merge 2 commits into
wdullaer:masterfrom
carlonzo:theme-all-the-things
Open

Theming MonthView#313
carlonzo wants to merge 2 commits into
wdullaer:masterfrom
carlonzo:theme-all-the-things

Conversation

@carlonzo
Copy link
Copy Markdown
Contributor

@carlonzo carlonzo commented Feb 10, 2017

Here I have replaced all the resources used by the MonthView with attributes that can be applied by a Theme. the dark theme now is an actual theme. Devs now can apply their own theme to the view without overriding resources

@carlonzo
Copy link
Copy Markdown
Contributor Author

I still have problems with the formatter. May get some help on that?

mDisabledDayTextColor = ContextCompat.getColor(context, R.color.mdtp_date_picker_text_disabled);
mHighlightedDayTextColor = ContextCompat.getColor(context, R.color.mdtp_date_picker_text_highlighted);
}
TypedArray typedArray = context.obtainStyledAttributes(attr, R.styleable.MonthView, R.attr.mdtp_monthViewTheme, R.style.MonthView);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default it uses MonthView style if it cannot find a style applied with attribute mdtp_monthViewTheme

@carlonzo carlonzo force-pushed the theme-all-the-things branch from fe61a6d to 0b34361 Compare February 10, 2017 12:45
Comment thread sample/src/main/res/values/styles.xml Outdated
<item name="colorAccent">#ff4081</item>
<!-- Customize picker mode here. -->
<item name="mdtp_theme_dark">true</item>
<item name="mdtp_mdtp_monthViewTheme">@style/MonthView</item>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base theme applied from the sample app

<item name="daySelectedCircleSize">@dimen/mdtp_day_number_select_circle_radius</item>
</style>

<style name="MonthView.Dark">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dark theme, its an actual theme now

@carlonzo carlonzo force-pushed the theme-all-the-things branch from 0b34361 to 3f37248 Compare February 10, 2017 12:59
@wdullaer
Copy link
Copy Markdown
Owner

This could be useful.
I'll review this, the next time I can spend a day of development time

@carlonzo
Copy link
Copy Markdown
Contributor Author

@wdullaer conflicts solved

@wdullaer
Copy link
Copy Markdown
Owner

Cheers!
I'll try to get this reviewed by the end of the month.
Sorry for the delay.

@wdullaer
Copy link
Copy Markdown
Owner

Could you write a snippet of code for in the README on how devs can create their own themes and apply them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants