item_price.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. android:layout_width="match_parent"
  5. android:paddingStart="@dimen/dp_20"
  6. android:paddingEnd="@dimen/dp_20"
  7. android:layout_height="@dimen/dp_45">
  8. <TextView
  9. android:id="@+id/item_title"
  10. android:layout_width="wrap_content"
  11. android:layout_height="wrap_content"
  12. android:textColor="#333"
  13. android:layout_centerVertical="true"
  14. android:hint="@string/setting_icecream_title"
  15. android:textStyle="bold"
  16. android:textSize="@dimen/sp_15" />
  17. <FrameLayout
  18. android:id="@+id/item_icon_frame"
  19. android:layout_width="wrap_content"
  20. android:layout_toStartOf="@id/item_name"
  21. android:layout_marginEnd="@dimen/dp_6"
  22. android:layout_height="wrap_content">
  23. <android.support.v7.widget.AppCompatImageView
  24. android:id="@+id/item_icon"
  25. android:layout_width="@dimen/dp_42"
  26. android:layout_height="@dimen/dp_42"
  27. android:padding="@dimen/dp_4"
  28. android:visibility="invisible"/>
  29. </FrameLayout>
  30. <android.support.v7.widget.AppCompatEditText
  31. android:id="@+id/item_name"
  32. android:layout_width="@dimen/dp_160"
  33. android:layout_height="wrap_content"
  34. android:gravity="center"
  35. android:singleLine="true"
  36. android:hint="@string/setting_icecream_name"
  37. android:layout_centerVertical="true"
  38. android:layout_toStartOf="@id/item_price"
  39. android:layout_marginEnd="@dimen/dp_12"
  40. android:selectAllOnFocus="true"
  41. android:textColor="@color/colorPrimaryDark"
  42. android:textColorHint="@color/color_999"
  43. android:textSize="@dimen/sp_15"
  44. android:textStyle="bold"/>
  45. <TextView
  46. android:layout_width="wrap_content"
  47. android:layout_height="wrap_content"
  48. android:textColor="#333"
  49. android:layout_centerVertical="true"
  50. android:layout_toStartOf="@id/item_price"
  51. android:layout_marginStart="@dimen/dp_12"
  52. android:text="@string/price_unit"
  53. android:textSize="@dimen/sp_15" />
  54. <android.support.v7.widget.AppCompatEditText
  55. android:id="@+id/item_price"
  56. android:layout_width="@dimen/dp_60"
  57. android:layout_height="wrap_content"
  58. android:gravity="center"
  59. android:singleLine="true"
  60. android:selectAllOnFocus="true"
  61. android:hint="@string/setting_icecream_price"
  62. android:inputType="numberDecimal"
  63. android:layout_centerVertical="true"
  64. android:layout_marginEnd="@dimen/dp_6"
  65. android:layout_toLeftOf="@id/item_switch"
  66. android:textColorHint="@color/color_999"
  67. android:textColor="@color/colorPrimaryDark"
  68. android:textSize="@dimen/sp_15"
  69. android:textStyle="bold"/>
  70. <LinearLayout
  71. android:id="@+id/item_switch"
  72. android:layout_width="wrap_content"
  73. android:layout_height="@dimen/dp_36"
  74. android:layout_centerVertical="true"
  75. android:layout_alignParentEnd="true"
  76. android:background="@drawable/bg_switch_off"
  77. android:orientation="horizontal">
  78. <View
  79. android:id="@+id/item_switch_icon"
  80. android:layout_width="@dimen/dp_32"
  81. android:layout_height="@dimen/dp_32"
  82. android:layout_margin="@dimen/dp_2"
  83. android:background="@drawable/circular_white" />
  84. <TextView
  85. android:id="@+id/item_switch_text"
  86. android:layout_width="@dimen/dp_50"
  87. android:layout_height="@dimen/dp_36"
  88. android:gravity="center"
  89. android:text="隐藏"
  90. android:textColor="@color/colorSwitchOff"
  91. android:textSize="@dimen/sp_16" />
  92. </LinearLayout>
  93. </RelativeLayout>