Skip to content

Commit

Permalink
small adjustments for release
Browse files Browse the repository at this point in the history
  • Loading branch information
sverbach committed Mar 25, 2021
1 parent f525596 commit 5952173
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
public class FrequencyCalculator {
private static final double RELEVANT_FREQ_MAX = 11100.0;
private static final double RELEVANT_FREQ_MIN = 9500.0;
private static final double MIN_DB = -75;
private RealDoubleFFT spectrumAmpFFT;
private double[] spectrumAmpOutCum;
private double[] spectrumAmpOutTmp;
Expand Down Expand Up @@ -143,7 +144,7 @@ public double getFreq() {

if (hitCount > 0) medianFreq = medianFreq / hitCount;

if (medianFreq > -70) {
if (medianFreq > MIN_DB) {
maxAmpFreq = maxRelevantFreqIndex;
}

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
android:background="@drawable/radius_background"
android:columnCount="2"
android:padding="10dp"
android:rowCount="3">
android:rowCount="3"
android:visibility="invisible">

<TextView
android:layout_width="wrap_content"
Expand Down
111 changes: 59 additions & 52 deletions app/src/main/res/layout/fragment_tutorial_step.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,73 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<GridLayout
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rowCount="4"
android:layout_centerVertical="true"
android:columnCount="1"
android:layout_centerHorizontal="true">
android:layout_centerHorizontal="true"
android:layout_centerVertical="true">

<TextView
android:id="@+id/tutorialTitleTxt"
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=""
android:textAlignment="center"
android:textColor="@color/primary_light"
android:textSize="30sp"
android:textStyle="bold" />
android:rowCount="4"
android:columnCount="1"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp">

<ImageView
android:id="@+id/tutorialImg"
android:layout_width="460dp"
android:layout_height="210dp"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:scaleType="centerInside"
android:src="@drawable/tutorial_tracker_setup_0"
tools:src="@drawable/tutorial_tracker_setup_0" />
<TextView
android:id="@+id/tutorialTitleTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=""
android:textAlignment="center"
android:textColor="@color/primary_light"
android:textSize="30sp"
android:textStyle="bold" />

<TextView
android:id="@+id/tutorialDescriptionTxt"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:text=""
android:textAlignment="center"
android:textColor="@color/primary_light"
android:textSize="14sp" />
<ImageView
android:id="@+id/tutorialImg"
android:layout_width="460dp"
android:layout_height="210dp"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:scaleType="centerInside"
android:src="@drawable/tutorial_tracker_setup_0"
tools:src="@drawable/tutorial_tracker_setup_0" />

<TextView
android:id="@+id/tutorialDescriptionTxt"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:text=""
android:textAlignment="center"
android:textColor="@color/primary_light"
android:textSize="14sp" />

<Button
android:id="@+id/tutorialContinueBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/radius_background"
android:backgroundTint="@android:color/secondary_text_light"
android:elevation="8dp"
android:layout_marginTop="20dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:textAllCaps="false"
android:textStyle="normal"
android:layout_marginBottom="8dp"
android:text="OK"
android:textColor="#fff"
android:layout_gravity="end"
android:textSize="18sp" />
</GridLayout>
</ScrollView>

<Button
android:id="@+id/tutorialContinueBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/radius_background"
android:backgroundTint="@android:color/secondary_text_light"
android:elevation="8dp"
android:layout_marginTop="20dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:textAllCaps="false"
android:textStyle="normal"
android:layout_marginBottom="8dp"
android:text="OK"
android:textColor="#fff"
android:layout_gravity="end"
android:textSize="18sp" />
</GridLayout>

<ImageButton
android:id="@+id/tutorialGoBackBtn"
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@

<!-- Game settings -->
<string name="prefGame">Game</string>
<string name="prefPlayer1Name">Name Player 1</string>
<string name="prefPlayer1Name">Name Player 1 (left)</string>
<string name="prefPlayer1NameDefault">Hans</string>
<string name="prefPlayer1Key">player_1</string>
<string name="prefPlayer2Name">Name Player 2</string>
<string name="prefPlayer2Name">Name Player 2 (right)</string>
<string name="prefPlayer2NameDefault">Peter</string>
<string name="prefPlayer2Key">player_2</string>
<string name="prefDisplayDebug">Display debug info</string>
Expand All @@ -67,10 +67,10 @@
<string name="prefUseBlackSideKey">use_black_side</string>
<string name="prefUseBlackSideTitle">Use black side of racket for serving</string>
<string name="prefUseBlackSideSummary">Allows the use of the black side of the racket (in addition to the red one) to signal that a player is ready for serve</string>
<string name="prefUseAudioDefault">true</string>
<string name="prefUseAudioDefault">false</string>
<string name="prefUseAudioKey">use_audio</string>
<string name="prefUseAudioSummary">Allows the use of audio of the tracker device to assist ball detection</string>
<string name="prefUseAudioTitle">Use Audio</string>
<string name="prefUseAudioTitle">Use Audio (experimental)</string>

<!-- Detection settings -->
<string name="prefVelocityEstimationMode">Velocity estimation mode</string>
Expand Down

0 comments on commit 5952173

Please sign in to comment.