diff options
author | Sam Blitzstein <sblitz@google.com> | 2013-09-05 17:53:26 -0700 |
---|---|---|
committer | Sam Blitzstein <sblitz@google.com> | 2013-09-05 19:37:41 -0700 |
commit | 1f129e23db2dc5837a856f7734b15a5a8be6be94 (patch) | |
tree | 952caee82ca0ae6814f045a489d24f4fffdce7a6 /res | |
parent | a35f6b580aefd7bf1c7e92306e13dacd44316714 (diff) | |
download | datetimepicker-1f129e23db2dc5837a856f7734b15a5a8be6be94.tar.gz |
Add setDarkTheme() to TimePicker.android-4.4_r0.7
This is just a temporary solution for the clock app. When the pickers
are framework-ready they will use the correct system-level factory
methods for setting dark themes.
Bug: 10516092
Change-Id: I0574de6f79f0d2973a80ea91bcc885e207f2fcf8
Diffstat (limited to 'res')
-rw-r--r-- | res/color/done_text_color.xml | 2 | ||||
-rw-r--r-- | res/color/done_text_color_dark.xml | 21 | ||||
-rw-r--r-- | res/drawable-land/done_background_color.xml | 25 | ||||
-rw-r--r-- | res/drawable-land/done_background_color_dark.xml | 25 | ||||
-rw-r--r-- | res/drawable/done_background_color.xml | 25 | ||||
-rw-r--r-- | res/drawable/done_background_color_dark.xml | 25 | ||||
-rw-r--r-- | res/layout-land/time_picker_dialog.xml | 23 | ||||
-rw-r--r-- | res/layout/time_header_label.xml | 1 | ||||
-rw-r--r-- | res/layout/time_picker_dialog.xml | 26 | ||||
-rw-r--r-- | res/values/colors.xml | 23 |
10 files changed, 160 insertions, 36 deletions
diff --git a/res/color/done_text_color.xml b/res/color/done_text_color.xml index e6e55ed..85d0e9e 100644 --- a/res/color/done_text_color.xml +++ b/res/color/done_text_color.xml @@ -16,6 +16,6 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:color="@color/done_text_color_disabled"/> - <item android:state_enabled="true" android:color="@color/done_text_color_normal"/> + <item android:color="@color/done_text_color_normal"/> </selector>
\ No newline at end of file diff --git a/res/color/done_text_color_dark.xml b/res/color/done_text_color_dark.xml new file mode 100644 index 0000000..070baf2 --- /dev/null +++ b/res/color/done_text_color_dark.xml @@ -0,0 +1,21 @@ +<?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. +--> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + + <item android:state_enabled="false" android:color="@color/done_text_color_dark_disabled"/> + <item android:color="@color/done_text_color_dark_normal"/> + +</selector>
\ No newline at end of file diff --git a/res/drawable-land/done_background_color.xml b/res/drawable-land/done_background_color.xml new file mode 100644 index 0000000..b2acf46 --- /dev/null +++ b/res/drawable-land/done_background_color.xml @@ -0,0 +1,25 @@ +<?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. +--> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_focused="true" + android:state_pressed="false" + android:drawable="@color/blue_focused" /> + + <item android:state_pressed="true" + android:drawable="@color/blue" /> + + <item android:drawable="@color/white" /> +</selector>
\ No newline at end of file diff --git a/res/drawable-land/done_background_color_dark.xml b/res/drawable-land/done_background_color_dark.xml new file mode 100644 index 0000000..8e499e4 --- /dev/null +++ b/res/drawable-land/done_background_color_dark.xml @@ -0,0 +1,25 @@ +<?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. +--> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_focused="true" + android:state_pressed="false" + android:drawable="@color/red_focused" /> + + <item android:state_pressed="true" + android:drawable="@color/red" /> + + <item android:drawable="@color/dark_gray" /> +</selector>
\ No newline at end of file diff --git a/res/drawable/done_background_color.xml b/res/drawable/done_background_color.xml new file mode 100644 index 0000000..19a3861 --- /dev/null +++ b/res/drawable/done_background_color.xml @@ -0,0 +1,25 @@ +<?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. +--> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_focused="true" + android:state_pressed="false" + android:drawable="@color/blue_focused" /> + + <item android:state_pressed="true" + android:drawable="@color/blue" /> + + <item android:drawable="@color/circle_background" /> +</selector>
\ No newline at end of file diff --git a/res/drawable/done_background_color_dark.xml b/res/drawable/done_background_color_dark.xml new file mode 100644 index 0000000..1665eee --- /dev/null +++ b/res/drawable/done_background_color_dark.xml @@ -0,0 +1,25 @@ +<?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. +--> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_focused="true" + android:state_pressed="false" + android:drawable="@color/red_focused" /> + + <item android:state_pressed="true" + android:drawable="@color/red" /> + + <item android:drawable="@color/light_gray" /> +</selector>
\ No newline at end of file diff --git a/res/layout-land/time_picker_dialog.xml b/res/layout-land/time_picker_dialog.xml index b24daf3..ed167af 100644 --- a/res/layout-land/time_picker_dialog.xml +++ b/res/layout-land/time_picker_dialog.xml @@ -29,6 +29,7 @@ android:layout_height="match_parent" android:orientation="vertical"> <FrameLayout + android:id="@+id/time_display_background" android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" @@ -40,25 +41,19 @@ android:layout_gravity="center" /> </FrameLayout> <View + android:id="@+id/line" android:layout_width="match_parent" android:layout_height="1dip" android:background="@color/line_background" /> - <LinearLayout - style="?android:attr/buttonBarStyle" + <Button + android:id="@+id/done_button" + android:background="@drawable/done_background_color" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal" - android:background="@color/white" > - <Button - android:id="@+id/done_button" - style="?android:attr/buttonBarButtonStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="48dp" - android:text="@string/done_label" - android:textSize="@dimen/done_label_size" - android:textColor="@color/done_text_color" /> - </LinearLayout> + android:minHeight="48dp" + android:text="@string/done_label" + android:textSize="@dimen/done_label_size" + android:textColor="@color/done_text_color" /> </LinearLayout> <com.android.datetimepicker.time.RadialPickerLayout android:id="@+id/time_picker" diff --git a/res/layout/time_header_label.xml b/res/layout/time_header_label.xml index cd4a834..56776ad 100644 --- a/res/layout/time_header_label.xml +++ b/res/layout/time_header_label.xml @@ -15,6 +15,7 @@ ~ limitations under the License --> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/time_display" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" diff --git a/res/layout/time_picker_dialog.xml b/res/layout/time_picker_dialog.xml index b4d2d1c..24b18c9 100644 --- a/res/layout/time_picker_dialog.xml +++ b/res/layout/time_picker_dialog.xml @@ -15,13 +15,13 @@ ~ limitations under the License --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/time_picker_dialog" android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="vertical" - android:background="@color/circle_background" - android:id="@+id/time_picker_dialog" android:focusable="true" > <FrameLayout + android:id="@+id/time_display_background" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/white" > @@ -36,25 +36,21 @@ android:layout_height="@dimen/picker_dimen" android:layout_width="wrap_content" android:layout_gravity="center" + android:background="@color/circle_background" android:focusable="true" android:focusableInTouchMode="true" /> <View + android:id="@+id/line" android:layout_width="match_parent" android:layout_height="1dip" android:background="@color/line_background" /> - <LinearLayout - style="?android:attr/buttonBarStyle" + <Button + android:id="@+id/done_button" + android:background="@drawable/done_background_color" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal" > - <Button - android:id="@+id/done_button" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="48dp" - android:text="@string/done_label" - android:textSize="@dimen/done_label_size" - android:textColor="@color/done_text_color" - style="?android:attr/buttonBarButtonStyle" /> - </LinearLayout> + android:minHeight="48dp" + android:text="@string/done_label" + android:textSize="@dimen/done_label_size" + android:textColor="@color/done_text_color" /> </LinearLayout> diff --git a/res/values/colors.xml b/res/values/colors.xml index ec1d495..8d92b47 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -20,16 +20,27 @@ <color name="circle_background">#f2f2f2</color> <color name="line_background">#cccccc</color> <color name="ampm_text_color">#8c8c8c</color> - <color name="done_text_color_normal">#333333</color> - <color name="done_text_color_disabled">#CCCCCC</color> + <color name="done_text_color_normal">#000000</color> + <color name="done_text_color_disabled">#cccccc</color> <color name="numbers_text_color">#8c8c8c</color> - <color name="transparent_black">#7F000000</color> + <color name="transparent_black">#7f000000</color> <color name="blue">#33b5e5</color> - <color name="darker_blue">#0099CC</color> - <color name="date_picker_text_normal">#FF999999</color> + <color name="blue_focused">#c1e8f7</color> + <color name="darker_blue">#0099cc</color> + <color name="date_picker_text_normal">#ff999999</color> <color name="calendar_header">#999999</color> <color name="date_picker_view_animator">#f2f2f2</color> - <color name="calendar_selected_date_text">#FFD1D2D4</color> + <color name="calendar_selected_date_text">#ffd1d2d4</color> + + <!-- Colors for red theme --> + <color name="red">#ff3333</color> + <color name="red_focused">#853333</color> + <color name="light_gray">#404040</color> + <color name="dark_gray">#363636</color> + <color name="line_dark">#808080</color> + <color name="done_text_color_dark_normal">#ffffff</color> + <color name="done_text_color_dark_disabled">#888888</color> + <color name="done_disabled_dark">#bfbfbf</color> </resources>
\ No newline at end of file |