Skip to content

Commit 55a770b

Browse files
author
Artjom König
committed
Merge branch 'release/1.1.0'
2 parents 253e762 + 644d355 commit 55a770b

File tree

16 files changed

+47
-139
lines changed

16 files changed

+47
-139
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ local.properties
2121

2222
# Proguard folder generated by Eclipse
2323
proguard/
24+
datetimepicker.iml

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
StylableDateTimePicker
22
======================
33

4-
A styleable version of the date/time picker for Android 4.0+
4+
A styleable version of the date/time picker for Android 4.0+ with embedding support (using as normal fragment)
55

66
![Styled DatePicker](/../screenshots/screenshots/screenshot.png?raw=true "Example Theme")
77

@@ -15,6 +15,9 @@ Declare your style:
1515
<item name="buttonTextColor">...</item>
1616
<item name="circleHighlightColor">...</item>
1717
<item name="defaultTextColor">...</item>
18+
<item name="selectedDayTextSize">...</item>
19+
<item name="selectedMonthTextSize">...</item>
20+
<item name="selectedYearTextSize">...</item>
1821
</style>
1922
```
2023

@@ -23,3 +26,11 @@ Create the DatePicker/TimePicker with
2326
```java
2427
DatePickerDialog dialog = DatePickerDialog.newInstance(callBack, year, monthOfYear, dayOfMonth, R.style.DateTimePicker);
2528
```
29+
You can also add the pickers as content in your view hierarchy:
30+
31+
```java
32+
DatePickerDialog picker = DatePickerDialog.newInstance(...);
33+
FragmentTransaction ft = getFragmentManager().beginTransaction();
34+
ft.add(R.id.picker_wrapper, picker);
35+
ft.commit();
36+
```

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies {
1010

1111
android {
1212
compileSdkVersion 19
13-
buildToolsVersion "19.1.0"
13+
buildToolsVersion '19.1.0'
1414

1515
defaultConfig {
1616
minSdkVersion 14

datetimepicker.iml

Lines changed: 0 additions & 75 deletions
This file was deleted.

res/layout-w270dp-h560dp/date_picker_dialog.xml

Lines changed: 0 additions & 43 deletions
This file was deleted.

res/layout/date_picker_dialog.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,26 @@
1515
limitations under the License.
1616
-->
1717
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
18-
android:layout_width="@dimen/date_picker_component_width"
18+
android:layout_width="match_parent"
1919
android:layout_height="match_parent"
2020
android:background="@color/date_picker_view_animator"
2121
android:gravity="center"
2222
android:orientation="vertical" >
2323

2424
<LinearLayout
25-
android:layout_width="wrap_content"
26-
android:layout_height="@dimen/selected_calendar_layout_height"
25+
android:layout_width="match_parent"
26+
android:layout_height="wrap_content"
27+
android:layout_weight="1"
2728
android:orientation="vertical" >
2829

30+
<include layout="@layout/date_picker_header_view" />
2931
<include layout="@layout/date_picker_selected_date" />
3032
</LinearLayout>
3133

3234
<include layout="@layout/date_picker_view_animator" />
3335

3436
<View
35-
android:layout_width="@dimen/date_picker_component_width"
37+
android:layout_width="match_parent"
3638
android:layout_height="1dip"
3739
android:background="@color/line_background" />
3840

res/layout/date_picker_done_button.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
-->
1616
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
1717
style="?android:attr/buttonBarStyle"
18-
android:layout_width="@dimen/date_picker_component_width"
18+
android:layout_width="match_parent"
1919
android:layout_height="wrap_content"
2020
android:orientation="vertical" >
2121

res/layout/date_picker_header_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-->
1717
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
1818
android:id="@+id/date_picker_header"
19-
android:layout_width="@dimen/date_picker_component_width"
19+
android:layout_width="match_parent"
2020
android:layout_height="@dimen/date_picker_header_height"
2121
android:background="?headerBackgroundColor"
2222
android:gravity="center"

res/layout/date_picker_selected_date.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717

1818
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
1919
android:id="@+id/day_picker_selected_date_layout"
20-
android:layout_width="@dimen/date_picker_component_width"
21-
android:layout_height="0dip"
20+
android:layout_width="match_parent"
21+
android:layout_height="wrap_content"
2222
android:layout_weight="1"
2323
android:background="@color/white"
2424
android:gravity="center"
25+
android:padding="8dp"
2526
android:orientation="vertical" >
2627

2728
<com.android.datetimepicker.AccessibleLinearLayout
@@ -41,20 +42,18 @@
4142
android:gravity="center_horizontal|bottom"
4243
android:includeFontPadding="false"
4344
android:textColor="?hightlightedTextColor"
44-
android:textSize="@dimen/selected_date_month_size" />
45+
android:textSize="?selectedMonthTextSize" />
4546

4647
<TextView
4748
android:id="@+id/date_picker_day"
4849
android:layout_width="match_parent"
4950
android:layout_height="wrap_content"
5051
android:layout_gravity="center"
51-
android:layout_marginBottom="-10dip"
52-
android:layout_marginTop="-10dip"
5352
android:duplicateParentState="true"
5453
android:gravity="center"
5554
android:includeFontPadding="false"
5655
android:textColor="?hightlightedTextColor"
57-
android:textSize="@dimen/selected_date_day_size" />
56+
android:textSize="?selectedDayTextSize" />
5857
</com.android.datetimepicker.AccessibleLinearLayout>
5958

6059
<com.android.datetimepicker.AccessibleTextView
@@ -65,6 +64,6 @@
6564
android:gravity="center_horizontal|top"
6665
android:includeFontPadding="false"
6766
android:textColor="?hightlightedTextColor"
68-
android:textSize="@dimen/selected_date_year_size" />
67+
android:textSize="?selectedYearTextSize" />
6968

7069
</LinearLayout>

res/layout/date_picker_view_animator.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<com.android.datetimepicker.date.AccessibleDateAnimator
1717
xmlns:android="http://schemas.android.com/apk/res/android"
1818
android:id="@+id/animator"
19-
android:layout_width="@dimen/date_picker_component_width"
19+
android:layout_width="match_parent"
2020
android:layout_height="@dimen/date_picker_view_animator_height"
2121
android:gravity="center"
2222
android:background="@color/date_picker_view_animator" />

0 commit comments

Comments
 (0)