| <component name="ProjectCodeStyleConfiguration"> | |||||
| <code_scheme name="Project" version="173"> | |||||
| <codeStyleSettings language="XML"> | |||||
| <option name="FORCE_REARRANGE_MODE" value="1" /> | |||||
| <indentOptions> | |||||
| <option name="CONTINUATION_INDENT_SIZE" value="4" /> | |||||
| </indentOptions> | |||||
| <arrangement> | |||||
| <rules> | |||||
| <section> | |||||
| <rule> | |||||
| <match> | |||||
| <AND> | |||||
| <NAME>xmlns:android</NAME> | |||||
| <XML_ATTRIBUTE /> | |||||
| <XML_NAMESPACE>^$</XML_NAMESPACE> | |||||
| </AND> | |||||
| </match> | |||||
| </rule> | |||||
| </section> | |||||
| <section> | |||||
| <rule> | |||||
| <match> | |||||
| <AND> | |||||
| <NAME>xmlns:.*</NAME> | |||||
| <XML_ATTRIBUTE /> | |||||
| <XML_NAMESPACE>^$</XML_NAMESPACE> | |||||
| </AND> | |||||
| </match> | |||||
| <order>BY_NAME</order> | |||||
| </rule> | |||||
| </section> | |||||
| <section> | |||||
| <rule> | |||||
| <match> | |||||
| <AND> | |||||
| <NAME>.*:id</NAME> | |||||
| <XML_ATTRIBUTE /> | |||||
| <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> | |||||
| </AND> | |||||
| </match> | |||||
| </rule> | |||||
| </section> | |||||
| <section> | |||||
| <rule> | |||||
| <match> | |||||
| <AND> | |||||
| <NAME>.*:name</NAME> | |||||
| <XML_ATTRIBUTE /> | |||||
| <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> | |||||
| </AND> | |||||
| </match> | |||||
| </rule> | |||||
| </section> | |||||
| <section> | |||||
| <rule> | |||||
| <match> | |||||
| <AND> | |||||
| <NAME>name</NAME> | |||||
| <XML_ATTRIBUTE /> | |||||
| <XML_NAMESPACE>^$</XML_NAMESPACE> | |||||
| </AND> | |||||
| </match> | |||||
| </rule> | |||||
| </section> | |||||
| <section> | |||||
| <rule> | |||||
| <match> | |||||
| <AND> | |||||
| <NAME>style</NAME> | |||||
| <XML_ATTRIBUTE /> | |||||
| <XML_NAMESPACE>^$</XML_NAMESPACE> | |||||
| </AND> | |||||
| </match> | |||||
| </rule> | |||||
| </section> | |||||
| <section> | |||||
| <rule> | |||||
| <match> | |||||
| <AND> | |||||
| <NAME>.*</NAME> | |||||
| <XML_ATTRIBUTE /> | |||||
| <XML_NAMESPACE>^$</XML_NAMESPACE> | |||||
| </AND> | |||||
| </match> | |||||
| <order>BY_NAME</order> | |||||
| </rule> | |||||
| </section> | |||||
| <section> | |||||
| <rule> | |||||
| <match> | |||||
| <AND> | |||||
| <NAME>.*</NAME> | |||||
| <XML_ATTRIBUTE /> | |||||
| <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> | |||||
| </AND> | |||||
| </match> | |||||
| <order>ANDROID_ATTRIBUTE_ORDER</order> | |||||
| </rule> | |||||
| </section> | |||||
| <section> | |||||
| <rule> | |||||
| <match> | |||||
| <AND> | |||||
| <NAME>.*</NAME> | |||||
| <XML_ATTRIBUTE /> | |||||
| <XML_NAMESPACE>.*</XML_NAMESPACE> | |||||
| </AND> | |||||
| </match> | |||||
| <order>BY_NAME</order> | |||||
| </rule> | |||||
| </section> | |||||
| </rules> | |||||
| </arrangement> | |||||
| </codeStyleSettings> | |||||
| </code_scheme> | |||||
| </component> |
| <component name="ProjectCodeStyleConfiguration"> | |||||
| <state> | |||||
| <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" /> | |||||
| </state> | |||||
| </component> |
| </component> | </component> | ||||
| <component name="ChangeListManager"> | <component name="ChangeListManager"> | ||||
| <list default="true" id="41369230-c648-4299-baf3-de5f13bcb18c" name="Changes" comment=""> | <list default="true" id="41369230-c648-4299-baf3-de5f13bcb18c" name="Changes" comment=""> | ||||
| <change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components/SuspendableTextWatcher.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.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/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/logic/BallisticResults.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/logic/BallisticResults.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components/FlightCurveChart.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components/FlightCurveChart.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components/FontTextView.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components/FontTextView.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components/XTextView.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components/XTextView.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/RBSDatabaseHelper.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/RBSDatabaseHelper.java" 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/database/dao/DAO.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/dao/DAO.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/dao/RiserDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/dao/RiserDao.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/dao/SightDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/dao/SightDao.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/scheme/data/TblRBSArcherySetup.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/scheme/data/TblRBSArcherySetup.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/scheme/masterdata/TblRBSRiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/scheme/masterdata/TblRBSRiser.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/scheme/masterdata/TblRBSSight.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/scheme/masterdata/TblRBSSight.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/logic/CalculationTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/logic/CalculationTask.java" afterDir="false" /> | <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/logic/CalculationTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/logic/CalculationTask.java" afterDir="false" /> | ||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/logic/TrajectoryCalculation.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/logic/TrajectoryCalculation.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/logic/TrajectoryCalculator.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/logic/TrajectoryCalculator.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/model/IEntity.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/IEntity.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/IRiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/IRiser.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/ISight.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/ISight.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/Riser.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/Riser.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/Sight.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/model/Sight.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/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/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/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/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/res/layout/fragment_calcsight_trajectory.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/fragment_calcsight_trajectory.xml" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/res/values/colors.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/colors.xml" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightTrajectoryViewModel.java" beforeDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationActivity.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/ArcherySetupConfigurationViewModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/ArcherySetupConfigurationViewModel.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/configuration/SightConfigurationViewModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/SightConfigurationViewModel.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/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/java/ch/spherIC/recurvebowsight/utilities/PlatformUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/utilities/PlatformUtils.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/utilities/UnitConverter.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/utilities/UnitConverter.java" afterDir="false" /> | |||||
| <change beforePath="$PROJECT_DIR$/app/src/main/res/values/attr.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/attr.xml" afterDir="false" /> | |||||
| </list> | </list> | ||||
| <option name="SHOW_DIALOG" value="false" /> | <option name="SHOW_DIALOG" value="false" /> | ||||
| <option name="HIGHLIGHT_CONFLICTS" value="true" /> | <option name="HIGHLIGHT_CONFLICTS" value="true" /> | ||||
| <property name="format.on.save" value="true" /> | <property name="format.on.save" value="true" /> | ||||
| <property name="last_opened_file_path" value="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components" /> | <property name="last_opened_file_path" value="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components" /> | ||||
| <property name="optimize.imports.on.save" value="true" /> | <property name="optimize.imports.on.save" value="true" /> | ||||
| <property name="settings.editor.selected.configurable" value="preferences.editor.code.editing" /> | |||||
| <property name="settings.editor.selected.configurable" value="preferences.sourceCode.Java" /> | |||||
| </component> | </component> | ||||
| <component name="RecentsManager"> | <component name="RecentsManager"> | ||||
| <key name="android.template.-1377507120"> | <key name="android.template.-1377507120"> | ||||
| <component name="XDebuggerManager"> | <component name="XDebuggerManager"> | ||||
| <breakpoint-manager> | <breakpoint-manager> | ||||
| <breakpoints> | <breakpoints> | ||||
| <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> | |||||
| <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/database/RBSDatabaseHelper.java</url> | |||||
| <line>99</line> | |||||
| <option name="timeStamp" value="4" /> | |||||
| </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>99</line> | |||||
| <option name="timeStamp" value="37" /> | |||||
| </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>173</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>129</line> | |||||
| <option name="timeStamp" value="42" /> | |||||
| </line-breakpoint> | |||||
| <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> | |||||
| <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/SightConfigurationActivity.java</url> | |||||
| <line>74</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>92</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>186</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>208</line> | |||||
| <option name="timeStamp" value="54" /> | |||||
| </line-breakpoint> | |||||
| <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> | |||||
| <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/SightConfigurationActivity.java</url> | |||||
| <line>120</line> | |||||
| <option name="timeStamp" value="55" /> | |||||
| </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>190</line> | |||||
| <option name="timeStamp" value="56" /> | |||||
| </line-breakpoint> | |||||
| <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> | |||||
| <url>file://$USER_HOME$/AppData/Local/Android/Sdk/sources/android-32/android/widget/TextView.java</url> | |||||
| <line>6178</line> | |||||
| <option name="timeStamp" value="68" /> | |||||
| </line-breakpoint> | |||||
| <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> | |||||
| <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightTrajectoryFragment.java</url> | |||||
| <line>68</line> | |||||
| <option name="timeStamp" value="79" /> | |||||
| </line-breakpoint> | |||||
| <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> | |||||
| <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightTrajectoryFragment.java</url> | |||||
| <line>53</line> | |||||
| <option name="timeStamp" value="90" /> | |||||
| </line-breakpoint> | |||||
| <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> | <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> | ||||
| <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersFragment.java</url> | <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersFragment.java</url> | ||||
| <line>212</line> | |||||
| <option name="timeStamp" value="108" /> | |||||
| <line>247</line> | |||||
| <option name="timeStamp" value="110" /> | |||||
| </line-breakpoint> | </line-breakpoint> | ||||
| </breakpoints> | </breakpoints> | ||||
| </breakpoint-manager> | </breakpoint-manager> |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight; | package ch.spherIC.recurvebowsight; | ||||
| SplashScreen splashScreen = androidx.core.splashscreen.SplashScreen.installSplashScreen(this); | SplashScreen splashScreen = androidx.core.splashscreen.SplashScreen.installSplashScreen(this); | ||||
| super.onCreate(savedInstanceState); | super.onCreate(savedInstanceState); | ||||
| binding = ActivityMainBinding.inflate(getLayoutInflater()); | |||||
| this.binding = ActivityMainBinding.inflate(getLayoutInflater()); | |||||
| setContentView(binding.getRoot()); | setContentView(binding.getRoot()); | ||||
| setSupportActionBar(binding.appBarMain.toolbar); | setSupportActionBar(binding.appBarMain.toolbar); | ||||
| /** | |||||
| * Copyright (C) 2005-2012 XELOG AG | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.components; | package ch.spherIC.recurvebowsight.components; | ||||
| import android.content.Context; | import android.content.Context; | ||||
| import android.graphics.Color; | import android.graphics.Color; | ||||
| import ch.spherIC.recurvebowsight.R; | |||||
| import ch.spherIC.recurvebowsight.logic.TrajectoryCalculator; | |||||
| import org.achartengine.ChartFactory; | import org.achartengine.ChartFactory; | ||||
| import org.achartengine.GraphicalView; | import org.achartengine.GraphicalView; | ||||
| import org.achartengine.model.XYMultipleSeriesDataset; | import org.achartengine.model.XYMultipleSeriesDataset; | ||||
| import org.achartengine.model.XYSeries; | import org.achartengine.model.XYSeries; | ||||
| import org.achartengine.renderer.XYMultipleSeriesRenderer; | import org.achartengine.renderer.XYMultipleSeriesRenderer; | ||||
| import org.achartengine.renderer.XYSeriesRenderer; | import org.achartengine.renderer.XYSeriesRenderer; | ||||
| import java.text.DecimalFormat; | import java.text.DecimalFormat; | ||||
| import ch.spherIC.recurvebowsight.R; | |||||
| import ch.spherIC.recurvebowsight.logic.TrajectoryCalculator; | |||||
| /** | /** | ||||
| * @author FC Smilari | |||||
| * @author FC Smilari | |||||
| */ | */ | ||||
| public class FlightCurveChart { | public class FlightCurveChart { | ||||
| this.mRenderer = new XYMultipleSeriesRenderer(); | this.mRenderer = new XYMultipleSeriesRenderer(); | ||||
| this.mRenderer.addSeriesRenderer(renderer); | this.mRenderer.addSeriesRenderer(renderer); | ||||
| this.mRenderer.setMargins(new int[] { 60, 80, 60, 60 }); // top, left, bottom, right | |||||
| this.mRenderer.setMargins(new int[]{60, 80, 60, 60}); // top, left, bottom, right | |||||
| this.mRenderer.setShowLegend(true); | this.mRenderer.setShowLegend(true); | ||||
| this.mRenderer.setAntialiasing(true); | this.mRenderer.setAntialiasing(true); | ||||
| this.mRenderer.setLabelsColor(Color.BLACK); | this.mRenderer.setLabelsColor(Color.BLACK); | ||||
| } | } | ||||
| /** | /** | ||||
| * @return the dataSet | |||||
| * @return the dataSet | |||||
| */ | */ | ||||
| public XYMultipleSeriesDataset getDataSet() { | public XYMultipleSeriesDataset getDataSet() { | ||||
| return this.dataSet; | return this.dataSet; | ||||
| } | } | ||||
| /** | /** | ||||
| * @return the mRenderer | |||||
| * @return the mRenderer | |||||
| */ | */ | ||||
| public XYMultipleSeriesRenderer getMultiRenderer() { | public XYMultipleSeriesRenderer getMultiRenderer() { | ||||
| return this.mRenderer; | return this.mRenderer; |
| /** | |||||
| * Copyright (C) 2012 - Florindo Smilari (spherIC) | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.components; | package ch.spherIC.recurvebowsight.components; | ||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||||
| */ | |||||
| package ch.spherIC.recurvebowsight.components; | |||||
| import android.text.Editable; | |||||
| import android.text.TextWatcher; | |||||
| /** | |||||
| * An TextWatcher whose execution of the update methods events can be suspended. | |||||
| */ | |||||
| public abstract class SuspendableTextWatcher implements TextWatcher { | |||||
| private boolean suspended = false; | |||||
| /** | |||||
| * Checks if this listener is in suspended mode. | |||||
| * | |||||
| * @return True if <code>suspended</code>, otherwise false | |||||
| */ | |||||
| public synchronized boolean isSuspended() { | |||||
| return suspended; | |||||
| } | |||||
| /** | |||||
| * Sets this listener to suspended mode, means the value of <code>suspended</code> is set to true. | |||||
| */ | |||||
| public synchronized void suspend() { | |||||
| this.suspended = true; | |||||
| } | |||||
| /** | |||||
| * Resumes this listener from suspended mode, means the value of <code>suspended</code> is set to false. | |||||
| */ | |||||
| public synchronized void resume() { | |||||
| this.suspended = false; | |||||
| } | |||||
| @Override | |||||
| public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |||||
| if (!isSuspended()) { | |||||
| onBeforeTextChanged(s, start, count, after); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void onTextChanged(final CharSequence s, final int start, final int before, final int count) { | |||||
| if (!isSuspended()) { | |||||
| onTextHasChanged(s, start, before, count); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void afterTextChanged(final Editable s) { | |||||
| if (!isSuspended()) { | |||||
| onAfterTextChanged(s); | |||||
| } | |||||
| } | |||||
| protected abstract void onBeforeTextChanged(CharSequence s, int start, int count, int after); | |||||
| protected abstract void onTextHasChanged(final CharSequence s, final int start, final int before, final int count); | |||||
| protected abstract void onAfterTextChanged(final Editable s); | |||||
| } |
| /* | /* | ||||
| * $URL$ | |||||
| * $Revision$ | |||||
| * $LastChangedBy$ | |||||
| * $LastChangedDate$ | |||||
| * | |||||
| * Copyright (c) 2011 spherIC, Switzerland | |||||
| * All rights reserved. | |||||
| * | |||||
| * This software is the confidential and proprietary information | |||||
| * of spherIC. ("Confidential Information"). You shall not | |||||
| * disclose such Confidential Information and shall use it only | |||||
| * in accordance with the terms of the license agreement you | |||||
| * entered into with spherIC. | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.components; | package ch.spherIC.recurvebowsight.components; | ||||
| /** | /** | ||||
| * Creates a new $class.name$ object. | * Creates a new $class.name$ object. | ||||
| * | * | ||||
| * @param context DOCUMENT ME! | |||||
| * @param attrs DOCUMENT ME! | |||||
| * @param context DOCUMENT ME! | |||||
| * @param attrs DOCUMENT ME! | |||||
| * @param defStyle DOCUMENT ME! | * @param defStyle DOCUMENT ME! | ||||
| */ | */ | ||||
| public XTextView(final Context context, final AttributeSet attrs, final int defStyle) { | public XTextView(final Context context, final AttributeSet attrs, final int defStyle) { | ||||
| * Creates a new $class.name$ object. | * Creates a new $class.name$ object. | ||||
| * | * | ||||
| * @param context DOCUMENT ME! | * @param context DOCUMENT ME! | ||||
| * @param attrs DOCUMENT ME! | |||||
| * @param attrs DOCUMENT ME! | |||||
| */ | */ | ||||
| public XTextView(final Context context, final AttributeSet attrs) { | public XTextView(final Context context, final AttributeSet attrs) { | ||||
| super(context, attrs); | super(context, attrs); | ||||
| if (this.drawborder) { | if (this.drawborder) { | ||||
| setPadding(getPaddingLeft() + this.drawborderWidth, getPaddingTop() + this.drawborderWidth, getPaddingRight() + this.drawborderWidth, | setPadding(getPaddingLeft() + this.drawborderWidth, getPaddingTop() + this.drawborderWidth, getPaddingRight() + this.drawborderWidth, | ||||
| getPaddingBottom() + this.drawborderWidth); | |||||
| getPaddingBottom() + this.drawborderWidth); | |||||
| } | } | ||||
| a.recycle(); | a.recycle(); | ||||
| } | } |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.database; | package ch.spherIC.recurvebowsight.database; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.database.dao; | package ch.spherIC.recurvebowsight.database.dao; | ||||
| IRiser riser = RiserDao.getInstance().loadById(cursor.getLong(3)); | IRiser riser = RiserDao.getInstance().loadById(cursor.getLong(3)); | ||||
| IArcherySetup archerySetup = new ArcherySetup(cursor.getLong(0), cursor.getString(1), sight, riser, cursor.getDouble(4), // | IArcherySetup archerySetup = new ArcherySetup(cursor.getLong(0), cursor.getString(1), sight, riser, cursor.getDouble(4), // | ||||
| cursor.getDouble(5), cursor.getDouble(6), cursor.getDouble(7), cursor.getDouble(8), | |||||
| cursor.getDouble(9), cursor.getDouble(10), cursor.getDouble(11), cursor.getDouble(12), | |||||
| cursor.getDouble(13), cursor.getDouble(14), cursor.getDouble(15), cursor.getDouble(16), | |||||
| cursor.getDouble(17)); | |||||
| cursor.getDouble(5), cursor.getDouble(6), cursor.getDouble(7), cursor.getDouble(8), | |||||
| cursor.getDouble(9), cursor.getDouble(10), cursor.getDouble(11), cursor.getDouble(12), | |||||
| cursor.getDouble(13), cursor.getDouble(14), cursor.getDouble(15), cursor.getDouble(16), | |||||
| cursor.getDouble(17)); | |||||
| return archerySetup; | return archerySetup; | ||||
| } | } | ||||
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.database.dao; | package ch.spherIC.recurvebowsight.database.dao; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.database.dao; | package ch.spherIC.recurvebowsight.database.dao; | ||||
| @Override | @Override | ||||
| protected IRiser cursorToEntity(final Cursor cursor) { | protected IRiser cursorToEntity(final Cursor cursor) { | ||||
| return new Riser(cursor.getLong(0), cursor.getString(1), cursor.getString(2), cursor.getDouble(3), cursor.getDouble(4), | return new Riser(cursor.getLong(0), cursor.getString(1), cursor.getString(2), cursor.getDouble(3), cursor.getDouble(4), | ||||
| cursor.getDouble(5)); | |||||
| cursor.getDouble(5)); | |||||
| } | } | ||||
| @Override | @Override |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.database.dao; | package ch.spherIC.recurvebowsight.database.dao; | ||||
| protected ISight cursorToEntity(final Cursor cursor) { | protected ISight cursorToEntity(final Cursor cursor) { | ||||
| ISight sight = new Sight(cursor.getLong(0), cursor.getString(1), cursor.getString(2), cursor.getDouble(3), // | ISight sight = new Sight(cursor.getLong(0), cursor.getString(1), cursor.getString(2), cursor.getDouble(3), // | ||||
| cursor.getDouble(4), cursor.getString(5), cursor.getDouble(6), cursor.getDouble(7), // | |||||
| cursor.getDouble(8)); | |||||
| cursor.getDouble(4), cursor.getString(5), cursor.getDouble(6), cursor.getDouble(7), // | |||||
| cursor.getDouble(8)); | |||||
| return sight; | return sight; | ||||
| } | } | ||||
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.database.scheme.data; | package ch.spherIC.recurvebowsight.database.scheme.data; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.database.scheme.masterdata; | package ch.spherIC.recurvebowsight.database.scheme.masterdata; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.database.scheme.masterdata; | package ch.spherIC.recurvebowsight.database.scheme.masterdata; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.logic; | package ch.spherIC.recurvebowsight.logic; | ||||
| protected void onProgressUpdate(final Integer... values) { | protected void onProgressUpdate(final Integer... values) { | ||||
| super.onProgressUpdate(values); | super.onProgressUpdate(values); | ||||
| this.calculator.getListener().updateTrajectoryTxtFld(values[0], this.calculator.getFlightCurve()[values[1]], this.calculator.getStartAngle(), | this.calculator.getListener().updateTrajectoryTxtFld(values[0], this.calculator.getFlightCurve()[values[1]], this.calculator.getStartAngle(), | ||||
| this.calculator.getMaxHCurve()); | |||||
| this.calculator.getMaxHCurve()); | |||||
| } | } | ||||
| @Override | @Override |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.logic; | package ch.spherIC.recurvebowsight.logic; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.logic; | package ch.spherIC.recurvebowsight.logic; |
| /** | |||||
| * Copyright (C) 2022 F. Smilari | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.model; | package ch.spherIC.recurvebowsight.model; | ||||
| @Override | @Override | ||||
| public boolean equals(Object o) { | public boolean equals(Object o) { | ||||
| if (this == o) return true; | |||||
| if (o == null || getClass() != o.getClass()) return false; | |||||
| if (this == o) { | |||||
| return true; | |||||
| } | |||||
| if (o == null || getClass() != o.getClass()) { | |||||
| return false; | |||||
| } | |||||
| ArcherySetup that = (ArcherySetup) o; | ArcherySetup that = (ArcherySetup) o; | ||||
| return id == that.id && name.equals(that.name); | return id == that.id && name.equals(that.name); | ||||
| } | } |
| /** | |||||
| * Copyright (C) 2022 F. Smilari | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.model; | package ch.spherIC.recurvebowsight.model; | ||||
| /** | |||||
| * Copyright (C) 2022 F. Smilari | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.model; | package ch.spherIC.recurvebowsight.model; | ||||
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.model; | package ch.spherIC.recurvebowsight.model; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.model; | package ch.spherIC.recurvebowsight.model; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.model; | package ch.spherIC.recurvebowsight.model; | ||||
| @Override | @Override | ||||
| public boolean equals(Object o) { | public boolean equals(Object o) { | ||||
| if (this == o) return true; | |||||
| if (o == null || getClass() != o.getClass()) return false; | |||||
| if (this == o) { | |||||
| return true; | |||||
| } | |||||
| if (o == null || getClass() != o.getClass()) { | |||||
| return false; | |||||
| } | |||||
| Riser riser = (Riser) o; | Riser riser = (Riser) o; | ||||
| return id == riser.id && manufacturer.equals(riser.manufacturer) && model.equals(riser.model); | return id == riser.id && manufacturer.equals(riser.manufacturer) && model.equals(riser.model); | ||||
| } | } |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.model; | package ch.spherIC.recurvebowsight.model; | ||||
| @Override | @Override | ||||
| public boolean equals(Object o) { | public boolean equals(Object o) { | ||||
| if (this == o) return true; | |||||
| if (o == null || getClass() != o.getClass()) return false; | |||||
| if (this == o) { | |||||
| return true; | |||||
| } | |||||
| if (o == null || getClass() != o.getClass()) { | |||||
| return false; | |||||
| } | |||||
| Sight sight = (Sight) o; | Sight sight = (Sight) o; | ||||
| return id == sight.id && manufacturer.equals(sight.manufacturer) && model.equals(sight.model); | return id == sight.id && manufacturer.equals(sight.manufacturer) && model.equals(sight.model); | ||||
| } | } |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.calcsight; | package ch.spherIC.recurvebowsight.ui.calcsight; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.calcsight; | package ch.spherIC.recurvebowsight.ui.calcsight; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.calcsight; | package ch.spherIC.recurvebowsight.ui.calcsight; | ||||
| import android.app.ProgressDialog; | import android.app.ProgressDialog; | ||||
| import android.content.Context; | import android.content.Context; | ||||
| import android.os.Bundle; | import android.os.Bundle; | ||||
| import android.text.Editable; | |||||
| import android.view.Gravity; | import android.view.Gravity; | ||||
| import android.view.LayoutInflater; | import android.view.LayoutInflater; | ||||
| import android.view.View; | import android.view.View; | ||||
| import androidx.fragment.app.Fragment; | import androidx.fragment.app.Fragment; | ||||
| import androidx.lifecycle.ViewModelProvider; | import androidx.lifecycle.ViewModelProvider; | ||||
| import ch.spherIC.recurvebowsight.R; | import ch.spherIC.recurvebowsight.R; | ||||
| import ch.spherIC.recurvebowsight.components.SuspendableTextWatcher; | |||||
| import ch.spherIC.recurvebowsight.databinding.FragmentCalcsightParametersBinding; | import ch.spherIC.recurvebowsight.databinding.FragmentCalcsightParametersBinding; | ||||
| import ch.spherIC.recurvebowsight.logic.BallisticResults; | import ch.spherIC.recurvebowsight.logic.BallisticResults; | ||||
| import ch.spherIC.recurvebowsight.logic.CalculationTask; | import ch.spherIC.recurvebowsight.logic.CalculationTask; | ||||
| public class CalculateSightParametersFragment extends Fragment implements TrajectoryCalculation { | public class CalculateSightParametersFragment extends Fragment implements TrajectoryCalculation { | ||||
| public static final DecimalFormat DF = new DecimalFormat("0.##"); | |||||
| public static final DecimalFormat DF_1 = new DecimalFormat("0.00"); | |||||
| public static final DecimalFormat DF_2 = new DecimalFormat("0.0##"); | |||||
| public static final DecimalFormat DF_EVS = new DecimalFormat("0.#"); | |||||
| private static final double CENTI = 0.01; | private static final double CENTI = 0.01; | ||||
| private static final double MILLI = 0.001; | private static final double MILLI = 0.001; | ||||
| private static final int MAX_TRAJ_POINTS = 200; | |||||
| private FragmentCalcsightParametersBinding binding; | private FragmentCalcsightParametersBinding binding; | ||||
| private CalculateSightParametersViewModel calculateSightViewModel; | private CalculateSightParametersViewModel calculateSightViewModel; | ||||
| private ProgressDialog progressDialog; | private ProgressDialog progressDialog; | ||||
| private SuspendableTextWatcher accuracyOptimizingTextWatcher; | |||||
| public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||||
| this.calculateSightViewModel = new ViewModelProvider(this).get(CalculateSightParametersViewModel.class); | this.calculateSightViewModel = new ViewModelProvider(this).get(CalculateSightParametersViewModel.class); | ||||
| this.binding.fabCalculate.setOnClickListener(new View.OnClickListener() { | this.binding.fabCalculate.setOnClickListener(new View.OnClickListener() { | ||||
| @Override | @Override | ||||
| public void onClick(View view) { | public void onClick(View view) { | ||||
| accuracyOptimizingTextWatcher.suspend(); | |||||
| updateModelFromUI(); | updateModelFromUI(); | ||||
| accuracyOptimizingTextWatcher.resume(); | |||||
| calculate(); | calculate(); | ||||
| } | } | ||||
| }); | }); | ||||
| loadCalculationAccuracies(root); | loadCalculationAccuracies(root); | ||||
| loadCalculationTimeIntervals(root); | loadCalculationTimeIntervals(root); | ||||
| addValueChangeListeners(); | |||||
| addObservers(); | addObservers(); | ||||
| return root; | return root; | ||||
| binding = null; | binding = null; | ||||
| } | } | ||||
| @Override | |||||
| public void updateTrajectoryTxtFld(Integer step, Double[] flightCurveRow, Double startAngle, Double[] maxHCurve) { | |||||
| } | |||||
| @Override | |||||
| public void onCalculationDone(BallisticResults ballisticResults) { | |||||
| Bundle bundle = new Bundle(); | |||||
| bundle.putParcelable("ballisticResults", ballisticResults); | |||||
| getParentFragmentManager().setFragmentResult("ballisticResults", bundle); | |||||
| if (this.progressDialog != null) { | |||||
| this.progressDialog.dismiss(); | |||||
| } | |||||
| ((CalculateSightFragment) getParentFragment()).scrollToTab(1); | |||||
| } | |||||
| private void addObservers() { | private void addObservers() { | ||||
| DecimalFormat dF = new DecimalFormat("#.#"); | |||||
| DecimalFormat dF2 = new DecimalFormat("#.##"); | |||||
| DecimalFormat dF3 = new DecimalFormat("#.###"); | |||||
| this.calculateSightViewModel.getArrowDiameter().observe(getViewLifecycleOwner(), arrowDiameter -> this.binding.arrowDiameterTxt.setText(arrowDiameter != null ? dF.format(arrowDiameter) : "")); | |||||
| this.calculateSightViewModel.getArrowCw().observe(getViewLifecycleOwner(), arrowCw -> this.binding.arrowCwTxt.setText(arrowCw != null ? dF.format(arrowCw) : "")); | |||||
| this.calculateSightViewModel.getArrowWeight().observe(getViewLifecycleOwner(), arrowWeight -> this.binding.arrowWeightTxt.setText(arrowWeight != null ? dF.format(arrowWeight) : "")); | |||||
| this.calculateSightViewModel.getBowPullout().observe(getViewLifecycleOwner(), bowPullout -> this.binding.bowPulloutTxt.setText(bowPullout != null ? dF.format(bowPullout) : "")); | |||||
| this.calculateSightViewModel.getArrowV0().observe(getViewLifecycleOwner(), arrowV0 -> this.binding.arrowV0Txt.setText(arrowV0 != null ? dF.format(arrowV0) : "")); | |||||
| this.calculateSightViewModel.getHNA().observe(getViewLifecycleOwner(), hNA -> this.binding.hNATxt.setText(hNA != null ? dF.format(hNA) : "")); | |||||
| this.calculateSightViewModel.getNockRaising().observe(getViewLifecycleOwner(), nockRaising -> this.binding.nockRaisingTxt.setText(nockRaising != null ? dF.format(nockRaising) : "")); | |||||
| this.calculateSightViewModel.getBraceHeight().observe(getViewLifecycleOwner(), braceHeight -> this.binding.braceHeightTxt.setText(braceHeight != null ? dF.format(braceHeight) : "")); | |||||
| this.calculateSightViewModel.getAirTemperature().observe(getViewLifecycleOwner(), airTemp -> this.binding.airTemperatureTxt.setText(airTemp != null ? dF.format(airTemp) : "")); | |||||
| this.calculateSightViewModel.getRelativeAirHumidity().observe(getViewLifecycleOwner(), relAirHumidity -> this.binding.airRelativeHumidityTxt.setText(relAirHumidity != null ? dF.format(relAirHumidity) : "")); | |||||
| this.calculateSightViewModel.getShootingDistance().observe(getViewLifecycleOwner(), shootingDistance -> this.binding.shootingDistanzTxt.setText(shootingDistance != null ? dF.format(shootingDistance) : "")); | |||||
| this.calculateSightViewModel.getArrowNockHeight().observe(getViewLifecycleOwner(), arrowNockHeight -> this.binding.arrowNockHeightTxt.setText(arrowNockHeight != null ? dF2.format(arrowNockHeight) : "")); | |||||
| this.calculateSightViewModel.getTargetCenterHeight().observe(getViewLifecycleOwner(), targetCenterHeight -> this.binding.targetCenterHeightTxt.setText(targetCenterHeight != null ? dF2.format(targetCenterHeight) : "")); | |||||
| this.calculateSightViewModel.getDeltaTime().observe(getViewLifecycleOwner(), deltaTime -> this.binding.deltaTimeTxt.setText(deltaTime != null ? dF3.format(deltaTime) : "")); | |||||
| this.calculateSightViewModel.getCalcPrecision().observe(getViewLifecycleOwner(), calcPrecision -> this.binding.calcPrecisionTxt.setText(calcPrecision != null ? dF.format(calcPrecision) : "")); | |||||
| this.calculateSightViewModel.getArrowDiameter().observe(getViewLifecycleOwner(), arrowDiameter -> this.binding.arrowDiameterTxt.setText(arrowDiameter != null ? DF.format(arrowDiameter) : "")); | |||||
| this.calculateSightViewModel.getArrowCw().observe(getViewLifecycleOwner(), arrowCw -> this.binding.arrowCwTxt.setText(arrowCw != null ? DF.format(arrowCw) : "")); | |||||
| this.calculateSightViewModel.getArrowWeight().observe(getViewLifecycleOwner(), arrowWeight -> this.binding.arrowWeightTxt.setText(arrowWeight != null ? DF.format(arrowWeight) : "")); | |||||
| this.calculateSightViewModel.getBowPullout().observe(getViewLifecycleOwner(), bowPullout -> this.binding.bowPulloutTxt.setText(bowPullout != null ? DF.format(bowPullout) : "")); | |||||
| this.calculateSightViewModel.getArrowV0().observe(getViewLifecycleOwner(), arrowV0 -> this.binding.arrowV0Txt.setText(arrowV0 != null ? DF.format(arrowV0) : "")); | |||||
| this.calculateSightViewModel.getHNA().observe(getViewLifecycleOwner(), hNA -> this.binding.hNATxt.setText(hNA != null ? DF.format(hNA) : "")); | |||||
| this.calculateSightViewModel.getNockRaising().observe(getViewLifecycleOwner(), nockRaising -> this.binding.nockRaisingTxt.setText(nockRaising != null ? DF.format(nockRaising) : "")); | |||||
| this.calculateSightViewModel.getBraceHeight().observe(getViewLifecycleOwner(), braceHeight -> this.binding.braceHeightTxt.setText(braceHeight != null ? DF.format(braceHeight) : "")); | |||||
| this.calculateSightViewModel.getAirTemperature().observe(getViewLifecycleOwner(), airTemp -> this.binding.airTemperatureTxt.setText(airTemp != null ? DF.format(airTemp) : "")); | |||||
| this.calculateSightViewModel.getRelativeAirHumidity().observe(getViewLifecycleOwner(), relAirHumidity -> this.binding.airRelativeHumidityTxt.setText(relAirHumidity != null ? DF.format(relAirHumidity) : "")); | |||||
| this.calculateSightViewModel.getShootingDistance().observe(getViewLifecycleOwner(), shootingDistance -> this.binding.shootingDistanzTxt.setText(shootingDistance != null ? DF.format(shootingDistance) : "")); | |||||
| this.calculateSightViewModel.getArrowNockHeight().observe(getViewLifecycleOwner(), arrowNockHeight -> this.binding.arrowNockHeightTxt.setText(arrowNockHeight != null ? DF_1.format(arrowNockHeight) : "")); | |||||
| this.calculateSightViewModel.getTargetCenterHeight().observe(getViewLifecycleOwner(), targetCenterHeight -> this.binding.targetCenterHeightTxt.setText(targetCenterHeight != null ? DF_1.format(targetCenterHeight) : "")); | |||||
| this.calculateSightViewModel.getDeltaTime().observe(getViewLifecycleOwner(), deltaTime -> this.binding.deltaTimeTxt.setText(deltaTime != null ? DF_2.format(deltaTime) : "")); | |||||
| this.calculateSightViewModel.getCalcPrecision().observe(getViewLifecycleOwner(), calcPrecision -> this.binding.calcPrecisionTxt.setText(calcPrecision != null ? DF.format(calcPrecision) : "")); | |||||
| } | } | ||||
| private void updateModelFromUI() { | private void updateModelFromUI() { | ||||
| InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); | InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); | ||||
| imm.hideSoftInputFromWindow(this.binding.getRoot().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); | imm.hideSoftInputFromWindow(this.binding.getRoot().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); | ||||
| this.progressDialog = ProgressDialog.show(binding.getRoot().getContext(), null, getResources().getString(R.string.caption_Calculating), true, false); | |||||
| this.progressDialog = ProgressDialog.show(binding.getRoot().getContext(), null, getResources().getString(R.string.caption_Calculating), | |||||
| true, false); | |||||
| CalculationTask calcTask = new CalculationTask(); | CalculationTask calcTask = new CalculationTask(); | ||||
| TrajectoryCalculator calculator = new TrajectoryCalculator( | |||||
| Double.valueOf(this.binding.arrowDiameterTxt.getText().toString().trim()) * MILLI, | |||||
| Double.valueOf(this.binding.arrowCwTxt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.arrowWeightTxt.getText().toString().trim()) * MILLI, | |||||
| Double.valueOf(this.binding.arrowV0Txt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.shootingDistanzTxt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.targetCenterHeightTxt.getText().toString().trim()) | |||||
| - Double.valueOf(this.binding.arrowNockHeightTxt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.airTemperatureTxt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.airRelativeHumidityTxt.getText().toString().trim()) * CENTI, | |||||
| Double.valueOf(this.binding.deltaTimeTxt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.calcPrecisionTxt.getText().toString().trim()) * CENTI, | |||||
| this); | |||||
| TrajectoryCalculator calculator = new TrajectoryCalculator(Double.valueOf(this.binding.arrowDiameterTxt.getText().toString().trim()) * MILLI, | |||||
| Double.valueOf(this.binding.arrowCwTxt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.arrowWeightTxt.getText().toString().trim()) * MILLI, | |||||
| Double.valueOf(this.binding.arrowV0Txt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.shootingDistanzTxt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.targetCenterHeightTxt.getText().toString().trim()) | |||||
| - Double.valueOf(this.binding.arrowNockHeightTxt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.airTemperatureTxt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.airRelativeHumidityTxt.getText().toString().trim()) * CENTI, | |||||
| Double.valueOf(this.binding.deltaTimeTxt.getText().toString().trim()), | |||||
| Double.valueOf(this.binding.calcPrecisionTxt.getText().toString().trim()) * CENTI, | |||||
| this); | |||||
| calculator.setStartAngle(0d); | calculator.setStartAngle(0d); | ||||
| calcTask.execute(calculator); | calcTask.execute(calculator); | ||||
| return true; | return true; | ||||
| } | } | ||||
| @Override | |||||
| public void updateTrajectoryTxtFld(Integer step, Double[] flightCurveRow, Double startAngle, Double[] maxHCurve) { | |||||
| private void addValueChangeListeners() { | |||||
| this.accuracyOptimizingTextWatcher = new SuspendableTextWatcher() { | |||||
| @Override | |||||
| protected void onBeforeTextChanged(CharSequence s, int start, int count, int after) { | |||||
| } | |||||
| @Override | |||||
| protected void onTextHasChanged(CharSequence s, int start, int before, int count) { | |||||
| } | |||||
| @Override | |||||
| protected void onAfterTextChanged(Editable s) { | |||||
| if (!binding.arrowV0Txt.getText().toString().isEmpty() && !binding.shootingDistanzTxt.getText().toString().isEmpty()) { | |||||
| calculateAndSetPerformantAccuracy(Double.valueOf(binding.arrowV0Txt.getText().toString()), | |||||
| Double.valueOf(binding.shootingDistanzTxt.getText().toString())); | |||||
| } | |||||
| } | |||||
| }; | |||||
| this.binding.arrowV0Txt.addTextChangedListener(this.accuracyOptimizingTextWatcher); | |||||
| this.binding.shootingDistanzTxt.addTextChangedListener(this.accuracyOptimizingTextWatcher); | |||||
| } | } | ||||
| @Override | |||||
| public void onCalculationDone(BallisticResults ballisticResults) { | |||||
| Bundle bundle = new Bundle(); | |||||
| bundle.putParcelable("ballisticResults", ballisticResults); | |||||
| getParentFragmentManager().setFragmentResult("ballisticResults", bundle); | |||||
| private void calculateAndSetPerformantAccuracy(final Double v0, final Double shootingDistance) { | |||||
| String[] calcAccuracies = getResources().getStringArray(R.array.CalculationTimeIntervals); | |||||
| String calcAccuracyToSet = calcAccuracies[calcAccuracies.length - 1]; | |||||
| Double approxFlightTime = shootingDistance / v0; | |||||
| Double approxIntervalTime = approxFlightTime / MAX_TRAJ_POINTS; | |||||
| if (this.progressDialog != null) { | |||||
| this.progressDialog.dismiss(); | |||||
| for (int i = 0; i < calcAccuracies.length - 1; i++) { | |||||
| Double accLow = Double.valueOf(calcAccuracies[i]); | |||||
| Double accHigh = Double.valueOf(calcAccuracies[i + 1]); | |||||
| if (accHigh < approxIntervalTime && approxIntervalTime <= accLow) { | |||||
| calcAccuracyToSet = calcAccuracies[i]; | |||||
| break; | |||||
| } | |||||
| } | } | ||||
| ((CalculateSightFragment) getParentFragment()).scrollToTab(1); | |||||
| this.binding.deltaTimeTxt.setText(calcAccuracyToSet); | |||||
| } | } | ||||
| } | } |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.calcsight; | package ch.spherIC.recurvebowsight.ui.calcsight; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.calcsight; | package ch.spherIC.recurvebowsight.ui.calcsight; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.calcsight; | package ch.spherIC.recurvebowsight.ui.calcsight; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.calcsight; | package ch.spherIC.recurvebowsight.ui.calcsight; | ||||
| import org.achartengine.model.XYSeries; | import org.achartengine.model.XYSeries; | ||||
| import java.text.DecimalFormat; | import java.text.DecimalFormat; | ||||
| import java.util.ArrayList; | |||||
| import java.util.Arrays; | |||||
| import java.util.stream.Collectors; | |||||
| import androidx.annotation.NonNull; | import androidx.annotation.NonNull; | ||||
| import androidx.annotation.Nullable; | import androidx.annotation.Nullable; | ||||
| import androidx.fragment.app.Fragment; | import androidx.fragment.app.Fragment; | ||||
| import androidx.fragment.app.FragmentResultListener; | |||||
| import androidx.lifecycle.ViewModelProvider; | |||||
| import ch.spherIC.recurvebowsight.R; | import ch.spherIC.recurvebowsight.R; | ||||
| import ch.spherIC.recurvebowsight.components.FlightCurveChart; | import ch.spherIC.recurvebowsight.components.FlightCurveChart; | ||||
| import ch.spherIC.recurvebowsight.components.XTextView; | import ch.spherIC.recurvebowsight.components.XTextView; | ||||
| public class CalculateSightTrajectoryFragment extends Fragment { | public class CalculateSightTrajectoryFragment extends Fragment { | ||||
| public static final DecimalFormat DF = new DecimalFormat("0.##"); | |||||
| public static final DecimalFormat DF_FC = new DecimalFormat("0.000"); | public static final DecimalFormat DF_FC = new DecimalFormat("0.000"); | ||||
| public static final DecimalFormat DF_1 = new DecimalFormat("0.00"); | |||||
| public static final DecimalFormat DF_EVS = new DecimalFormat("0.#"); | |||||
| private FragmentCalcsightTrajectoryBinding binding; | private FragmentCalcsightTrajectoryBinding binding; | ||||
| private FlightCurveChart flightCurveChart; | private FlightCurveChart flightCurveChart; | ||||
| } | } | ||||
| public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||||
| CalculateSightTrajectoryViewModel calculateSightTrajectoryViewModel = new ViewModelProvider(this).get(CalculateSightTrajectoryViewModel.class); | |||||
| binding = FragmentCalcsightTrajectoryBinding.inflate(inflater, container, false); | |||||
| View root = binding.getRoot(); | |||||
| this.binding = FragmentCalcsightTrajectoryBinding.inflate(inflater, container, false); | |||||
| View root = this.binding.getRoot(); | |||||
| this.flightCurveTxtFld = (XTextView) root.findViewById(R.id.flightCurveTxtFld); | this.flightCurveTxtFld = (XTextView) root.findViewById(R.id.flightCurveTxtFld); | ||||
| GraphicalView flightCurveChartView; | GraphicalView flightCurveChartView; | ||||
| layout = (LinearLayout) root.findViewById(R.id.ballisticResults); | layout = (LinearLayout) root.findViewById(R.id.ballisticResults); | ||||
| layout.addView(flightCurveChartView, 0, new LinearLayout.LayoutParams(ViewGroup.MarginLayoutParams.MATCH_PARENT, 0, 1f)); | layout.addView(flightCurveChartView, 0, new LinearLayout.LayoutParams(ViewGroup.MarginLayoutParams.MATCH_PARENT, 0, 1f)); | ||||
| getParentFragmentManager().setFragmentResultListener("ballisticResults", this, new FragmentResultListener() { | |||||
| @Override | |||||
| public void onFragmentResult(@NonNull String requestKey, @NonNull Bundle bundle) { | |||||
| getParentFragmentManager().setFragmentResultListener("ballisticResults", this, (requestKey, bundle) -> { | |||||
| if (requestKey.equals("ballisticResults")) { | |||||
| BallisticResults ballisticResults = bundle.getParcelable("ballisticResults"); | BallisticResults ballisticResults = bundle.getParcelable("ballisticResults"); | ||||
| updateFlightCurveChart(ballisticResults.getFlightCurve()); | updateFlightCurveChart(ballisticResults.getFlightCurve()); | ||||
| updateTrajectoryTxtFld(ballisticResults); | updateTrajectoryTxtFld(ballisticResults); | ||||
| binding = null; | binding = null; | ||||
| } | } | ||||
| private Double[] convert(double[] values) { | |||||
| return Arrays.stream(values).boxed().collect(Collectors.toCollection(ArrayList::new)).toArray(new Double[]{}); | |||||
| } | |||||
| /** | /** | ||||
| * Updates the graph. | * Updates the graph. | ||||
| * | * | ||||
| XYSeries series = new XYSeries(this.binding.getRoot().getResources().getString(R.string.fcChart_TitleLable)); | XYSeries series = new XYSeries(this.binding.getRoot().getResources().getString(R.string.fcChart_TitleLable)); | ||||
| for (int i = 0; i < flightCurve.length; i++) { | |||||
| series.add(flightCurve[i][TrajectoryCalculator.IDX_X], flightCurve[i][TrajectoryCalculator.IDX_Y]); | |||||
| for (Double[] doubles : flightCurve) { | |||||
| series.add(doubles[TrajectoryCalculator.IDX_X], doubles[TrajectoryCalculator.IDX_Y]); | |||||
| } | } | ||||
| this.flightCurveChart.getDataSet().removeSeries(0); | this.flightCurveChart.getDataSet().removeSeries(0); | ||||
| private void updateTrajectoryTxtFld(BallisticResults ballisticResults) { | private void updateTrajectoryTxtFld(BallisticResults ballisticResults) { | ||||
| updateTrajectoryTxtFld(0, ballisticResults.getFlightCurve()[0], ballisticResults.getStartAngle(), ballisticResults.getMaxHCurve(), ballisticResults.getFlightDuration()); | updateTrajectoryTxtFld(0, ballisticResults.getFlightCurve()[0], ballisticResults.getStartAngle(), ballisticResults.getMaxHCurve(), ballisticResults.getFlightDuration()); | ||||
| Double[][] flightCurve = ballisticResults.getFlightCurve(); | Double[][] flightCurve = ballisticResults.getFlightCurve(); | ||||
| for (int i = 0; i < flightCurve.length; i++) { | |||||
| updateTrajectoryTxtFld(1, flightCurve[i], null, null, null); | |||||
| for (Double[] doubles : flightCurve) { | |||||
| updateTrajectoryTxtFld(1, doubles, null, null, null); | |||||
| } | } | ||||
| } | } | ||||
| * Updates the text table field. | * Updates the text table field. | ||||
| * | * | ||||
| * @param flightCurveRow values to text one flight curve row | * @param flightCurveRow values to text one flight curve row | ||||
| * @param startAngle the start angle to display | |||||
| * @param maxHCurve max values of the flight curve | |||||
| * @param startAngle the start angle to display | |||||
| * @param maxHCurve max values of the flight curve | |||||
| */ | */ | ||||
| private void updateTrajectoryTxtFld(final Integer step, final Double[] flightCurveRow, final Double startAngle, final Double[] maxHCurve, final Double flightDuration) { | private void updateTrajectoryTxtFld(final Integer step, final Double[] flightCurveRow, final Double startAngle, final Double[] maxHCurve, final Double flightDuration) { | ||||
| int width = getParentFragment().getView().findViewById(R.id.fragment_calcsight_parameters).getMeasuredWidth() - UnitConverter.dpToPxH(2 * 8); | int width = getParentFragment().getView().findViewById(R.id.fragment_calcsight_parameters).getMeasuredWidth() - UnitConverter.dpToPxH(2 * 8); | ||||
| Double[] r1 = flightCurveRow; | |||||
| switch (step) { | switch (step) { | ||||
| case 0: | case 0: | ||||
| this.flightCurveTxtFld.setText(""); | this.flightCurveTxtFld.setText(""); | ||||
| this.flightCurveTxtFld.append(getResources().getString(R.string.fcChart_StartAngle) + DF_FC.format(startAngle) + " °\n\n"); | this.flightCurveTxtFld.append(getResources().getString(R.string.fcChart_StartAngle) + DF_FC.format(startAngle) + " °\n\n"); | ||||
| this.flightCurveTxtFld.append(getResources().getString(R.string.fcChart_MaxHeight) + DF_FC.format(maxHCurve[0]) | this.flightCurveTxtFld.append(getResources().getString(R.string.fcChart_MaxHeight) + DF_FC.format(maxHCurve[0]) | ||||
| + " m / " | |||||
| + DF_FC.format(maxHCurve[0] + Double.valueOf(arrowNockHeightTxtFld.getText().toString().trim())) | |||||
| + " m, [t = " + DF_FC.format(maxHCurve[1]) + " s]\n\n"); | |||||
| + " m / " | |||||
| + DF_FC.format(maxHCurve[0] + Double.parseDouble(arrowNockHeightTxtFld.getText().toString().trim())) | |||||
| + " m, [t = " + DF_FC.format(maxHCurve[1]) + " s]\n\n"); | |||||
| this.flightCurveTxtFld.append(getResources().getString(R.string.fcChart_FlightDuration) | this.flightCurveTxtFld.append(getResources().getString(R.string.fcChart_FlightDuration) | ||||
| + DF_FC.format(flightDuration) | |||||
| + " sec\n\n"); | |||||
| + DF_FC.format(flightDuration) | |||||
| + " sec\n\n"); | |||||
| SpannableString line = new SpannableString("t [sec]\tVx [m/s]\tVy [m/s]\tx [m]\ty [m]\n\n"); | SpannableString line = new SpannableString("t [sec]\tVx [m/s]\tVy [m/s]\tx [m]\ty [m]\n\n"); | ||||
| break; | break; | ||||
| case 1: | case 1: | ||||
| line = new SpannableString(DF_FC.format(r1[TrajectoryCalculator.IDX_T]) + '\t' | |||||
| + DF_FC.format(r1[TrajectoryCalculator.IDX_VX]) + '\t' | |||||
| + DF_FC.format(r1[TrajectoryCalculator.IDX_VY]) + '\t' | |||||
| + DF_FC.format(r1[TrajectoryCalculator.IDX_X]) + '\t' | |||||
| + DF_FC.format(r1[TrajectoryCalculator.IDX_Y]) + "\n"); | |||||
| line = new SpannableString(DF_FC.format(flightCurveRow[TrajectoryCalculator.IDX_T]) + '\t' | |||||
| + DF_FC.format(flightCurveRow[TrajectoryCalculator.IDX_VX]) + '\t' | |||||
| + DF_FC.format(flightCurveRow[TrajectoryCalculator.IDX_VY]) + '\t' | |||||
| + DF_FC.format(flightCurveRow[TrajectoryCalculator.IDX_X]) + '\t' | |||||
| + DF_FC.format(flightCurveRow[TrajectoryCalculator.IDX_Y]) + "\n"); | |||||
| line.setSpan(new TabStopSpan.Standard(width / 5), 0, line.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | line.setSpan(new TabStopSpan.Standard(width / 5), 0, line.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | ||||
| line.setSpan(new TabStopSpan.Standard(width / 5 * 2), 0, line.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | line.setSpan(new TabStopSpan.Standard(width / 5 * 2), 0, line.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | ||||
| line.setSpan(new TabStopSpan.Standard(width / 5 * 3), 0, line.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | line.setSpan(new TabStopSpan.Standard(width / 5 * 3), 0, line.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
| /** | |||||
| * 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 CalculateSightTrajectoryViewModel extends ViewModel { | |||||
| private final MutableLiveData<String> mText; | |||||
| public CalculateSightTrajectoryViewModel() { | |||||
| mText = new MutableLiveData<>(); | |||||
| mText.setValue("This is the \"Calculate Sight Trajectory\" fragment"); | |||||
| } | |||||
| public LiveData<String> getText() { | |||||
| return mText; | |||||
| } | |||||
| } |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.configuration; | package ch.spherIC.recurvebowsight.ui.configuration; | ||||
| private void addNewArcherySetup() { | private void addNewArcherySetup() { | ||||
| IArcherySetup newArcherySetup = new ArcherySetup(0, "", null, null, null, null, | IArcherySetup newArcherySetup = new ArcherySetup(0, "", null, null, null, null, | ||||
| null, null, null, null, null, null, null, | |||||
| null, null, null, null, null); | |||||
| null, null, null, null, null, null, null, | |||||
| null, null, null, null, null); | |||||
| this.archerySetupConfigurationViewModel.setArcherySetup(newArcherySetup); | this.archerySetupConfigurationViewModel.setArcherySetup(newArcherySetup); | ||||
| String strMandatory = getString(R.string.caption_mandatory); | String strMandatory = getString(R.string.caption_mandatory); | ||||
| this.binding.asArcherySetupSelectionTxt.setText(null, false); | this.binding.asArcherySetupSelectionTxt.setText(null, false); |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.configuration; | package ch.spherIC.recurvebowsight.ui.configuration; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.configuration; | package ch.spherIC.recurvebowsight.ui.configuration; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.configuration; | package ch.spherIC.recurvebowsight.ui.configuration; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.configuration; | package ch.spherIC.recurvebowsight.ui.configuration; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.configuration; | package ch.spherIC.recurvebowsight.ui.configuration; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.equipment; | package ch.spherIC.recurvebowsight.ui.equipment; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.equipment; | package ch.spherIC.recurvebowsight.ui.equipment; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.ui.equipment; | package ch.spherIC.recurvebowsight.ui.equipment; | ||||
| @Override | @Override | ||||
| public void onClick(View v) { | public void onClick(View v) { | ||||
| Toast.makeText(EquipmentRecyclerViewAdapter.this.context, | Toast.makeText(EquipmentRecyclerViewAdapter.this.context, | ||||
| context.getString(R.string.caption_setup_choosen) + holder.archerySetup, | |||||
| Toast.LENGTH_SHORT).show(); | |||||
| context.getString(R.string.caption_setup_choosen) + holder.archerySetup, | |||||
| Toast.LENGTH_SHORT).show(); | |||||
| Bundle bundle = new Bundle(); | Bundle bundle = new Bundle(); | ||||
| bundle.putParcelable("setup", holder.archerySetup); | bundle.putParcelable("setup", holder.archerySetup); |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.utilities; | package ch.spherIC.recurvebowsight.utilities; |
| /** | |||||
| /* | |||||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | * Copyright (C) 2022 - Florindo Smilari (spherIC) | ||||
| */ | */ | ||||
| package ch.spherIC.recurvebowsight.utilities; | package ch.spherIC.recurvebowsight.utilities; |
| <attr name="drawBorderColor" format="color" /> | <attr name="drawBorderColor" format="color" /> | ||||
| </declare-styleable> | </declare-styleable> | ||||
| <declare-styleable name="FontTextView"> | |||||
| <!-- <attr name="font" format="string" />--> | |||||
| </declare-styleable> | |||||
| </resources> | </resources> |