Преглед изворни кода

CRUD ArcherySetup part 1

master
Flo Smilari пре 3 година
родитељ
комит
a2eaf661d6
24 измењених фајлова са 1122 додато и 163 уклоњено
  1. BIN
      .gradle/7.3.3/executionHistory/executionHistory.bin
  2. BIN
      .gradle/7.3.3/executionHistory/executionHistory.lock
  3. BIN
      .gradle/7.3.3/fileHashes/fileHashes.bin
  4. BIN
      .gradle/7.3.3/fileHashes/fileHashes.lock
  5. BIN
      .gradle/7.3.3/fileHashes/resourceHashesCache.bin
  6. BIN
      .gradle/buildOutputCleanup/buildOutputCleanup.lock
  7. 47
    30
      .idea/workspace.xml
  8. 1
    1
      app/src/main/AndroidManifest.xml
  9. 1
    1
      app/src/main/java/ch/spherIC/recurvebowsight/database/dao/ArcherySetupDao.java
  10. 10
    11
      app/src/main/java/ch/spherIC/recurvebowsight/model/ArcherySetup.java
  11. 2
    2
      app/src/main/java/ch/spherIC/recurvebowsight/model/IArcherySetup.java
  12. 0
    5
      app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersFragment.java
  13. 0
    22
      app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersViewModel.java
  14. 234
    0
      app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationActivity.java
  15. 326
    0
      app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationViewModel.java
  16. 0
    34
      app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/EquipmentConfigurationActivity.java
  17. 1
    0
      app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/RiserConfigurationActivity.java
  18. 1
    0
      app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/SightConfigurationActivity.java
  19. 2
    2
      app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/AddEquipmentFragment.java
  20. 444
    1
      app/src/main/res/layout/activity_equipment_configuration.xml
  21. 2
    3
      app/src/main/res/layout/activity_sight_configuration.xml
  22. 39
    51
      app/src/main/res/layout/fragment_calcsight_parameters.xml
  23. 6
    0
      app/src/main/res/values-de/strings.xml
  24. 6
    0
      app/src/main/res/values/strings.xml

BIN
.gradle/7.3.3/executionHistory/executionHistory.bin Прегледај датотеку


BIN
.gradle/7.3.3/executionHistory/executionHistory.lock Прегледај датотеку


BIN
.gradle/7.3.3/fileHashes/fileHashes.bin Прегледај датотеку


BIN
.gradle/7.3.3/fileHashes/fileHashes.lock Прегледај датотеку


BIN
.gradle/7.3.3/fileHashes/resourceHashesCache.bin Прегледај датотеку


BIN
.gradle/buildOutputCleanup/buildOutputCleanup.lock Прегледај датотеку


+ 47
- 30
.idea/workspace.xml Прегледај датотеку

@@ -21,36 +21,27 @@
</component>
<component name="ChangeListManager">
<list default="true" id="41369230-c648-4299-baf3-de5f13bcb18c" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/SightConfigurationViewModel.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationViewModel.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/resourceHashesCache.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/resourceHashesCache.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/assetWizardSettings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/assetWizardSettings.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/RBSMainActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/RBSMainActivity.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightCollectionAdapter.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightCollectionAdapter.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightFragment.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightFragment.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/dao/ArcherySetupDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/dao/ArcherySetupDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/ArcherySetup.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/ArcherySetup.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/IArcherySetup.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/IArcherySetup.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersFragment.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersFragment.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersViewModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersViewModel.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightSightSettingFragment.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightSightSettingFragment.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightSightSettingViewModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightSightSettingViewModel.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightTrajectoryFragment.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightTrajectoryFragment.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightTrajectoryViewModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightTrajectoryViewModel.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightViewModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightViewModel.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/EquipmentConfigurationActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/EquipmentConfigurationActivity.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersViewModel.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/EquipmentConfigurationActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationActivity.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/RiserConfigurationActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/RiserConfigurationActivity.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/RiserConfigurationViewModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/RiserConfigurationViewModel.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/SightConfigurationActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/SightConfigurationActivity.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/AddEquipmentFragment.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/AddEquipmentFragment.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/AddEquipmentViewModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/AddEquipmentViewModel.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/ChooseEquipmentFragment.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/ChooseEquipmentFragment.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/EquipmentRecyclerViewAdapter.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/EquipmentRecyclerViewAdapter.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/activity_equipment_configuration.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/activity_equipment_configuration.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/activity_sight_configuration.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/activity_sight_configuration.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/fragment_equipment_add_list.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/fragment_equipment_add_list.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/fragment_calcsight_parameters.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/fragment_calcsight_parameters.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-de/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-de/strings.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterDir="false" />
</list>
@@ -98,6 +89,7 @@
<property name="android-custom-viewC:/Users/FSmilari/.gradle/caches/modules-2/files-2.1/androidx.viewpager2/viewpager2/1.0.0/3c3569044e6969f1ee5c3aa03b08e6717a2d782f/viewpager2-1.0.0-sources.jar!/androidx/viewpager2/widget/ViewPager2.java_SELECTED" value="ViewPager2" />
<property name="android-custom-viewC:/Users/FSmilari/.gradle/caches/modules-2/files-2.1/androidx.viewpager2/viewpager2/1.0.0/3c3569044e6969f1ee5c3aa03b08e6717a2d782f/viewpager2-1.0.0-sources.jar!/androidx/viewpager2/widget/ViewPager2.java_ViewPager2_DIMENSIONS" value="1080&#10;1920" />
<property name="android-custom-viewC:/Users/FSmilari/AppData/Local/Android/Sdk/sources/android-29/android/view/View.java_SELECTED" value="View" />
<property name="android-custom-viewC:/Users/FSmilari/AppData/Local/Android/Sdk/sources/android-29/android/widget/AutoCompleteTextView.java_SELECTED" value="AutoCompleteTextView" />
<property name="android-custom-viewC:/Users/FSmilari/AppData/Local/Android/Sdk/sources/android-29/android/widget/EditText.java_SELECTED" value="EditText" />
<property name="android-custom-viewC:/Users/FSmilari/AppData/Local/Android/Sdk/sources/android-29/android/widget/TextView.java_SELECTED" value="TextView" />
<property name="android-custom-viewC:/Users/FSmilari/AppData/Local/Android/Sdk/sources/android-32/android/view/View.java_SELECTED" value="View" />
@@ -262,11 +254,6 @@
<line>54</line>
<option name="timeStamp" value="13" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/AddEquipmentFragment.java</url>
<line>72</line>
<option name="timeStamp" value="26" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/RiserConfigurationActivity.java</url>
<line>98</line>
@@ -274,12 +261,12 @@
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/RiserConfigurationActivity.java</url>
<line>171</line>
<line>172</line>
<option name="timeStamp" value="40" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/RiserConfigurationActivity.java</url>
<line>127</line>
<line>128</line>
<option name="timeStamp" value="42" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
@@ -287,15 +274,45 @@
<line>73</line>
<option name="timeStamp" value="43" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationViewModel.java</url>
<line>108</line>
<option name="timeStamp" value="46" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationActivity.java</url>
<line>94</line>
<option name="timeStamp" value="48" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationActivity.java</url>
<line>88</line>
<option name="timeStamp" value="50" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationViewModel.java</url>
<line>115</line>
<option name="timeStamp" value="52" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationActivity.java</url>
<line>149</line>
<option name="timeStamp" value="53" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationActivity.java</url>
<line>156</line>
<option name="timeStamp" value="54" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
<watches-manager>
<configuration name="app">
<watch expression="textView.getAdapter().getCount()" language="JAVA" />
<watch expression="textView.getAdapter().getItem(2)" language="JAVA" />
<watch expression="this.riserConfigurationViewModel.getManufacturer().getValue()" language="JAVA" />
<watch expression="this.riserConfigurationViewModel.getVVisH().getValue()" language="JAVA" />
<watch expression="adapter.getCount()" language="JAVA" />
<watch expression="this.binding.asRiserSelectionTxt.getAdapter().getCount()" language="JAVA" />
<watch expression="this.binding.asSightSelectionTxt.getAdapter().getCount()" language="JAVA" />
<watch expression="this" />
<watch expression="aArcherySetup.getRiser()" language="JAVA" />
<watch expression="this.mArcherySetup.getValue().getRiserName()" language="JAVA" />
</configuration>
</watches-manager>
</component>

