Skip to content

Commit 22466ea

Browse files
feat: card layout for Generate Config layout (#2210)
1 parent f6f7ddc commit 22466ea

File tree

3 files changed

+77
-58
lines changed

3 files changed

+77
-58
lines changed

app/src/main/res/layout/activity_create_config.xml

+74-56
Original file line numberDiff line numberDiff line change
@@ -18,66 +18,85 @@
1818
android:orientation="vertical"
1919
android:padding="@dimen/config_activity_padding">
2020

21-
<LinearLayout
22-
android:id="@+id/select_instrument"
21+
<android.support.v7.widget.CardView
2322
android:layout_width="match_parent"
24-
android:layout_height="@dimen/height_zero"
25-
android:layout_weight="@dimen/weight_one"
26-
android:orientation="horizontal">
27-
28-
<TextView
29-
android:id="@+id/select_instrument_title"
30-
style="@style/Base.TextAppearance.AppCompat.Title"
31-
android:layout_width="@dimen/width_zero"
32-
android:layout_weight="@dimen/weight_one"
33-
android:textSize="@dimen/text_size_of_label"
34-
android:layout_height="wrap_content"
35-
android:layout_gravity="center"
36-
android:text="@string/select_instrument_title" />
37-
38-
<android.support.v7.widget.AppCompatSpinner
39-
android:id="@+id/select_instrument_spinner"
40-
android:layout_width="@dimen/width_zero"
41-
android:layout_weight="@dimen/weight_two"
23+
android:layout_height="wrap_content"
24+
android:layout_margin="@dimen/card_margin"
25+
android:padding="@dimen/card_margin"
26+
app:cardCornerRadius="@dimen/accel_card_radius"
27+
app:cardElevation="@dimen/card_elevation">
28+
29+
<LinearLayout
30+
android:id="@+id/select_instrument"
31+
android:orientation="horizontal"
32+
android:layout_width="match_parent"
4233
android:layout_height="wrap_content"
43-
android:layout_gravity="center"
44-
android:textAlignment="center" />
45-
</LinearLayout>
46-
47-
<LinearLayout
34+
android:paddingTop="@dimen/create_config_padding"
35+
android:paddingBottom="@dimen/create_config_padding"
36+
android:layout_marginStart="@dimen/create_config_margin1">
37+
38+
<TextView
39+
android:id="@+id/select_instrument_title"
40+
style="@style/Base.TextAppearance.AppCompat.Title"
41+
android:layout_width="@dimen/width_zero"
42+
android:layout_weight="@dimen/weight_one"
43+
android:textSize="@dimen/text_size_of_label"
44+
android:layout_height="wrap_content"
45+
android:layout_gravity="center"
46+
android:text="@string/select_instrument_title" />
47+
48+
<android.support.v7.widget.AppCompatSpinner
49+
android:id="@+id/select_instrument_spinner"
50+
android:layout_width="@dimen/width_zero"
51+
android:layout_weight="@dimen/weight_two"
52+
android:layout_height="wrap_content"
53+
android:layout_gravity="center"
54+
android:textAlignment="center" />
55+
</LinearLayout>
56+
</android.support.v7.widget.CardView>
57+
58+
<android.support.v7.widget.CardView
4859
android:layout_width="match_parent"
49-
android:layout_height="@dimen/height_zero"
50-
android:layout_weight="@dimen/weight_one"
60+
android:layout_height="wrap_content"
61+
android:layout_margin="@dimen/card_margin"
5162
android:layout_marginTop="@dimen/create_config_margin1"
52-
android:orientation="horizontal">
63+
app:cardCornerRadius="@dimen/accel_card_radius"
64+
app:cardElevation="@dimen/card_elevation">
5365

54-
<TextView
55-
android:id="@+id/time_interval_title"
56-
style="@style/Base.TextAppearance.AppCompat.Title"
57-
android:layout_width="wrap_content"
58-
android:textSize="@dimen/text_size_of_label"
66+
<LinearLayout
67+
android:layout_width="match_parent"
5968
android:layout_height="wrap_content"
60-
android:layout_gravity="center"
61-
android:text="@string/time_interval_title" />
62-
63-
<EditText
64-
android:id="@+id/interval_edit_text"
65-
android:layout_width="@dimen/width_zero"
66-
android:layout_weight="@dimen/weight_three"
67-
android:layout_height="wrap_content"
68-
android:hint="@string/time_interval_hint"
69-
android:imeOptions="actionDone"
70-
android:inputType="number"
71-
android:textAlignment="center"
72-
android:layout_gravity="center"/>
73-
74-
<android.support.v7.widget.AppCompatSpinner
75-
android:id="@+id/interval_unit_spinner"
76-
android:layout_width="@dimen/width_zero"
77-
android:layout_weight="@dimen/weight_one"
78-
android:layout_height="wrap_content"
79-
android:layout_gravity="center"/>
80-
</LinearLayout>
69+
android:orientation="horizontal"
70+
android:layout_marginStart="@dimen/create_config_margin1">
71+
72+
<TextView
73+
android:id="@+id/time_interval_title"
74+
style="@style/Base.TextAppearance.AppCompat.Title"
75+
android:layout_width="wrap_content"
76+
android:textSize="@dimen/text_size_of_label"
77+
android:layout_height="wrap_content"
78+
android:layout_gravity="center"
79+
android:text="@string/time_interval_title" />
80+
81+
<EditText
82+
android:id="@+id/interval_edit_text"
83+
android:layout_width="@dimen/width_zero"
84+
android:layout_weight="@dimen/weight_three"
85+
android:layout_height="wrap_content"
86+
android:hint="@string/time_interval_hint"
87+
android:imeOptions="actionDone"
88+
android:inputType="number"
89+
android:textAlignment="center"
90+
android:layout_gravity="center" />
91+
92+
<android.support.v7.widget.AppCompatSpinner
93+
android:id="@+id/interval_unit_spinner"
94+
android:layout_width="@dimen/width_zero"
95+
android:layout_weight="@dimen/weight_one"
96+
android:layout_height="wrap_content"
97+
android:layout_gravity="center" />
98+
</LinearLayout>
99+
</android.support.v7.widget.CardView>
81100

82101
<TextView
83102
android:id="@+id/select_params_title"
@@ -93,8 +112,7 @@
93112
<android.support.v7.widget.RecyclerView
94113
android:id="@+id/params_list_container"
95114
android:layout_width="match_parent"
96-
android:layout_height="@dimen/height_zero"
97-
android:layout_weight="@dimen/weight_four"
115+
android:layout_height="wrap_content"
98116
android:layout_marginTop="@dimen/create_config_margin1" />
99117

100118
<Button

app/src/main/res/layout/item_checkbox.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
android:layout_width="match_parent"
55
android:layout_height="wrap_content"
6-
android:layout_margin="@dimen/check_box_magin"
6+
android:layout_margin="@dimen/check_box_margin"
77
app:cardCornerRadius="@dimen/check_box_corner">
88

99
<LinearLayout

app/src/main/res/values/dimens.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,9 @@
377377
<dimen name="create_config_margin3">22dp</dimen>
378378
<dimen name="create_config_margin4">12dp</dimen>
379379
<dimen name="create_config_recycler_view">280dp</dimen>
380+
<dimen name="create_config_padding">6dp</dimen>
380381
<dimen name="check_box_width">0dp</dimen>
381-
<dimen name="check_box_magin">5dp</dimen>
382+
<dimen name="check_box_margin">5dp</dimen>
382383
<dimen name="check_box_corner">5dp</dimen>
383384
<dimen name="sensor_sht21_margin">5dp</dimen>
384385
<dimen name="sht21_height">40dp</dimen>

0 commit comments

Comments
 (0)