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

Theming MonthView #313

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

Conversation

carlonzo
Copy link
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
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
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
@@ -8,6 +8,7 @@
<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
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
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
Owner

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

@carlonzo
Copy link
Contributor Author

@wdullaer conflicts solved

@wdullaer
Copy link
Owner

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

@wdullaer
Copy link
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