+ 1
- 1
app/src/main/AndroidManifest.xml Прегледај датотеку

@@ -14,7 +14,7 @@
android:theme="@style/Theme.RecurveBowSight"
tools:targetApi="31">
<activity
android:name=".ui.configuration.EquipmentConfigurationActivity"
android:name=".ui.configuration.ArcherySetupConfigurationActivity"
android:exported="false" />
<activity
android:name=".ui.configuration.SightConfigurationActivity"

+ 1
- 1
app/src/main/java/ch/spherIC/recurvebowsight/database/dao/ArcherySetupDao.java Прегледај датотеку

@@ -62,7 +62,7 @@ public final class ArcherySetupDao extends DAO<IArcherySetup> {
values.put(TblRBSArcherySetup.COL_ARROWCW, entity.getArrowCw() != null ? entity.getArrowCw() : 0d);
values.put(TblRBSArcherySetup.COL_ARROWWEIGHT, entity.getArrowWeight() != null ? entity.getArrowWeight() : 0d);
values.put(TblRBSArcherySetup.COL_ARROWV0, entity.getArrowV0() != null ? entity.getArrowV0() : 0d);
values.put(TblRBSArcherySetup.COL_ARROWCENTERHEIGHT, entity.getArrowCenterHeight() != null ? entity.getArrowCenterHeight() : 0d);
values.put(TblRBSArcherySetup.COL_ARROWCENTERHEIGHT, entity.getTargetCenterHeight() != null ? entity.getTargetCenterHeight() : 0d);
values.put(TblRBSArcherySetup.COL_BOWPULLOUT, entity.getBowPullout() != null ? entity.getBowPullout() : 0d);
values.put(TblRBSArcherySetup.COL_ARROWNOCKHEIGHT, entity.getArrowNockHeight() != null ? entity.getArrowNockHeight() : 0d);
values.put(TblRBSArcherySetup.COL_HNA, entity.getHNA() != null ? entity.getHNA() : 0d);

+ 10
- 11
app/src/main/java/ch/spherIC/recurvebowsight/model/ArcherySetup.java Прегледај датотеку

@@ -20,7 +20,7 @@ public class ArcherySetup implements IArcherySetup {
private Double arrowCw;
private Double arrowWeight;
private Double arrowV0;
private Double arrowCenterHeight;
private Double targetCenterHeight;
private Double bowPullout;
private Double arrowNockHeight;
private Double hNA;
@@ -41,7 +41,7 @@ public class ArcherySetup implements IArcherySetup {
* @param arrowCw
* @param arrowWeight
* @param arrowV0
* @param arrowCenterHeight
* @param targetCenterHeight
* @param bowPullout
* @param arrowNockHeight
* @param hNA
@@ -54,7 +54,7 @@ public class ArcherySetup implements IArcherySetup {
*/
public ArcherySetup(final long id, final String name, final ISight sight, final IRiser riser,
final Double arrowDiameter, final Double arrowCw, final Double arrowWeight,
final Double arrowV0, final Double arrowCenterHeight, final Double bowPullout,
final Double arrowV0, final Double targetCenterHeight, final Double bowPullout,
final Double arrowNockHeight, final Double hNA, final Double deltaTime,
final Double calcPrecision, final Double sightVertSkalaMiddle,
final Double sightHorSetting, final Double nockRaising, final Double braceHeight) {
@@ -67,7 +67,7 @@ public class ArcherySetup implements IArcherySetup {
this.arrowCw = arrowCw;
this.arrowWeight = arrowWeight;
this.arrowV0 = arrowV0;
this.arrowCenterHeight = arrowCenterHeight;
this.targetCenterHeight = targetCenterHeight;
this.bowPullout = bowPullout;
this.arrowNockHeight = arrowNockHeight;
this.hNA = hNA;
@@ -219,19 +219,18 @@ public class ArcherySetup implements IArcherySetup {
}
/**
* @return the arrowCenterHeight
* @return the targetCenterHeight
*/
@Override
public Double getArrowCenterHeight() {
return this.arrowCenterHeight;
public Double getTargetCenterHeight() {
return this.targetCenterHeight;
}
/**
* @param arrowCenterHeight the arrowCenterHeight to set
* @param targetCenterHeight the targetCenterHeight to set
*/
@Override
public void setArrowCenterHeight(final Double arrowCenterHeight) {
this.arrowCenterHeight = arrowCenterHeight;
public void setTargetCenterHeight(final Double targetCenterHeight) {
this.targetCenterHeight = targetCenterHeight;
}
/**

+ 2
- 2
app/src/main/java/ch/spherIC/recurvebowsight/model/IArcherySetup.java Прегледај датотеку

@@ -38,9 +38,9 @@ public interface IArcherySetup extends IEntity, Parcelable {
void setArrowV0(Double v0);
Double getArrowCenterHeight();
Double getTargetCenterHeight();
void setArrowCenterHeight(Double arrowCenterHeight);
void setTargetCenterHeight(Double targetCenterHeight);
Double getBowPullout();

+ 0
- 5
app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersFragment.java Прегледај датотеку

@@ -9,11 +9,9 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import ch.spherIC.recurvebowsight.R;
import ch.spherIC.recurvebowsight.databinding.FragmentCalcsightParametersBinding;

@@ -22,15 +20,12 @@ public class CalculateSightParametersFragment extends Fragment {
private FragmentCalcsightParametersBinding binding;

public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
CalculateSightParametersViewModel calculateSightParametersViewModel = new ViewModelProvider(this).get(CalculateSightParametersViewModel.class);
binding = FragmentCalcsightParametersBinding.inflate(inflater, container, false);
View root = binding.getRoot();

loadCalculationAccuracies(root);
loadCalculationTimeIntervals(root);

final TextView textView = binding.textCalcsightParams;
calculateSightParametersViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
return root;
}


+ 0
- 22
app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersViewModel.java Прегледај датотеку

@@ -1,22 +0,0 @@
/**
* Copyright (C) 2022 - Florindo Smilari (spherIC)
*/
package ch.spherIC.recurvebowsight.ui.calcsight;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class CalculateSightParametersViewModel extends ViewModel {

private final MutableLiveData<String> mText;

public CalculateSightParametersViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is the \"Calculate Sight Params\" fragment");
}

public LiveData<String> getText() {
return mText;
}
}

+ 234
- 0
app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationActivity.java Прегледај датотеку

@@ -0,0 +1,234 @@
/**
* Copyright (C) 2022 - Florindo Smilari (spherIC)
*/
package ch.spherIC.recurvebowsight.ui.configuration;

import android.os.Bundle;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;

import java.text.DecimalFormat;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModelProvider;
import ch.spherIC.recurvebowsight.R;
import ch.spherIC.recurvebowsight.database.dao.ArcherySetupDao;
import ch.spherIC.recurvebowsight.database.dao.RiserDao;
import ch.spherIC.recurvebowsight.database.dao.SightDao;
import ch.spherIC.recurvebowsight.databinding.ActivityEquipmentConfigurationBinding;
import ch.spherIC.recurvebowsight.model.IArcherySetup;
import ch.spherIC.recurvebowsight.model.IRiser;
import ch.spherIC.recurvebowsight.model.ISight;
import ch.spherIC.recurvebowsight.utilities.PlatformUtils;

public class ArcherySetupConfigurationActivity extends AppCompatActivity {

private ActivityEquipmentConfigurationBinding binding;
private ArcherySetupConfigurationViewModel archerySetupConfigurationViewModel;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_equipment_configuration);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.title_activity_archery_setup_configuration);

this.archerySetupConfigurationViewModel = new ViewModelProvider(this).get(ArcherySetupConfigurationViewModel.class);
this.binding = ActivityEquipmentConfigurationBinding.bind(findViewById(R.id.activity_equipment_configuration));

addObservers();
addSpinnerListeners();
addButtonListeners();
loadSightsAndRisers();
loadArcherySetups();
}

@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
this.finish();
return true;
}
return super.onOptionsItemSelected(item);
}

private void addObservers() {
DecimalFormat dF = new DecimalFormat("#.#");
DecimalFormat dF2 = new DecimalFormat("#.##");
DecimalFormat dF3 = new DecimalFormat("#.###");
this.archerySetupConfigurationViewModel.getName().observe(this, name -> this.binding.asLabelTxt.setText(name));
this.archerySetupConfigurationViewModel.getSight().observe(this, sight -> this.binding.asSightSelectionTxt.setText(sight != null ? sight.toString() : ""));
this.archerySetupConfigurationViewModel.getRiser().observe(this, riser -> this.binding.asRiserSelectionTxt.setText(riser != null ? riser.toString() : ""));
this.archerySetupConfigurationViewModel.getArrowDiameter().observe(this, arwDiam -> this.binding.asArrowDiameterTxt.setText(arwDiam != null ? dF.format(arwDiam) : ""));
this.archerySetupConfigurationViewModel.getArrowCw().observe(this, arwCw -> this.binding.asArrowCWTxt.setText(arwCw != null ? dF.format(arwCw) : ""));
this.archerySetupConfigurationViewModel.getArrowWeight().observe(this, arwWeight -> this.binding.asArrowWeightTxt.setText(arwWeight != null ? dF.format(arwWeight) : ""));
this.archerySetupConfigurationViewModel.getArrowV0().observe(this, aV0 -> this.binding.asArrowV0Txt.setText(aV0 != null ? dF.format(aV0) : ""));
this.archerySetupConfigurationViewModel.getArrowNockHeight().observe(this, arwNH -> this.binding.asArrowNockHeightTxt.setText(arwNH != null ? dF2.format(arwNH) : ""));
this.archerySetupConfigurationViewModel.getTargetCenterHeight().observe(this, arwCH -> this.binding.asTargetCenterHeightTxt.setText(arwCH != null ? dF.format(arwCH) : ""));
this.archerySetupConfigurationViewModel.getBowPullout().observe(this, bowPlOut -> this.binding.asBowPulloutTxt.setText(bowPlOut != null ? dF.format(bowPlOut) : ""));
this.archerySetupConfigurationViewModel.getHNA().observe(this, ahNA -> this.binding.asHNATxt.setText(ahNA != null ? dF.format(ahNA) : ""));
this.archerySetupConfigurationViewModel.getNockRaising().observe(this, nockRsg -> this.binding.asNockRaisingTxt.setText(nockRsg != null ? dF.format(nockRsg) : ""));
this.archerySetupConfigurationViewModel.getBraceHeight().observe(this, brH -> this.binding.asBraceHeightTxt.setText(brH != null ? dF.format(brH) : ""));
this.archerySetupConfigurationViewModel.getDeltaTime().observe(this, deltaTm -> this.binding.asDeltaTimeTxt.setText(deltaTm != null ? dF3.format(deltaTm) : ""));
this.archerySetupConfigurationViewModel.getCalcPrecision().observe(this, calcPrec -> this.binding.asCalcPrecisionTxt.setText(calcPrec != null ? dF.format(calcPrec) : ""));
this.archerySetupConfigurationViewModel.getSightVertSkalaMiddle().observe(this, vScaleMdl -> this.binding.asSightVertScaleMiddleTxt.setText(vScaleMdl != null ? dF.format(vScaleMdl) : ""));
this.archerySetupConfigurationViewModel.getSightHorzSetting().observe(this, hrzSetting -> this.binding.asSightHorzSettingTxt.setText(hrzSetting != null ? dF.format(hrzSetting) : ""));
}

private void addSpinnerListeners() {
AutoCompleteTextView textViewAS = findViewById(R.id.asArcherySetupSelectionTxt);
textViewAS.setOnItemClickListener((parent, view, position, id) -> {
IArcherySetup selectedArcherySetup = (IArcherySetup) textViewAS.getAdapter().getItem(position);
if (selectedArcherySetup != null) {
archerySetupConfigurationViewModel.setEquipment(selectedArcherySetup);
}
});

/* AutoCompleteTextView textViewSight = findViewById(R.id.asSightSelectionTxt);
textViewAS.setOnItemClickListener((parent, view, position, id) -> {
ISight selectedSight = (ISight) textViewSight.getAdapter().getItem(position);
archerySetupConfigurationViewModel.setSight(selectedSight);
});

AutoCompleteTextView textViewRiser = findViewById(R.id.asRiserSelectionTxt);
textViewAS.setOnItemClickListener((parent, view, position, id) -> {
IRiser selectedRiser = (IRiser) textViewRiser.getAdapter().getItem(position);
if (selectedRiser != null) {
// sightConfigurationViewModel.setSight(selectedRiser);
}
});*/
}

private void addButtonListeners() {
Button newButton = findViewById(R.id.archerystpcfg_button_new);
newButton.setOnClickListener(v -> addNewSight());

Button deleteButton = findViewById(R.id.archerystpcfg_button_delete);
deleteButton.setOnClickListener(v -> deleteSight());

Button saveButton = findViewById(R.id.archerystpcfg_button_save);
saveButton.setOnClickListener(v -> saveSightConfiguration());
}

private void loadSightsAndRisers() {
List<ISight> sights = SightDao.getInstance().loadAll();
this.archerySetupConfigurationViewModel.setAllSights(sights);
ArrayAdapter<ISight> sightsAdapter = new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line, sights);
AutoCompleteTextView textViewSights = this.binding.asSightSelectionTxt;
textViewSights.setAdapter(sightsAdapter);
textViewSights.invalidate();

List<IRiser> risers = RiserDao.getInstance().loadAll();
this.archerySetupConfigurationViewModel.setAllRisers(risers);
ArrayAdapter<IRiser> riserAdapter = new ArrayAdapter<IRiser>(this, android.R.layout.simple_dropdown_item_1line, risers);
AutoCompleteTextView textViewRisers = binding.asRiserSelectionTxt;
textViewRisers.setAdapter(riserAdapter);
textViewRisers.invalidate();
}

private void loadArcherySetups() {
List<IArcherySetup> archerySetups = ArcherySetupDao.getInstance().loadAll();
ArrayAdapter<IArcherySetup> archerySetupsAdapter = new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line, archerySetups);
AutoCompleteTextView textViewASs = this.binding.asArcherySetupSelectionTxt;
textViewASs.setAdapter(archerySetupsAdapter);
textViewASs.invalidate();
}

