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

fix: Wave generator UI changes #1957

Merged
merged 1 commit into from
Aug 26, 2019
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
184 changes: 74 additions & 110 deletions app/src/main/java/io/pslab/activity/WaveGeneratorActivity.java

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/src/main/res/drawable/btn_back_rounded.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<item android:state_enabled="false">
<shape android:shape="rectangle">
<solid android:color="@color/theme_red_light" />
<corners android:radius="5dp" />
<corners android:radius="@dimen/button_bg_radius" />
</shape>
</item>
<item android:state_enabled="true">
<shape android:shape="rectangle">
<solid android:color="@color/colorPrimary" />
<corners android:radius="5dp" />
<corners android:radius="@dimen/button_bg_radius" />
</shape>
</item>
</selector>
6 changes: 6 additions & 0 deletions app/src/main/res/drawable/btn_back_rounded_light.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/theme_red_light" />
<corners android:radius="@dimen/button_bg_radius" />
</shape>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_arrow_left_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M15.41,16.09l-4.58,-4.59 4.58,-4.59L14,5.5l-6,6 6,6z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_arrow_right_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M8.59,16.34l4.58,-4.59 -4.58,-4.59L10,5.75l6,6 -6,6z"/>
</vector>
62 changes: 6 additions & 56 deletions app/src/main/res/layout/wave_generator_analog_mode_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/square_mode_layout"
android:layout_width="@dimen/length_0dp"
android:layout_height="@dimen/length_0dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/card_separation_offset"
android:background="@color/black">

Expand All @@ -15,14 +15,6 @@
app:layout_constraintGuide_begin="@dimen/constraint_guide_begin"
app:layout_constraintGuide_percent="0.5" />

<android.support.constraint.Guideline
android:id="@+id/fguideline3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_begin="@dimen/constraint_guide_begin"
app:layout_constraintGuide_percent="0.20" />

<android.support.constraint.Guideline
android:id="@+id/fguideline9"
android:layout_width="wrap_content"
Expand All @@ -37,7 +29,7 @@
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="@dimen/constraint_guide_begin"
app:layout_constraintGuide_percent="0.35" />
app:layout_constraintGuide_percent="0.20" />

<ImageView
android:id="@+id/wave_ic_img"
Expand All @@ -46,42 +38,11 @@
app:layout_constraintBottom_toTopOf="@+id/wave_mon_select_wave"
app:layout_constraintEnd_toStartOf="@+id/fguideline10"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/fguideline3"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.45"
app:layout_constraintVertical_chainStyle="packed"
app:srcCompat="@drawable/ic_triangular" />

<TextView
android:id="@+id/wave_mon_wave1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/mon_title_sep_margin"
android:enabled="false"
android:text="@string/wave1"
android:textColor="@drawable/text_color_selector"
android:textSize="@dimen/text_size_wavegen"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/fguideline3"
app:layout_constraintEnd_toStartOf="@+id/fguideline2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/wave_mon_wave2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/mon_title_sep_margin"
android:enabled="false"
android:text="@string/wave2"
android:textColor="@drawable/text_color_selector"
android:textSize="@dimen/text_size_wavegen"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/wave_mon_wave1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/fguideline2"
app:layout_constraintTop_toTopOf="@+id/wave_mon_wave1" />


<TextView
android:id="@+id/wave_mon_select_wave"
android:layout_width="wrap_content"
Expand All @@ -108,7 +69,7 @@
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/wave_phase"
app:layout_constraintStart_toStartOf="@+id/fguideline10"
app:layout_constraintTop_toTopOf="@+id/fguideline3"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />

<TextView
Expand Down Expand Up @@ -186,20 +147,9 @@
android:background="@color/dark_grey"
app:layout_constraintBottom_toTopOf="@+id/fguideline9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.35"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/fguideline3" />

<View
android:layout_width="@dimen/length_0dp"
android:layout_height="@dimen/divider_width"
android:background="@color/dark_grey"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.20"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.20" />
app:layout_constraintTop_toTopOf="parent" />

<View
android:layout_width="@dimen/length_0dp"
Expand Down
87 changes: 5 additions & 82 deletions app/src/main/res/layout/wave_generator_digital_mode_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/pwm_mode_layout"
android:layout_width="@dimen/length_0dp"
android:layout_height="@dimen/length_0dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/card_separation_offset"
android:background="@color/black">

<android.support.constraint.Guideline
android:id="@+id/guideline3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_begin="@dimen/constraint_guide_begin"
app:layout_constraintGuide_percent="0.20" />

<android.support.constraint.Guideline
android:id="@+id/guideline9"
android:layout_width="wrap_content"
Expand Down Expand Up @@ -54,7 +46,7 @@
app:layout_constraintBottom_toTopOf="@+id/pwm_mon_mode_select"
app:layout_constraintEnd_toStartOf="@+id/guideline10"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/guideline3"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.45"
app:layout_constraintVertical_chainStyle="packed"
app:srcCompat="@drawable/ic_pwm_pic" />
Expand All @@ -73,64 +65,6 @@
app:layout_constraintStart_toStartOf="@+id/pwm_ic_img"
app:layout_constraintTop_toBottomOf="@+id/pwm_ic_img" />

