Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve compass UI #2183

Merged
merged 4 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added app/src/main/res/drawable-hdpi/compass_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-ldpi/compass_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/compass_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/compass_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/main/res/drawable/compass_svg.png
Binary file not shown.
94 changes: 31 additions & 63 deletions app/src/main/res/layout/activity_compass.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,57 +8,50 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical">

<android.support.v7.widget.CardView
android:id="@+id/compass_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/card_margin"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginTop="@dimen/card_margin"
android:layout_marginEnd="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin">
android:layout_margin="@dimen/card_margin">

<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/card_margin">

<ImageView
android:id="@+id/compass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="@drawable/compass_svg" />
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_gravity="center"
android:layout_margin="@dimen/compass_margin"
android:src="@drawable/compass_icon" />

<TextView
android:id="@+id/degree_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/compass"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/card_margin"
android:text="@string/compass_test_value"
android:textAlignment="center"
android:textSize="@dimen/compass_text_size_large" />

</RelativeLayout>
</LinearLayout>

</android.support.v7.widget.CardView>

<android.support.v7.widget.CardView
android:id="@+id/card_compass_raw_values"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/compass_card"
android:layout_marginStart="@dimen/card_margin"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginTop="@dimen/card_margin"
android:layout_marginEnd="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin">
android:layout_margin="@dimen/card_margin">

<LinearLayout
android:layout_width="match_parent"
Expand All @@ -76,29 +69,26 @@
android:layout_width="@dimen/dimen_zero_dp"
android:layout_height="@dimen/compass_tv_height"
android:layout_weight="1"
android:gravity="center_vertical"
android:gravity="center"
android:text="@string/bx"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="@dimen/sensor_body_font" />

<TextView
android:layout_width="@dimen/dimen_zero_dp"
android:layout_height="@dimen/compass_tv_height"
android:layout_weight="1"
android:gravity="center_vertical"
android:gravity="center"
android:text="@string/by"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="@dimen/sensor_body_font" />

<TextView
android:layout_width="@dimen/dimen_zero_dp"
android:layout_height="@dimen/compass_tv_height"
android:layout_weight="1"
android:gravity="center_vertical"
android:gravity="center"
android:text="@string/bz"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="@dimen/sensor_body_font" />

Expand All @@ -114,44 +104,32 @@
android:id="@+id/tv_sensor_hmc5883l_bx"
android:layout_width="@dimen/dimen_zero_dp"
android:layout_height="@dimen/compass_tv_height"
android:layout_marginStart="@dimen/compass_tv_value_margin"
android:layout_marginLeft="@dimen/compass_tv_value_margin"
android:layout_marginEnd="@dimen/compass_tv_value_margin"
android:layout_marginRight="@dimen/compass_tv_value_margin"
android:layout_margin="@dimen/compass_tv_value_margin"
android:layout_weight="1"
android:background="@drawable/tv_border"
android:gravity="center_vertical"
android:textAlignment="center"
android:gravity="center"
android:textColor="@color/black"
android:textSize="@dimen/sensor_body_font" />

<TextView
android:id="@+id/tv_sensor_hmc5883l_by"
android:layout_width="@dimen/dimen_zero_dp"
android:layout_height="@dimen/compass_tv_height"
android:layout_marginStart="@dimen/compass_tv_value_margin"
android:layout_marginLeft="@dimen/compass_tv_value_margin"
android:layout_marginEnd="@dimen/compass_tv_value_margin"
android:layout_marginRight="@dimen/compass_tv_value_margin"
android:layout_margin="@dimen/compass_tv_value_margin"
android:layout_weight="1"
android:background="@drawable/tv_border"
android:gravity="center_vertical"
android:textAlignment="center"
android:gravity="center"
android:textColor="@color/black"
android:textSize="@dimen/sensor_body_font" />

<TextView
android:id="@+id/tv_sensor_hmc5883l_bz"
android:layout_width="@dimen/dimen_zero_dp"
android:layout_height="@dimen/compass_tv_height"
android:layout_marginStart="@dimen/compass_tv_value_margin"
android:layout_marginLeft="@dimen/compass_tv_value_margin"
android:layout_marginEnd="@dimen/compass_tv_value_margin"
android:layout_marginRight="@dimen/compass_tv_value_margin"
android:layout_margin="@dimen/compass_tv_value_margin"
android:layout_weight="1"
android:background="@drawable/tv_border"
android:gravity="center_vertical"
android:textAlignment="center"
android:gravity="center"
android:textColor="@color/black"
android:textSize="@dimen/sensor_body_font" />

Expand All @@ -165,35 +143,25 @@
android:id="@+id/card_select_axes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/card_compass_raw_values"
android:layout_marginStart="@dimen/card_margin"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginTop="@dimen/card_margin"
android:layout_marginEnd="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin"
android:layout_marginBottom="@dimen/header_padding_top">

<RelativeLayout
android:layout_margin="@dimen/card_margin">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/card_margin"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginTop="@dimen/card_margin"
android:layout_marginBottom="@dimen/card_margin">
android:layout_margin="@dimen/margin_10dp"
android:orientation="vertical">

<TextView
android:id="@+id/tv_select_axes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/compass_padding"
android:layout_marginLeft="@dimen/compass_padding"
android:layout_marginBottom="@dimen/margin_10dp"
android:text="@string/text_parallel_axes"
android:textSize="@dimen/compass_select_axes_text_size" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv_select_axes"
android:orientation="horizontal">

<RadioButton
Expand All @@ -218,11 +186,11 @@
android:text="@string/z_axis" />
</LinearLayout>

</RelativeLayout>
</LinearLayout>

</android.support.v7.widget.CardView>

</RelativeLayout>
</LinearLayout>

</ScrollView>

Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@

<dimen name="compass_padding">4dp</dimen>
<dimen name="compass_tv_height">30dp</dimen>
<dimen name="compass_tv_value_margin">20dp</dimen>
<dimen name="compass_tv_value_margin">8dp</dimen>
<dimen name="compass_select_axes_text_size">18sp</dimen>
<dimen name="compass_text_size_large">25sp</dimen>
<dimen name="compass_space_top">120dp</dimen>
Expand Down Expand Up @@ -397,10 +397,15 @@
<dimen name="sound_guage_font_size">8sp</dimen>
<dimen name="sound_sensor_label_title_size">16sp</dimen>
<dimen name="sound_width_0">0dp</dimen>

<dimen name="compass_margin">15dp</dimen>
<dimen name="margin_10dp">10dp</dimen>

<dimen name="sensor_control_dock_image_button_width">60dp</dimen>
<dimen name="margin_50dp">50dp</dimen>
<dimen name="margin_5dp">5dp</dimen>
<dimen name="text_size_8sp">8sp</dimen>
<dimen name="sensor_image_height">90dp</dimen>
<dimen name="text_size_9sp">9sp</dimen>

</resources>