private void addNewSight() {
}

private void deleteSight() {
}

private void saveSightConfiguration() {
if (!validateInputs()) {
return;
}
this.archerySetupConfigurationViewModel.setName(this.binding.asLabelTxt.getText().toString());
this.archerySetupConfigurationViewModel.setSight(this.archerySetupConfigurationViewModel.findSightByName(this.binding.asSightSelectionTxt.getText().toString()));
this.archerySetupConfigurationViewModel.setRiser(this.archerySetupConfigurationViewModel.findRiserByName(this.binding.asRiserSelectionTxt.getText().toString()));

IArcherySetup lArcherySetup = this.archerySetupConfigurationViewModel.getArcherySetup().getValue();
if (lArcherySetup.getId() > 0) {
ArcherySetupDao.getInstance().update(lArcherySetup);
//TODO: SHOW UPDATE INFO TOAST
} else {
lArcherySetup = ArcherySetupDao.getInstance().insert(lArcherySetup);
loadArcherySetups();
AutoCompleteTextView textView = this.binding.asArcherySetupSelectionTxt;
final int position = ((ArrayAdapter<IArcherySetup>) textView.getAdapter()).getPosition(lArcherySetup);
textView.setListSelection(position);
textView.setText(lArcherySetup.toString());
((ArrayAdapter<IArcherySetup>) textView.getAdapter()).getFilter().filter(null);
PlatformUtils.toast(ArcherySetupConfigurationActivity.this, String.format(getString(R.string.caption_Cfg_SaveSuccessful), lArcherySetup)).show();
}

}

