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

Fixes #2070 Add missing elements to Oscilloscope layout for tablets #2120

Merged
merged 5 commits into from
Jul 22, 2020
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
12 changes: 7 additions & 5 deletions app/src/main/java/io/pslab/activity/WaveGeneratorActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ public class WaveGeneratorActivity extends AppCompatActivity {
private boolean isPlayingSound = false;
private ProduceSoundTask produceSoundTask;

private AudioTrack track;

@SuppressLint("ClickableViewAccessibility")
@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -1311,8 +1313,6 @@ public final int getValue() {

private class ProduceSoundTask extends AsyncTask<Void, Void, Void> {

private AudioTrack track;

@Override
protected Void doInBackground(Void... voids) {
short[] buffer = new short[1024];
Expand Down Expand Up @@ -1349,9 +1349,11 @@ protected Void doInBackground(Void... voids) {
@Override
protected void onCancelled() {
super.onCancelled();
track.flush();
track.stop();
track.release();
if (track != null) {
track.flush();
track.stop();
track.release();
}
}
}
}
291 changes: 0 additions & 291 deletions app/src/main/res/layout-sw600dp/activity_oscilloscope.xml

This file was deleted.

15 changes: 7 additions & 8 deletions app/src/main/res/layout/activity_oscilloscope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/top_app_bar_layout"
android:layout_marginTop="@dimen/osc_main_margin"
android:layout_marginStart="@dimen/osc_main_margin">
android:layout_marginStart="@dimen/osc_main_margin"
android:layout_marginTop="@dimen/osc_main_margin">

<RelativeLayout
android:id="@+id/layout_chart_os"
Expand Down Expand Up @@ -190,12 +190,12 @@
android:id="@+id/layout_dock_os1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/osc_main_margin"
android:layout_marginBottom="@dimen/osc_main_margin"
android:layout_toEndOf="@+id/layout_chart_os"
android:layout_toRightOf="@+id/layout_chart_os"
android:background="@drawable/rounded_custom_border_2"
android:orientation="vertical"
android:layout_marginBottom="@dimen/osc_main_margin"
android:layout_marginEnd="@dimen/osc_main_margin">
android:orientation="vertical">

<ImageButton
android:id="@+id/button_channel_parameters_os"
Expand Down Expand Up @@ -311,12 +311,11 @@
android:layout_height="match_parent"
android:layout_below="@+id/layout_chart_os"
android:layout_alignParentStart="true"
android:layout_marginEnd="@dimen/osc_main_margin"
android:layout_marginTop="@dimen/osc_main_margin"
android:layout_marginEnd="@dimen/osc_main_margin"
android:layout_marginBottom="@dimen/osc_main_margin"
android:layout_toStartOf="@+id/layout_dock_os1">
android:layout_toStartOf="@+id/layout_dock_os1" />

</FrameLayout>
</RelativeLayout>

<View
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-sw600dp/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
<dimen name="ctrl_title_text_margin">3dp</dimen>
<dimen name="btn_min_width">80dp</dimen>
<dimen name="mon_title_sep_margin">16dp</dimen>

<dimen name="extra_space_top">72dp</dimen>
<dimen name="osc_chart_width">1000dp</dimen>
<dimen name="osc_chart_height">600dp</dimen>
</resources>
6 changes: 3 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@
<string name="pressure">Pressure</string>
<string name="gyro_range">Set Gyro Range</string>
<string name="accel_range">Set Accel Range</string>
<string name="kalman">Kalman filter</string>
<string name="kalman">Kalman Filter</string>
<string name="power_up">Power Up</string>
<string name="full_spectrum">Full spectrum</string>
<string name="full_spectrum">Full Spectrum</string>
<string name="infrared">Infrared</string>
<string name="visible">Visible</string>
<string name="set_gain">Set Gain</string>
Expand Down Expand Up @@ -448,7 +448,7 @@
<string name="scanning">Scanning...</string>

<string name="voltage_unit">(V)</string>
<string name="volts">volts</string>
<string name="volts">Volts</string>
<string name="seconds">(s)</string>
<string name="lux">Lx</string>
<string name="pressure2">Press.</string>
Expand Down