<TextView
android:id="@+id/pwm_mon_sq1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="@string/text_sq1"
android:textColor="@drawable/text_color_selector"
android:textSize="@dimen/text_size_wavegen"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/guideline3"
app:layout_constraintEnd_toStartOf="@+id/pwm_mon_sq2"
app:layout_constraintStart_toStartOf="@+id/guideline12"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/pwm_mon_sq2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="@string/text_sq2"
android:textColor="@drawable/text_color_selector"
android:textSize="@dimen/text_size_wavegen"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/guideline3"
app:layout_constraintEnd_toStartOf="@+id/pwm_mon_sq3"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/pwm_mon_sq1"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/pwm_mon_sq3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="@string/text_sq3"
android:textColor="@drawable/text_color_selector"
android:textSize="@dimen/text_size_wavegen"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/guideline3"
app:layout_constraintEnd_toStartOf="@+id/pwm_mon_sq4"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/pwm_mon_sq2"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/pwm_mon_sq4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="@string/text_sq4"
android:textColor="@drawable/text_color_selector"
android:textSize="@dimen/text_size_wavegen"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/guideline3"
app:layout_constraintEnd_toStartOf="@+id/guideline13"
app:layout_constraintStart_toEndOf="@+id/pwm_mon_sq3"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/pwm_freq"
android:layout_width="wrap_content"
Expand All @@ -142,7 +76,7 @@
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/pwm_phase"
app:layout_constraintStart_toStartOf="@+id/guideline10"
app:layout_constraintTop_toTopOf="@+id/guideline3"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />

<TextView
Expand Down Expand Up @@ -222,18 +156,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.20"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/guideline3" />

<View
android:layout_width="@dimen/length_0dp"
android:layout_height="@dimen/divider_width"
android:background="@color/dark_grey"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.20"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.20" />
app:layout_constraintTop_toTopOf="parent" />

<View
android:layout_width="@dimen/length_0dp"
Expand Down
25 changes: 20 additions & 5 deletions app/src/main/res/layout/wave_generator_main_controls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,37 @@
android:text="@string/produce_sound_text"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="14sp" />
android:textSize="@dimen/wave_gen_control_text_size" />

<Button
android:id="@+id/pwm_btn_mode"
android:id="@+id/analog_mode_btn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/margin_btn"
android:layout_marginTop="@dimen/margin_btn"
android:layout_marginEnd="@dimen/margin_btn"
android:layout_marginBottom="@dimen/margin_btn"
android:layout_weight="1"
android:background="@drawable/btn_back_rounded"
android:minWidth="@dimen/btn_min_width"
android:stateListAnimator="@animator/selector_animator"
android:text="@string/mode"
android:text="@string/text_analog"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="@dimen/wave_gen_control_text_size" />
<Button
android:id="@+id/digital_mode_btn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/margin_btn"
android:layout_marginTop="@dimen/margin_btn"
android:layout_marginEnd="@dimen/margin_btn"
android:layout_marginBottom="@dimen/margin_btn"
android:layout_weight="1"
android:background="@drawable/btn_back_rounded_light"
android:minWidth="@dimen/btn_min_width"
android:stateListAnimator="@animator/selector_animator"
android:text="@string/text_digital"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="14sp" />
android:textSize="@dimen/wave_gen_control_text_size" />
</LinearLayout>
6 changes: 4 additions & 2 deletions app/src/main/res/layout/wave_generator_seekbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
android:id="@+id/img_btn_down"
android:layout_width="@dimen/length_0dp"
android:layout_height="wrap_content"
android:padding="@dimen/btn_padding"
android:layout_marginLeft="@dimen/seek_btn_margin"
android:layout_marginRight="@dimen/seek_btn_margin"
android:layout_weight="0.1"
android:background="@drawable/btn_back_rounded"
android:src="@drawable/ic_arrow_drop_down_black_24dp"
android:src="@drawable/ic_arrow_left_24dp"
android:stateListAnimator="@animator/selector_animator" />

<com.warkiz.widget.IndicatorSeekBar
Expand All @@ -38,11 +39,12 @@
android:id="@+id/img_btn_up"
android:layout_width="@dimen/length_0dp"
android:layout_height="wrap_content"
android:padding="@dimen/btn_padding"
android:layout_marginLeft="@dimen/seek_btn_margin"
android:layout_marginRight="@dimen/seek_btn_margin"
android:layout_weight="0.1"
android:background="@drawable/btn_back_rounded"
android:src="@drawable/ic_arrow_drop_up_black_24dp"
android:src="@drawable/ic_arrow_right_24dp"
android:stateListAnimator="@animator/selector_animator" />

</LinearLayout>
Loading