private boolean validateInputs() {
int invalidFields = 0;
if (this.binding.asLabelTxt.getText().toString().isEmpty() || this.binding.asLabelTxt.getText().toString().equals("*")) {
invalidFields++;
}
if (this.binding.asSightSelectionTxt.getText().toString().isEmpty() || this.binding.asSightSelectionTxt.getText().toString().equals("*")) {
invalidFields++;
}
if (this.binding.asRiserSelectionTxt.getText() == null || this.binding.asRiserSelectionTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asArrowDiameterTxt.getText() == null || this.binding.asArrowDiameterTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asArrowWeightTxt.getText() == null || this.binding.asArrowWeightTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asArrowWeightTxt.getText() == null || this.binding.asArrowWeightTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asArrowV0Txt.getText() == null || this.binding.asArrowV0Txt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asArrowNockHeightTxt.getText() == null || this.binding.asArrowNockHeightTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asTargetCenterHeightTxt.getText() == null || this.binding.asTargetCenterHeightTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asBowPulloutTxt.getText() == null || this.binding.asBowPulloutTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asHNATxt.getText() == null || this.binding.asHNATxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asNockRaisingTxt.getText() == null || this.binding.asNockRaisingTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asBraceHeightTxt.getText() == null || this.binding.asBraceHeightTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asDeltaTimeTxt.getText() == null || this.binding.asDeltaTimeTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asCalcPrecisionTxt.getText() == null || this.binding.asCalcPrecisionTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asSightVertScaleMiddleTxt.getText() == null || this.binding.asSightVertScaleMiddleTxt.getText().toString().equals("")) {
invalidFields++;
}
if (this.binding.asSightHorzSettingTxt.getText() == null || this.binding.asSightHorzSettingTxt.getText().toString().equals("")) {
invalidFields++;
}

if (invalidFields > 0) {
PlatformUtils.toast(this, getResources().getString(R.string.caption_Cfg_FillAllMandatoryFields)).show();
return false;
}
return true;
}
}

