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

[DatePicker] add divider to DatePicker #4471

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void onDayClick(long day) {

int columns =
themedContext.getResources().getInteger(R.integer.mtrl_calendar_year_selector_span);
yearSelector = root.findViewById(R.id.mtrl_calendar_year_selector_frame);
yearSelector = root.findViewById(R.id.mtrl_calendar_year_selector);
if (yearSelector != null) {
yearSelector.setHasFixedSize(true);
yearSelector.setLayoutManager(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,40 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.recyclerview.widget.RecyclerView
<LinearLayout
android:id="@+id/mtrl_calendar_year_selector_frame"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:scrollbars="none"/>
android:orientation="vertical">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mtrl_calendar_year_selector"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_gravity="center_horizontal"
android:scrollbars="none"
android:paddingStart="@dimen/mtrl_calendar_content_padding"
android:paddingEnd="@dimen/mtrl_calendar_content_padding"
android:paddingLeft="@dimen/mtrl_calendar_content_padding"
android:paddingRight="@dimen/mtrl_calendar_content_padding"/>

<View
style="?attr/materialCalendarHeaderDivider"
android:layout_width="match_parent"
android:layout_height="@dimen/mtrl_calendar_header_divider_thickness"/>

</LinearLayout>

<LinearLayout
android:id="@+id/mtrl_calendar_day_selector_frame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
android:orientation="vertical"
android:paddingStart="@dimen/mtrl_calendar_content_padding"
android:paddingEnd="@dimen/mtrl_calendar_content_padding"
android:paddingLeft="@dimen/mtrl_calendar_content_padding"
android:paddingRight="@dimen/mtrl_calendar_content_padding">

<include layout="@layout/mtrl_calendar_days_of_week"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
android:layout_height="wrap_content"
android:paddingTop="@dimen/mtrl_calendar_navigation_top_padding"
android:paddingBottom="@dimen/mtrl_calendar_navigation_bottom_padding"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingStart="@dimen/mtrl_calendar_content_padding"
android:paddingEnd="@dimen/mtrl_calendar_content_padding"
android:paddingLeft="@dimen/mtrl_calendar_content_padding"
android:paddingRight="@dimen/mtrl_calendar_content_padding">

<FrameLayout
android:layout_width="0dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
android:gravity="center"
android:paddingStart="@dimen/mtrl_calendar_content_padding"
android:paddingEnd="@dimen/mtrl_calendar_content_padding"
android:paddingLeft="@dimen/mtrl_calendar_content_padding"
android:paddingRight="@dimen/mtrl_calendar_content_padding">

<include layout="@layout/mtrl_calendar_days_of_week"/>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/colorOnSurface"/>

<include layout="@layout/mtrl_calendar_months"/>

</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:paddingBottom="@dimen/mtrl_calendar_bottom_padding"
android:paddingStart="@dimen/mtrl_calendar_content_padding"
android:paddingEnd="@dimen/mtrl_calendar_content_padding"
android:paddingLeft="@dimen/mtrl_calendar_content_padding"
android:paddingRight="@dimen/mtrl_calendar_content_padding"/>
android:paddingBottom="@dimen/mtrl_calendar_bottom_padding"/>

<include
layout="@layout/mtrl_picker_actions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@
</style>

<style name="Widget.Material3.MaterialCalendar.HeaderDivider" parent="Widget.MaterialComponents.MaterialCalendar.HeaderDivider">
<item name="android:visibility">gone</item>
<item name="android:visibility">visible</item>
<item name="android:background">?attr/colorOutlineVariant</item>
</style>

<style name="Widget.Material3.MaterialCalendar.HeaderTitle" parent="Widget.MaterialComponents.MaterialCalendar.HeaderTitle">
Expand Down