Skip to content

Commit

Permalink
feat: card layout for Generate Config layout (#2210)
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikaysharma01 authored Jun 4, 2021
1 parent f6f7ddc commit 22466ea
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 58 deletions.
130 changes: 74 additions & 56 deletions app/src/main/res/layout/activity_create_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,66 +18,85 @@
android:orientation="vertical"
android:padding="@dimen/config_activity_padding">

<LinearLayout
android:id="@+id/select_instrument"
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="@dimen/height_zero"
android:layout_weight="@dimen/weight_one"
android:orientation="horizontal">

<TextView
android:id="@+id/select_instrument_title"
style="@style/Base.TextAppearance.AppCompat.Title"
android:layout_width="@dimen/width_zero"
android:layout_weight="@dimen/weight_one"
android:textSize="@dimen/text_size_of_label"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/select_instrument_title" />

<android.support.v7.widget.AppCompatSpinner
android:id="@+id/select_instrument_spinner"
android:layout_width="@dimen/width_zero"
android:layout_weight="@dimen/weight_two"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_margin"
android:padding="@dimen/card_margin"
app:cardCornerRadius="@dimen/accel_card_radius"
app:cardElevation="@dimen/card_elevation">

<LinearLayout
android:id="@+id/select_instrument"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textAlignment="center" />
</LinearLayout>

<LinearLayout
android:paddingTop="@dimen/create_config_padding"
android:paddingBottom="@dimen/create_config_padding"
android:layout_marginStart="@dimen/create_config_margin1">

<TextView
android:id="@+id/select_instrument_title"
style="@style/Base.TextAppearance.AppCompat.Title"
android:layout_width="@dimen/width_zero"
android:layout_weight="@dimen/weight_one"
android:textSize="@dimen/text_size_of_label"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/select_instrument_title" />

<android.support.v7.widget.AppCompatSpinner
android:id="@+id/select_instrument_spinner"
android:layout_width="@dimen/width_zero"
android:layout_weight="@dimen/weight_two"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textAlignment="center" />
</LinearLayout>
</android.support.v7.widget.CardView>

<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="@dimen/height_zero"
android:layout_weight="@dimen/weight_one"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_margin"
android:layout_marginTop="@dimen/create_config_margin1"
android:orientation="horizontal">
app:cardCornerRadius="@dimen/accel_card_radius"
app:cardElevation="@dimen/card_elevation">

<TextView
android:id="@+id/time_interval_title"
style="@style/Base.TextAppearance.AppCompat.Title"
android:layout_width="wrap_content"
android:textSize="@dimen/text_size_of_label"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/time_interval_title" />

<EditText
android:id="@+id/interval_edit_text"
android:layout_width="@dimen/width_zero"
android:layout_weight="@dimen/weight_three"
android:layout_height="wrap_content"
android:hint="@string/time_interval_hint"
android:imeOptions="actionDone"
android:inputType="number"
android:textAlignment="center"
android:layout_gravity="center"/>

<android.support.v7.widget.AppCompatSpinner
android:id="@+id/interval_unit_spinner"
android:layout_width="@dimen/width_zero"
android:layout_weight="@dimen/weight_one"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
</LinearLayout>
android:orientation="horizontal"
android:layout_marginStart="@dimen/create_config_margin1">

<TextView
android:id="@+id/time_interval_title"
style="@style/Base.TextAppearance.AppCompat.Title"
android:layout_width="wrap_content"
android:textSize="@dimen/text_size_of_label"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/time_interval_title" />

<EditText
android:id="@+id/interval_edit_text"
android:layout_width="@dimen/width_zero"
android:layout_weight="@dimen/weight_three"
android:layout_height="wrap_content"
android:hint="@string/time_interval_hint"
android:imeOptions="actionDone"
android:inputType="number"
android:textAlignment="center"
android:layout_gravity="center" />

<android.support.v7.widget.AppCompatSpinner
android:id="@+id/interval_unit_spinner"
android:layout_width="@dimen/width_zero"
android:layout_weight="@dimen/weight_one"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</LinearLayout>
</android.support.v7.widget.CardView>

<TextView
android:id="@+id/select_params_title"
Expand All @@ -93,8 +112,7 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/params_list_container"
android:layout_width="match_parent"
android:layout_height="@dimen/height_zero"
android:layout_weight="@dimen/weight_four"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/create_config_margin1" />

<Button
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/item_checkbox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/check_box_magin"
android:layout_margin="@dimen/check_box_margin"
app:cardCornerRadius="@dimen/check_box_corner">

<LinearLayout
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,9 @@
<dimen name="create_config_margin3">22dp</dimen>
<dimen name="create_config_margin4">12dp</dimen>
<dimen name="create_config_recycler_view">280dp</dimen>
<dimen name="create_config_padding">6dp</dimen>
<dimen name="check_box_width">0dp</dimen>
<dimen name="check_box_magin">5dp</dimen>
<dimen name="check_box_margin">5dp</dimen>
<dimen name="check_box_corner">5dp</dimen>
<dimen name="sensor_sht21_margin">5dp</dimen>
<dimen name="sht21_height">40dp</dimen>
Expand Down

0 comments on commit 22466ea

Please sign in to comment.