+ 326
- 0
app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationViewModel.java Прегледај датотеку

@@ -0,0 +1,326 @@
/**
* Copyright (C) 2022 - Florindo Smilari (spherIC)
*/
package ch.spherIC.recurvebowsight.ui.configuration;

import java.util.List;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import ch.spherIC.recurvebowsight.model.IArcherySetup;
import ch.spherIC.recurvebowsight.model.IRiser;
import ch.spherIC.recurvebowsight.model.ISight;

public class ArcherySetupConfigurationViewModel extends ViewModel {

private List<ISight> allSights;
private List<IRiser> allRisers;

private final MutableLiveData<IArcherySetup> mArcherySetup;
private final MutableLiveData<String> mName;
private final MutableLiveData<ISight> mSight;
private final MutableLiveData<IRiser> mRiser;
private final MutableLiveData<Double> mArrowDiameter;
private final MutableLiveData<Double> mArrowCw;
private final MutableLiveData<Double> mArrowWeight;
private final MutableLiveData<Double> mArrowV0;
private final MutableLiveData<Double> mTargetCenterHeight;
private final MutableLiveData<Double> mArrowNockHeight;
private final MutableLiveData<Double> mBowPullout;
private final MutableLiveData<Double> mHNA;
private final MutableLiveData<Double> mDeltaTime;
private final MutableLiveData<Double> mCalcPrecision;
private final MutableLiveData<Double> mSightVertSkalaMiddle;
private final MutableLiveData<Double> mSightHorzSetting;
private final MutableLiveData<Double> mNockRaising;
private final MutableLiveData<Double> mBraceHeight;


public ArcherySetupConfigurationViewModel() {
this.mArcherySetup = new MutableLiveData<>();
this.mName = new MutableLiveData<>();
this.mSight = new MutableLiveData<>();
this.mRiser = new MutableLiveData<>();
this.mArrowDiameter = new MutableLiveData<>();
this.mArrowCw = new MutableLiveData<>();
this.mArrowWeight = new MutableLiveData<>();
this.mArrowV0 = new MutableLiveData<>();
this.mTargetCenterHeight = new MutableLiveData<>();
this.mArrowNockHeight = new MutableLiveData<>();
this.mBowPullout = new MutableLiveData<>();
this.mHNA = new MutableLiveData<>();
this.mDeltaTime = new MutableLiveData<>();
this.mCalcPrecision = new MutableLiveData<>();
this.mSightVertSkalaMiddle = new MutableLiveData<>();
this.mSightHorzSetting = new MutableLiveData<>();
this.mNockRaising = new MutableLiveData<>();
this.mBraceHeight = new MutableLiveData<>();

this.mArcherySetup.setValue(null);
this.mName.setValue("");
this.mSight.setValue(null);
this.mRiser.setValue(null);
this.mArrowDiameter.setValue(null);
this.mArrowCw.setValue(null);
this.mArrowWeight.setValue(null);
this.mArrowV0.setValue(null);
this.mTargetCenterHeight.setValue(null);
this.mArrowNockHeight.setValue(null);
this.mBowPullout.setValue(null);
this.mHNA.setValue(null);
this.mDeltaTime.setValue(null);
this.mCalcPrecision.setValue(null);
this.mSightVertSkalaMiddle.setValue(null);
this.mSightHorzSetting.setValue(null);
this.mNockRaising.setValue(null);
this.mBraceHeight.setValue(null);
}

public void setEquipment(IArcherySetup aArcherySetup) {
this.mArcherySetup.setValue(aArcherySetup);
this.mName.setValue(aArcherySetup != null ? aArcherySetup.getName() : "");
this.mSight.setValue(aArcherySetup != null ? aArcherySetup.getSight() : null);
this.mRiser.setValue(aArcherySetup != null ? aArcherySetup.getRiser() : null);
this.mArrowDiameter.setValue(aArcherySetup != null ? aArcherySetup.getArrowDiameter() : null);
this.mArrowCw.setValue(aArcherySetup != null ? aArcherySetup.getArrowCw() : null);
this.mArrowWeight.setValue(aArcherySetup != null ? aArcherySetup.getArrowWeight() : null);
this.mArrowV0.setValue(aArcherySetup != null ? aArcherySetup.getArrowV0() : null);
this.mTargetCenterHeight.setValue(aArcherySetup != null ? aArcherySetup.getTargetCenterHeight() : null);
this.mArrowNockHeight.setValue(aArcherySetup != null ? aArcherySetup.getArrowNockHeight() : null);
this.mBowPullout.setValue(aArcherySetup != null ? aArcherySetup.getBowPullout() : null);
this.mHNA.setValue(aArcherySetup != null ? aArcherySetup.getHNA() : null);
this.mDeltaTime.setValue(aArcherySetup != null ? aArcherySetup.getDeltaTime() : null);
this.mCalcPrecision.setValue(aArcherySetup != null ? aArcherySetup.getCalcPrecision() : null);
this.mSightVertSkalaMiddle.setValue(aArcherySetup != null ? aArcherySetup.getSightVertSkalaMiddle() : null);
this.mSightHorzSetting.setValue(aArcherySetup != null ? aArcherySetup.getSightHorzSetting() : null);
this.mNockRaising.setValue(aArcherySetup != null ? aArcherySetup.getNockRaising() : null);
this.mBraceHeight.setValue(aArcherySetup != null ? aArcherySetup.getBraceHeight() : null);
}

public void setName(String nameText) {
if (this.mName.getValue() != null) {
this.mArcherySetup.getValue().setName(nameText);
}
this.mName.setValue(nameText);
}

public void setSight(ISight aSight) {
if (this.mSight.getValue() != null) {
this.mArcherySetup.getValue().setSight(aSight);
}
this.mSight.setValue(aSight);
}

public void setRiser(IRiser aRiser) {
if (this.mRiser.getValue() != null) {
this.mArcherySetup.getValue().setRiser(aRiser);
}
this.mRiser.setValue(aRiser);
}

public void setArrowDiameter(Double mArrowDiameter) {
if (this.mArrowDiameter.getValue() != null) {
this.mArcherySetup.getValue().setArrowDiameter(mArrowDiameter);
}
this.mArrowDiameter.setValue(mArrowDiameter);
}

public void setArrowCw(Double mArrowCw) {
if (this.mArrowCw.getValue() != null) {
this.mArcherySetup.getValue().setArrowCw(mArrowCw);
}
this.mArrowCw.setValue(mArrowCw);
}

public void setArrowWeight(Double mArrowWeight) {
if (this.mArrowWeight.getValue() != null) {
this.mArcherySetup.getValue().setArrowWeight(mArrowWeight);
}
this.mArrowWeight.setValue(mArrowWeight);
}

public void setArrowV0(Double mArrowV0) {
if (this.mArrowV0.getValue() != null) {
this.mArcherySetup.getValue().setArrowV0(mArrowV0);
}
this.mArrowV0.setValue(mArrowV0);
}

public void setTargetCenterHeight(Double mTargetCenterHeight) {
if (this.mTargetCenterHeight.getValue() != null) {
this.mArcherySetup.getValue().setTargetCenterHeight(mTargetCenterHeight);
}
this.mTargetCenterHeight.setValue(mTargetCenterHeight);
}

public void setArrowNockHeight(Double mArrowNockHeight) {
if (this.mArrowNockHeight.getValue() != null) {
this.mArcherySetup.getValue().setArrowNockHeight(mArrowNockHeight);
}
this.mArrowNockHeight.setValue(mArrowNockHeight);
}

public void setBowPullout(Double mBowPullout) {
if (this.mBowPullout.getValue() != null) {
this.mArcherySetup.getValue().setBowPullout(mBowPullout);
}
this.mBowPullout.setValue(mBowPullout);
}

public void setHNA(Double mHNA) {
if (this.mHNA.getValue() != null) {
this.mArcherySetup.getValue().setHNA(mHNA);
}
this.mHNA.setValue(mHNA);
}

public void setDeltaTime(Double mDeltaTime) {
if (this.mDeltaTime.getValue() != null) {
this.mArcherySetup.getValue().setDeltaTime(mDeltaTime);
}
this.mDeltaTime.setValue(mDeltaTime);
}

public void setCalcPrecision(Double mCalcPrecision) {
if (this.mCalcPrecision.getValue() != null) {
this.mArcherySetup.getValue().setCalcPrecision(mCalcPrecision);
}
this.mCalcPrecision.setValue(mCalcPrecision);
}

public void setSightVertSkalaMiddle(Double mSightVertSkalaMiddle) {
if (this.mSightVertSkalaMiddle.getValue() != null) {
this.mArcherySetup.getValue().setSightVertSkalaMiddle(mSightVertSkalaMiddle);
}
this.mSightVertSkalaMiddle.setValue(mSightVertSkalaMiddle);
}

public void setSightHorzSetting(Double mSightHorzSetting) {
if (this.mSightHorzSetting.getValue() != null) {
this.mArcherySetup.getValue().setSightHorzSetting(mSightHorzSetting);
}
this.mSightHorzSetting.setValue(mSightHorzSetting);
}

public void setNockRaising(Double mNockRaising) {
if (this.mNockRaising.getValue() != null) {
this.mArcherySetup.getValue().setNockRaising(mNockRaising);
}
this.mNockRaising.setValue(mNockRaising);
}

public void setBraceHeight(Double mBraceHeight) {
if (this.mBraceHeight.getValue() != null) {
this.mArcherySetup.getValue().setBraceHeight(mBraceHeight);
}
this.mBraceHeight.setValue(mBraceHeight);
}

public LiveData<IArcherySetup> getArcherySetup() {
return mArcherySetup;
}

public LiveData<String> getName() {
return mName;
}

public LiveData<ISight> getSight() {
return mSight;
}

public LiveData<IRiser> getRiser() {
return mRiser;
}

public LiveData<Double> getArrowDiameter() {
return mArrowDiameter;
}

public LiveData<Double> getArrowCw() {
return mArrowCw;
}

public LiveData<Double> getArrowWeight() {
return mArrowWeight;
}

public LiveData<Double> getArrowV0() {
return mArrowV0;
}

public LiveData<Double> getArrowNockHeight() {
return mArrowNockHeight;
}

public LiveData<Double> getTargetCenterHeight() {
return mTargetCenterHeight;
}

public List<ISight> getAllSights() {
return allSights;
}

public void setAllSights(List<ISight> allSights) {
this.allSights = allSights;
}

public List<IRiser> getAllRisers() {
return allRisers;
}

public void setAllRisers(List<IRiser> allRisers) {
this.allRisers = allRisers;
}

public IRiser findRiserByName(String name) {
for (IRiser riser : this.allRisers) {
if (riser.toString().equals(name)) {
return riser;
}
}
return null;
}

public ISight findSightByName(String name) {
for (ISight sight : this.allSights) {
if (sight.toString().equals(name)) {
return sight;
}
}
return null;
}


public LiveData<Double> getBowPullout() {
return mBowPullout;
}

public LiveData<Double> getHNA() {
return mHNA;
}

public LiveData<Double> getDeltaTime() {
return mDeltaTime;
}

public LiveData<Double> getCalcPrecision() {
return mCalcPrecision;
}

public LiveData<Double> getSightVertSkalaMiddle() {
return mSightVertSkalaMiddle;
}

public LiveData<Double> getSightHorzSetting() {
return mSightHorzSetting;
}

public LiveData<Double> getNockRaising() {
return mNockRaising;
}

public LiveData<Double> getBraceHeight() {
return mBraceHeight;
}
}

