Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
rockchip_frameworks_opt_datetimepicker
Commits
ddf949ac
Commit
ddf949ac
authored
12 years ago
by
James Kung
Browse files
Options
Download
Email Patches
Plain Diff
Layout for smaller devices e.g. Nexus S
Bug: Change-Id: I210fbab377f49ec58bfa811d76e3dc5172fede63
parent
9901acdd
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
228 additions
and
52 deletions
+228
-52
res/layout-land/date_picker_dialog.xml
res/layout-land/date_picker_dialog.xml
+2
-0
res/layout-sw270dp-h560dp-land/date_picker_dialog.xml
res/layout-sw270dp-h560dp-land/date_picker_dialog.xml
+61
-0
res/layout-sw270dp-h560dp/date_picker_dialog.xml
res/layout-sw270dp-h560dp/date_picker_dialog.xml
+42
-0
res/layout/date_picker_header_view.xml
res/layout/date_picker_header_view.xml
+25
-0
res/layout/date_picker_selected_date.xml
res/layout/date_picker_selected_date.xml
+31
-48
res/values-land/dimens.xml
res/values-land/dimens.xml
+5
-0
res/values-sw270dp-h560dp-land/dimens.xml
res/values-sw270dp-h560dp-land/dimens.xml
+28
-0
res/values-sw270dp-h560dp/dimens.xml
res/values-sw270dp-h560dp/dimens.xml
+28
-0
res/values/dimens.xml
res/values/dimens.xml
+2
-2
src/com/android/datetimepicker/date/DatePickerDialog.java
src/com/android/datetimepicker/date/DatePickerDialog.java
+4
-2
No files found.
res/layout-land/date_picker_dialog.xml
View file @
ddf949ac
...
...
@@ -27,6 +27,8 @@
android:background=
"@color/white"
android:orientation=
"vertical"
>
<include
layout=
"@layout/date_picker_header_view"
/>
<include
layout=
"@layout/date_picker_selected_date"
/>
<View
...
...
This diff is collapsed.
Click to expand it.
res/layout-sw270dp-h560dp-land/date_picker_dialog.xml
0 → 100644
View file @
ddf949ac
<?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.
-->
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/date_picker_dialog_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_gravity=
"center"
android:background=
"@color/white"
android:orientation=
"vertical"
>
<include
layout=
"@layout/date_picker_header_view"
/>
<include
layout=
"@layout/date_picker_selected_date"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dip"
android:background=
"@color/line_background"
/>
<include
layout=
"@layout/date_picker_done_button"
/>
</LinearLayout>
<View
android:layout_width=
"1dip"
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>
</LinearLayout>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
res/layout-sw270dp-h560dp/date_picker_dialog.xml
0 → 100644
View file @
ddf949ac
<?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.
-->
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"@dimen/date_picker_width"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:orientation=
"vertical"
android:background=
"@color/calendar_pager"
>
<include
layout=
"@layout/date_picker_header_view"
/>
<include
layout=
"@layout/date_picker_selected_date"
android:id=
"@+id/date_picker_selected_date_layout"
/>
<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"
/>
<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"
/>
</LinearLayout>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
res/layout/date_picker_header_view.xml
0 → 100644
View file @
ddf949ac
<?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.
-->
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/date_picker_header"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/date_picker_header_height"
android:background=
"@color/calendar_header"
android:gravity=
"center"
android:includeFontPadding=
"false"
android:textColor=
"@color/white"
android:textSize=
"@dimen/date_picker_header_text_size"
/>
This diff is collapsed.
Click to expand it.
res/layout/date_picker_selected_date.xml
View file @
ddf949ac
...
...
@@ -14,73 +14,56 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<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_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/date_picker_header"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/date_picker_header_height"
android:background=
"@color/calendar_header"
android:gravity=
"center"
android:includeFontPadding=
"false"
android:textColor=
"@color/white"
android:textSize=
"@dimen/date_picker_header_text_size"
/>
<LinearLayout
android:id=
"@+id/date_picker_month_and_day"
android:layout_width=
"match_parent"
android:layout_height=
"0dip"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"vertical"
>
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:clickable=
"true"
android:orientation=
"vertical"
android:textColor=
"@color/date_picker_selector"
>
<
LinearLayout
android:id=
"@+id/date_picker_month
_and_day
"
<
TextView
android:id=
"@+id/date_picker_month"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:clickable=
"true"
android:orientation=
"vertical"
android:textColor=
"@color/date_picker_selector"
>
<TextView
android:id=
"@+id/date_picker_month"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:duplicateParentState=
"true"
android:gravity=
"center_horizontal|bottom"
android:includeFontPadding=
"false"
android:textColor=
"@color/date_picker_selector"
android:textSize=
"@dimen/selected_date_month_size"
/>
<TextView
android:id=
"@+id/date_picker_day"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginBottom=
"-10dip"
android:layout_marginTop=
"-10dip"
android:duplicateParentState=
"true"
android:gravity=
"center"
android:includeFontPadding=
"false"
android:textColor=
"@color/date_picker_selector"
android:textSize=
"@dimen/selected_date_day_size"
/>
</LinearLayout>
android:duplicateParentState=
"true"
android:gravity=
"center_horizontal|bottom"
android:includeFontPadding=
"false"
android:textColor=
"@color/date_picker_selector"
android:textSize=
"@dimen/selected_date_month_size"
/>
<TextView
android:id=
"@+id/date_picker_
year
"
android:id=
"@+id/date_picker_
day
"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center_horizontal|top"
android:layout_marginBottom=
"-10dip"
android:layout_marginTop=
"-10dip"
android:duplicateParentState=
"true"
android:gravity=
"center"
android:includeFontPadding=
"false"
android:textColor=
"@color/date_picker_selector"
android:textSize=
"@dimen/selected_date_
year
_size"
/>
android:textSize=
"@dimen/selected_date_
day
_size"
/>
</LinearLayout>
<TextView
android:id=
"@+id/date_picker_year"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center_horizontal|top"
android:includeFontPadding=
"false"
android:textColor=
"@color/date_picker_selector"
android:textSize=
"@dimen/selected_date_year_size"
/>
</LinearLayout>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
res/values-land/dimens.xml
View file @
ddf949ac
...
...
@@ -23,4 +23,9 @@
<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>
</resources>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
res/values-sw270dp-h560dp-land/dimens.xml
0 → 100644
View file @
ddf949ac
<?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
This diff is collapsed.
Click to expand it.
res/values-sw270dp-h560dp/dimens.xml
0 → 100644
View file @
ddf949ac
<?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
This diff is collapsed.
Click to expand it.
res/values/dimens.xml
View file @
ddf949ac
...
...
@@ -43,7 +43,7 @@
<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"
>
240
dp
</dimen>
<dimen
name=
"selected_date_layout_height"
>
155
dp
</dimen>
<dimen
name=
"done_button_height"
>
42dp
</dimen>
<dimen
name=
"date_picker_header_height"
>
30dp
</dimen>
<dimen
name=
"month_list_item_header_height"
>
50dp
</dimen>
...
...
@@ -52,7 +52,7 @@
<dimen
name=
"day_number_select_circle_radius"
>
16dp
</dimen>
<dimen
name=
"month_select_circle_radius"
>
24dp
</dimen>
<dimen
name=
"selected_date_year_size"
>
30dp
</dimen>
<dimen
name=
"selected_date_day_size"
>
100
dp
</dimen>
<dimen
name=
"selected_date_day_size"
>
75
dp
</dimen>
<dimen
name=
"selected_date_month_size"
>
30dp
</dimen>
<dimen
name=
"date_picker_header_text_size"
>
14dp
</dimen>
<dimen
name=
"month_label_size"
>
16sp
</dimen>
...
...
This diff is collapsed.
Click to expand it.
src/com/android/datetimepicker/date/DatePickerDialog.java
View file @
ddf949ac
...
...
@@ -242,8 +242,10 @@ public class DatePickerDialog extends DialogFragment implements
}
private
void
updateDisplay
()
{
mDayOfWeekView
.
setText
(
mCalendar
.
getDisplayName
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
LONG
,
Locale
.
getDefault
()).
toUpperCase
(
Locale
.
getDefault
()));
if
(
mDayOfWeekView
!=
null
)
{
mDayOfWeekView
.
setText
(
mCalendar
.
getDisplayName
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
LONG
,
Locale
.
getDefault
()).
toUpperCase
(
Locale
.
getDefault
()));
}
mSelectedMonthTextView
.
setText
(
mCalendar
.
getDisplayName
(
Calendar
.
MONTH
,
Calendar
.
SHORT
,
Locale
.
getDefault
()).
toUpperCase
(
Locale
.
getDefault
()));
mSelectedDayTextView
.
setText
(
DAY_FORMAT
.
format
(
mCalendar
.
getTime
()));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment