alarm_time.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- Copyright (C) 2008 The Android Open Source Project
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. -->
  13. <LinearLayout
  14. xmlns:android="http://schemas.android.com/apk/res/android"
  15. android:layout_width="match_parent"
  16. android:layout_height="wrap_content"
  17. android:orientation="horizontal">
  18. <!-- I can't use a normal checkbox here for a couple reasons:
  19. 1. The checkbox button resources cannot contain layouts so I have to
  20. use 2 views for the clock and the bar.
  21. 2. The normal checkbox has a really messed up layout. Using the button
  22. attribute produces a left-aligned image that has some kind of
  23. minimum height. If the bar is a checkbox, it is too tall and is
  24. clipped on the right.
  25. -->
  26. <com.cn.daming.deskclock.DontPressWithParentLayout android:id="@+id/indicator"
  27. style="@style/alarm_list_left_column"
  28. android:background="@drawable/clock_selector"
  29. android:gravity="center"
  30. android:orientation="vertical">
  31. <CheckBox android:id="@+id/clock_onoff"
  32. android:focusable="false"
  33. android:clickable="false"
  34. android:background="@drawable/indicator_clock_onoff"
  35. android:duplicateParentState="true"
  36. android:layout_height="wrap_content"
  37. android:layout_width="wrap_content"
  38. android:layout_gravity="center"
  39. android:button="@null" />
  40. <ImageView android:id="@+id/bar_onoff"
  41. android:layout_width="wrap_content"
  42. android:layout_height="wrap_content"
  43. android:layout_gravity="center"
  44. android:paddingTop="4dip"
  45. android:src="@drawable/ic_indicator_off" />
  46. </com.cn.daming.deskclock.DontPressWithParentLayout>
  47. <!-- note by wangxianming android:background="?android:attr/windowBackground" -->
  48. <ImageView
  49. android:src="@drawable/divider_vertical_dark"
  50. android:layout_width="wrap_content"
  51. android:layout_height="match_parent"
  52. android:paddingTop="4dip"
  53. android:paddingBottom="4dip"
  54. android:scaleType="fitXY"
  55. android:gravity="fill_vertical" />
  56. <!-- A layout that displays the time. Shows time, am/pm (if 12-hour),
  57. and an optional line below, used for day/days of week -->
  58. <com.cn.daming.deskclock.DigitalClock android:id="@+id/digitalClock"
  59. android:layout_width="wrap_content"
  60. android:layout_height="match_parent"
  61. android:gravity="center_vertical"
  62. android:layout_weight="1"
  63. android:orientation="vertical"
  64. android:paddingLeft="16dip"
  65. android:paddingRight="16dip">
  66. <LinearLayout
  67. android:layout_width="match_parent"
  68. android:layout_height="wrap_content"
  69. android:baselineAligned="true">
  70. <TextView android:id="@+id/timeDisplay"
  71. android:includeFontPadding="false"
  72. android:layout_width="wrap_content"
  73. android:layout_height="wrap_content"
  74. android:paddingRight="6dip"
  75. android:textSize="28sp"
  76. android:textColor="?android:attr/textColorPrimary"/>
  77. <TextView android:id="@+id/am_pm"
  78. android:layout_width="wrap_content"
  79. android:layout_height="wrap_content"
  80. android:textAppearance="?android:attr/textAppearanceSmall"
  81. android:textStyle="bold"
  82. android:textColor="?android:attr/textColorPrimary"/>
  83. <TextView android:id="@+id/label"
  84. android:layout_width="wrap_content"
  85. android:layout_height="wrap_content"
  86. android:layout_weight="1"
  87. android:paddingLeft="8dip"
  88. android:textAppearance="?android:attr/textAppearanceSmall"
  89. android:textColor="?android:attr/textColorTertiary"
  90. android:textStyle="bold"
  91. android:gravity="right"
  92. android:singleLine="true"/>
  93. </LinearLayout>
  94. <TextView android:id="@+id/daysOfWeek"
  95. android:includeFontPadding="false"
  96. android:layout_width="match_parent"
  97. android:layout_height="wrap_content"
  98. android:textAppearance="?android:attr/textAppearanceSmall"
  99. android:textColor="?android:attr/textColorSecondary"/>
  100. </com.cn.daming.deskclock.DigitalClock>
  101. </LinearLayout>