+ 0
- 34
app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/EquipmentConfigurationActivity.java Прегледај датотеку

@@ -1,34 +0,0 @@
/**
* Copyright (C) 2022 - Florindo Smilari (spherIC)
*/
package ch.spherIC.recurvebowsight.ui.configuration;

import android.os.Bundle;
import android.view.MenuItem;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import ch.spherIC.recurvebowsight.R;

public class EquipmentConfigurationActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_equipment_configuration);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.title_activity_archery_setup_configuration);

}

@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
this.finish();
return true;
}
return super.onOptionsItemSelected(item);
}

}

+ 1
- 0
app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/RiserConfigurationActivity.java Прегледај датотеку

@@ -124,6 +124,7 @@ public class RiserConfigurationActivity extends AppCompatActivity {
IRiser lRiser = this.riserConfigurationViewModel.getRiser().getValue();
if (lRiser.getId() > 0) {
RiserDao.getInstance().update(lRiser);
//TODO: SHOW UPDATE INFO TOAST
} else {
lRiser = RiserDao.getInstance().insert(lRiser);
loadRisers();

+ 1
- 0
app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/SightConfigurationActivity.java Прегледај датотеку

@@ -132,6 +132,7 @@ public class SightConfigurationActivity extends AppCompatActivity {
ISight lSight = this.sightConfigurationViewModel.getRiser().getValue();
if (lSight.getId() > 0) {
SightDao.getInstance().update(lSight);
//TODO: SHOW UPDATE INFO TOAST
} else {
lSight = SightDao.getInstance().insert(lSight);
loadSights();

+ 2
- 2
app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/AddEquipmentFragment.java Прегледај датотеку

@@ -15,7 +15,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import ch.spherIC.recurvebowsight.R;
import ch.spherIC.recurvebowsight.databinding.FragmentEquipmentAddListBinding;
import ch.spherIC.recurvebowsight.ui.configuration.EquipmentConfigurationActivity;
import ch.spherIC.recurvebowsight.ui.configuration.ArcherySetupConfigurationActivity;
import ch.spherIC.recurvebowsight.ui.configuration.RiserConfigurationActivity;
import ch.spherIC.recurvebowsight.ui.configuration.SightConfigurationActivity;

@@ -70,7 +70,7 @@ public class AddEquipmentFragment extends Fragment {
Intent sightConfigurationIntent = new Intent(v.getContext(), SightConfigurationActivity.class);
startActivity(sightConfigurationIntent);
} else if (v.getId() == R.id.card_view_equipment_border) {
Intent equipmentConfigurationIntent = new Intent(v.getContext(), EquipmentConfigurationActivity.class);
Intent equipmentConfigurationIntent = new Intent(v.getContext(), ArcherySetupConfigurationActivity.class);
startActivity(equipmentConfigurationIntent);
}
}

+ 444
- 1
app/src/main/res/layout/activity_equipment_configuration.xml Прегледај датотеку

@@ -1,9 +1,452 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_equipment_configuration"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.configuration.EquipmentConfigurationActivity">
tools:context=".ui.configuration.ArcherySetupConfigurationActivity">

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
android:id="@+id/configArcherySetupLbl"
style="@style/Widget.AppCompat.TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:background="@color/purple_700"
android:padding="4dp"
android:text="@string/asTitleArcherySetupConfig"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />


<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:id="@+id/asArcherySetupSelectionLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/configArcherySetupLbl">

<AutoCompleteTextView
android:id="@+id/asArcherySetupSelectionTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/asArcherySetupLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>


<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asLabelLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asArcherySetupSelectionLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asLabelTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/asLabel"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:id="@+id/asRiserSelectionLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asLabelLayout">

<AutoCompleteTextView
android:id="@+id/asRiserSelectionTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/rcRiserLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:id="@+id/asSightSelectionLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asRiserSelectionLayout">

<AutoCompleteTextView
android:id="@+id/asSightSelectionTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/rcSightLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asArrowDiameterLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asSightSelectionLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asArrowDiameterTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/arrowDiameterLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asArrowCWLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asArrowDiameterLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asArrowCWTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/arrowCwLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asArrowWeightLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asArrowCWLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asArrowWeightTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/arrowWeightLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asArrowV0Layout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asArrowWeightLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asArrowV0Txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/arrowV0Lbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asBowPulloutLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asArrowV0Layout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asBowPulloutTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/bowPulloutLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asArrowNockHeightLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asBowPulloutLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asArrowNockHeightTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/arrowNockHeightLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asHNALayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asArrowNockHeightLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asHNATxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/bowParamhNALbl"
android:nextFocusDown="@id/nockRaisingTxt"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asNockRaisingLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asHNALayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asNockRaisingTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/bowParamNockRaisingLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asBraceHeightLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asNockRaisingLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asBraceHeightTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/bowParamBraceHeightLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asTargetCenterHeightLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asBraceHeightLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asTargetCenterHeightTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/targetCenterHeightLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asDeltaTimeLayoutLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asTargetCenterHeightLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asDeltaTimeTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/deltaTimeLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asCalcPrecisionLayoutLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asDeltaTimeLayoutLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asCalcPrecisionTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/calcPrecisionLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asSightVertScaleMiddle"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asCalcPrecisionLayoutLayout">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asSightVertScaleMiddleTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/scVertSkalaMiddleLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/asSightHorzSetting"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asSightVertScaleMiddle">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/asSightHorzSettingTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/scHeVSLbl"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/asSightHorzSetting">

<Button
android:id="@+id/archerystpcfg_button_new"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_weight="1"
android:text="@string/caption_New"
app:icon="@drawable/ic_icon_add"
app:iconPadding="-8dp" />

<Button
android:id="@+id/archerystpcfg_button_delete"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_weight="1"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:text="@string/caption_Delete"
app:icon="@drawable/ic_icon_delete"
app:iconPadding="-8dp" />

<Button
android:id="@+id/archerystpcfg_button_save"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_weight="1"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:text="@string/caption_Save"
app:icon="@drawable/ic_icon_save"
app:iconPadding="0dp" />

</LinearLayout>


</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>

+ 2
- 3
app/src/main/res/layout/activity_sight_configuration.xml Прегледај датотеку

@@ -8,8 +8,8 @@
tools:context=".ui.configuration.SightConfigurationActivity">

<ScrollView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -272,7 +272,6 @@

</LinearLayout>


</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>


+ 39
- 51
app/src/main/res/layout/fragment_calcsight_parameters.xml Прегледај датотеку

@@ -12,8 +12,10 @@
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@@ -21,39 +23,43 @@


<TextView
android:id="@+id/text_calcsight_params"
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="@+id/bowAndArrowParams"
style="@style/Widget.AppCompat.TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:textAlignment="viewStart"
android:textSize="20sp"
android:layout_marginTop="16dp"
android:background="@color/purple_700"
android:padding="4dp"
android:text="@string/titleBowAndArrowParams"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/bowAndArrowParams"
android:id="@+id/atmosphericalParams"
style="@style/Widget.AppCompat.TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginTop="16dp"
android:background="@color/purple_700"
android:padding="4dp"
android:text="@string/titleBowAndArrowParams"
android:text="@string/titleAtmosphericalParams"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_calcsight_params" />
app:layout_constraintTop_toBottomOf="@+id/bowParamsFlow" />

<TextView
android:id="@+id/atmosphericalParams"
android:id="@+id/shootingParams"
style="@style/Widget.AppCompat.TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -62,13 +68,31 @@
android:layout_marginTop="16dp"
android:background="@color/purple_700"
android:padding="4dp"
android:text="@string/titleAtmosphericalParams"
android:text="@string/titleShootingParams"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bowParamsFlow" />
app:layout_constraintTop_toBottomOf="@+id/airRelativeHumidityLayout" />

<TextView
android:id="@+id/calculationParams"
style="@style/Widget.AppCompat.TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:background="@color/purple_700"
android:padding="4dp"
android:text="@string/titleCalculationParams"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/targetCenterHeightLayout" />

<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/bowParamsFlow"
@@ -279,24 +303,6 @@
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<TextView
android:id="@+id/shootingParams"
style="@style/Widget.AppCompat.TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:background="@color/purple_700"
android:padding="4dp"
android:text="@string/titleShootingParams"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/airRelativeHumidityLayout" />

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/shootingDistanzLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
@@ -357,27 +363,9 @@
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

<TextView
android:id="@+id/calculationParams"
style="@style/Widget.AppCompat.TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:background="@color/purple_700"
android:padding="4dp"
android:text="@string/titleCalculationParams"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/targetCenterHeightLayout" />

<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:id="@+id/deltaTimeLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"

+ 6
- 0
app/src/main/res/values-de/strings.xml Прегледај датотеку

@@ -75,6 +75,12 @@
<string name="scVertSkalaMiddleLbl">Mittelstellung M vert. Skala [mm]</string>
<string name="scPointerOffsetLbl">Versatz Skalenzeiger [mm]</string>
<string name="scEvSLbl">EvS [mm]</string>
<string name="asTitleArcherySetupConfig">Konfiguration Ausrüstung</string>
<string name="asArcherySetupLbl">Ausrüstung</string>
<string name="asLabel">Label</string>
<string name="ashNA">hNA [mm]</string>
<string name="asNockRaising">Nockpunktüberhöhung [mm]</string>
<string name="asBraceHeight">Standhöhe [mm]</string>
<string name="caption_Ok">OK</string>

+ 6
- 0
app/src/main/res/values/strings.xml Прегледај датотеку

@@ -75,6 +75,12 @@
<string name="scVertSkalaMiddleLbl">Vert. Scale Middle Setting M [mm]</string>
<string name="scPointerOffsetLbl">Scale Pointer Offset [mm]</string>
<string name="scEvSLbl">EvS [mm]</string>
<string name="asTitleArcherySetupConfig">Archery Setup Configuration</string>
<string name="asArcherySetupLbl">Archery Setup</string>
<string name="asLabel">Label</string>
<string name="ashNA">hNA [mm]</string>
<string name="asNockRaising">Nock Raising [mm]</string>
<string name="asBraceHeight">Brace Height [mm]</string>


<string name="caption_Ok">OK</string>

Loading…
Откажи
Сачувај