Position trigger

This commit is contained in:
2021-11-27 20:22:13 +01:00
parent 034c76fe30
commit 81d6ab7b5f
8 changed files with 468 additions and 29 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,221 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_margin="@dimen/default_margin" >
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/devicePositionExplanation"
android:layout_marginBottom="@dimen/default_margin" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:text="@string/orientationX"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/currentOrientationX"
android:layout_marginLeft="@dimen/default_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:text="@string/orientationY"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/currentOrientationY"
android:layout_marginLeft="@dimen/default_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:text="@string/orientationZ"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/currentOrientationZ"
android:layout_marginLeft="@dimen/default_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
</TableLayout>
<Button
android:id="@+id/bApplyPositionValues"
android:text="@string/apply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/default_margin" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:text=""
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Position"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="@string/tolerance"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="@string/wouldCurrentlyApply"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:text="x"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/default_margin" />
<EditText
android:id="@+id/etDesiredPositionX"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:minWidth="100dp"/>
<EditText
android:id="@+id/etDesiredPositionXTolerance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:minWidth="100dp"/>
<TextView
android:id="@+id/tvAppliesX"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:text="y"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/default_margin" />
<EditText
android:id="@+id/etDesiredPositionY"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:minWidth="100dp"/>
<EditText
android:id="@+id/etDesiredPositionYTolerance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:minWidth="100dp"/>
<TextView
android:id="@+id/tvAppliesY"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:text="z"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/default_margin" />
<EditText
android:id="@+id/etDesiredPositionZ"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:minWidth="100dp"/>
<EditText
android:id="@+id/etDesiredPositionZTolerance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:minWidth="100dp"/>
<TextView
android:id="@+id/tvAppliesZ"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
</TableLayout>
<Button
android:id="@+id/bSavePositionValues"
android:text="@string/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_margin" />
</androidx.appcompat.widget.LinearLayoutCompat>
</ScrollView>

View File

@ -713,4 +713,12 @@
<string name="donate">Donate</string>
<string name="btTetheringNotice">This feature is confirmed to work up until Android 8.0. From some higher version upwards it ceases to work, but due to a lack of physical devices I cannot tell which one that is. On Android 11 it definitely ain\'t working anymore. If you have a version in between please let me know if it\'s working or not.</string>
<string name="notice">Notice</string>
<string name="devicePosition">Device position (Gyroscope)</string>
<string name="tolerance">Tolerance</string>
<string name="orientationX">Orientation X (Roll):</string>
<string name="orientationY">Orientation Y (Pitch):</string>
<string name="orientationZ">Orientation Z (Yaw):</string>
<string name="enterValidNumbersIntoAllFields">Enter valid numbers in all fields.</string>
<string name="devicePositionExplanation">When you move your device the below numbers should update. What you can see there, is the current \"position\" of your device. If it is in the desired position, click the apply button to copy the current values to the desired fields.\nBecause you will probably not be able to reach this exact position ever again, enter a tolerance. The is amount to which the position can deviate in one direction or the other.</string>
<string name="wouldCurrentlyApply">Would currently apply?</string>
</resources>