Commit d4246617 authored by James Kung's avatar James Kung Committed by Android Git Automerger
Browse files

am 51da77ac: Fixing date picker layout across all devices

* commit '51da77ac':
  Fixing date picker layout across all devices
parents d1dd9cf9 51da77ac
......@@ -16,20 +16,27 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/date_picker_dialog_height"
android:layout_height="@dimen/date_picker_view_animator_height"
android:gravity="center"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="@dimen/date_picker_width"
android:layout_height="@dimen/date_picker_dialog_height"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical" >
<include layout="@layout/date_picker_header_view" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
android:orientation="vertical" >
<include layout="@layout/date_picker_header_view" />
<include layout="@layout/date_picker_selected_date" />
<include layout="@layout/date_picker_selected_date" />
</LinearLayout>
<View
android:layout_width="match_parent"
......@@ -44,18 +51,6 @@
android:layout_height="match_parent"
android:background="@color/line_background" />
<FrameLayout
android:layout_width="@dimen/pager_width"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@color/calendar_pager" >
<ViewAnimator
android:id="@+id/animator"
android:layout_width="@dimen/pager_width"
android:layout_height="@dimen/pager_height"
android:background="@color/calendar_pager"
android:gravity="center" />
</FrameLayout>
<include layout="@layout/date_picker_view_animator" />
</LinearLayout>
\ No newline at end of file
......@@ -16,23 +16,26 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/date_picker_dialog_height"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="@dimen/date_picker_width"
android:layout_height="@dimen/date_picker_dialog_height"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical" >
<include layout="@layout/date_picker_header_view" />
<include layout="@layout/date_picker_selected_date" />
<include
android:layout_height="0dip"
android:layout_weight="1"
layout="@layout/date_picker_selected_date" />
<View
android:layout_width="match_parent"
android:layout_width="@dimen/date_picker_component_width"
android:layout_height="1dip"
android:background="@color/line_background" />
......@@ -41,21 +44,9 @@
<View
android:layout_width="1dip"
android:layout_height="match_parent"
android:layout_height="@dimen/date_picker_view_animator_height"
android:background="@color/line_background" />
<FrameLayout
android:layout_width="@dimen/pager_width"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@color/calendar_pager" >
<ViewAnimator
android:id="@+id/animator"
android:layout_width="@dimen/pager_width"
android:layout_height="@dimen/pager_height"
android:background="@color/calendar_pager"
android:gravity="center" />
</FrameLayout>
<include layout="@layout/date_picker_view_animator" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project
<!--
Copyright (C) 2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......@@ -14,29 +15,29 @@
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/date_picker_width"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/date_picker_view_animator"
android:gravity="center"
android:orientation="vertical"
android:background="@color/calendar_pager" >
android:orientation="vertical" >
<include layout="@layout/date_picker_header_view" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/selected_calendar_layout_height"
android:orientation="vertical" >
<include layout="@layout/date_picker_selected_date"
android:id="@+id/date_picker_selected_date_layout" />
<include layout="@layout/date_picker_header_view" />
<ViewAnimator
android:id="@+id/animator"
android:layout_width="@dimen/pager_width"
android:layout_height="@dimen/pager_height"
android:gravity="center"
android:background="@color/calendar_pager" />
<include layout="@layout/date_picker_selected_date" />
</LinearLayout>
<include layout="@layout/date_picker_view_animator" />
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@color/line_background" />
<include layout="@layout/date_picker_done_button"
android:id="@+id/date_picker_done_button" />
<include layout="@layout/date_picker_done_button" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project
<!--
Copyright (C) 2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......@@ -14,27 +15,27 @@
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/date_picker_width"
android:layout_width="@dimen/date_picker_component_width"
android:layout_height="match_parent"
android:background="@color/date_picker_view_animator"
android:gravity="center"
android:orientation="vertical"
android:background="@color/calendar_pager" >
android:orientation="vertical" >
<include layout="@layout/date_picker_selected_date"
android:id="@+id/date_picker_selected_date_layout" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/selected_calendar_layout_height"
android:orientation="vertical" >
<ViewAnimator
android:id="@+id/animator"
android:layout_width="@dimen/pager_width"
android:layout_height="@dimen/pager_height"
android:gravity="center"
android:background="@color/calendar_pager" />
<include layout="@layout/date_picker_selected_date" />
</LinearLayout>
<include layout="@layout/date_picker_view_animator" />
<View
android:layout_width="match_parent"
android:layout_width="@dimen/date_picker_component_width"
android:layout_height="1dip"
android:background="@color/line_background" />
<include layout="@layout/date_picker_done_button"
android:id="@+id/date_picker_done_button" />
<include layout="@layout/date_picker_done_button" />
</LinearLayout>
\ No newline at end of file
......@@ -15,9 +15,8 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_width="@dimen/date_picker_component_width"
android:layout_height="wrap_content"
android:layout="@+id/done_layout"
android:orientation="vertical" >
<Button
......
......@@ -16,7 +16,7 @@
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/date_picker_header"
android:layout_width="match_parent"
android:layout_width="@dimen/date_picker_component_width"
android:layout_height="@dimen/date_picker_header_height"
android:background="@color/calendar_header"
android:gravity="center"
......
......@@ -17,8 +17,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/day_picker_selected_date_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/selected_date_layout_height"
android:layout_width="@dimen/date_picker_component_width"
android:layout_height="0dip"
android:layout_weight="1"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical" >
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<ViewAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/animator"
android:layout_width="@dimen/date_picker_component_width"
android:layout_height="@dimen/date_picker_view_animator_height"
android:gravity="center"
android:background="@color/date_picker_view_animator" />
\ No newline at end of file
......@@ -22,9 +22,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" >
<dimen name="dialog_height">200dip</dimen>
<dimen name="left_side_width">250dip</dimen>
<dimen name="date_picker_dialog_height">282dip</dimen>
<dimen name="selected_date_layout_height">210dp</dimen>
<dimen name="selected_date_year_size">30dp</dimen>
<dimen name="selected_date_day_size">100dp</dimen>
<dimen name="selected_date_month_size">30dp</dimen>
......
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2013, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<resources
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"
xmlns:android="http://schemas.android.com/apk/res/android" >
<dimen name="selected_date_layout_height">210dp</dimen>
<dimen name="selected_date_year_size">30dp</dimen>
<dimen name="selected_date_day_size">100dp</dimen>
<dimen name="selected_date_month_size">30dp</dimen>
</resources>
\ No newline at end of file
......@@ -21,7 +21,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"
xmlns:android="http://schemas.android.com/apk/res/android" >
<dimen name="selected_date_layout_height">210dp</dimen>
<dimen name="selected_calendar_layout_height">240dp</dimen>
<dimen name="selected_date_year_size">30dp</dimen>
<dimen name="selected_date_day_size">100dp</dimen>
<dimen name="selected_date_month_size">30dp</dimen>
......
......@@ -20,6 +20,7 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"
xmlns:android="http://schemas.android.com/apk/res/android">
<dimen name="date_picker_header_height">45dp</dimen>
<dimen name="time_label_right_padding">16sp</dimen>
<dimen name="time_label_size">64sp</dimen>
<dimen name="ampm_label_size">21sp</dimen>
......@@ -28,7 +29,6 @@
<dimen name="separator_padding">5dip</dimen>
<dimen name="header_height">96dip</dimen>
<dimen name="footer_height">48dip</dimen>
<dimen name="date_picker_dialog_height">410dip</dimen>
<dimen name="left_side_width">315dip</dimen>
</resources>
\ No newline at end of file
......@@ -20,11 +20,9 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"
xmlns:android="http://schemas.android.com/apk/res/android">
<dimen name="pager_height">400dp</dimen>
<dimen name="pager_width">400dp</dimen>
<dimen name="date_picker_width">400dp</dimen>
<dimen name="selected_date_layout_height">360dp</dimen>
<dimen name="done_button_height">42dp</dimen>
<dimen name="date_picker_component_width">400dp</dimen>
<dimen name="date_picker_view_animator_height">400dp</dimen>
<dimen name="selected_calendar_layout_height">360dp</dimen>
<dimen name="date_picker_header_height">45dp</dimen>
<dimen name="month_list_item_header_height">75dp</dimen>
<dimen name="month_list_item_padding">24dp</dimen>
......@@ -33,6 +31,8 @@
<dimen name="selected_date_year_size">45dp</dimen>
<dimen name="selected_date_day_size">150dp</dimen>
<dimen name="selected_date_month_size">45dp</dimen>
<dimen name="year_label_height">96dp</dimen>
<dimen name="year_label_text_size">33dp</dimen>
<dimen name="date_picker_header_text_size">21dp</dimen>
<dimen name="month_list_item_size">24sp</dimen>
<dimen name="month_label_size">24sp</dimen>
......@@ -48,6 +48,6 @@
<dimen name="footer_height">60dip</dimen>
<dimen name="minimum_margin_sides">48dip</dimen>
<dimen name="minimum_margin_top_bottom">24dip</dimen>
<dimen name="picker_dimen">375dip</dimen>
</resources>
\ No newline at end of file
......@@ -29,7 +29,7 @@
<color name="date_picker_text_normal">#FF999999</color>
<color name="calendar_header">#999999</color>
<color name="calendar_pager">#FFECEDEE</color>
<color name="date_picker_view_animator">#FFECEDEE</color>
<color name="calendar_selected_date_text">#FFD1D2D4</color>
<color name="done_button_color">#FFECEDEE</color>
</resources>
\ No newline at end of file
......@@ -41,12 +41,12 @@
<dimen name="minimum_margin_top_bottom">24dip</dimen>
<dimen name="picker_dimen">270dip</dimen>
<dimen name="pager_height">270dp</dimen>
<dimen name="pager_width">270dp</dimen>
<dimen name="date_picker_width">270dp</dimen>
<dimen name="selected_date_layout_height">155dp</dimen>
<dimen name="done_button_height">42dp</dimen>
<dimen name="date_picker_component_width">270dp</dimen>
<dimen name="date_picker_header_height">30dp</dimen>
<dimen name="selected_calendar_layout_height">155dp</dimen>
<dimen name="date_picker_view_animator_height">270dp</dimen>
<dimen name="done_button_height">42dp</dimen>
<dimen name="month_list_item_header_height">50dp</dimen>
<dimen name="month_day_label_text_size">10sp</dimen>
<dimen name="day_number_select_circle_radius">16dp</dimen>
......
......@@ -183,8 +183,8 @@ public class SimpleMonthView extends View {
DAY_SELECTED_CIRCLE_SIZE = res
.getDimensionPixelSize(R.dimen.day_number_select_circle_radius);
mRowHeight = (res.getDimensionPixelOffset(R.dimen.pager_height) - MONTH_HEADER_SIZE)
/ MAX_NUM_ROWS;
mRowHeight = (res.getDimensionPixelOffset(R.dimen.date_picker_view_animator_height)
- MONTH_HEADER_SIZE) / MAX_NUM_ROWS;
// Sets up any standard paints that will be used
initView();
}
......
......@@ -51,13 +51,13 @@ public class YearPickerView extends ListView implements OnItemClickListener, OnD
super(context);
mController = controller;
mController.registerOnDateChangedListener(this);
setVerticalFadingEdgeEnabled(true);
ViewGroup.LayoutParams frame = new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
setLayoutParams(frame);
Resources res = context.getResources();
mViewSize = res.getDimensionPixelOffset(R.dimen.pager_height);
mViewSize = res.getDimensionPixelOffset(R.dimen.date_picker_view_animator_height);
mChildSize = res.getDimensionPixelOffset(R.dimen.year_label_height);
setVerticalFadingEdgeEnabled(true);
setFadingEdgeLength(mChildSize / 3);
init(context);
setOnItemClickListener(this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment