| @@ -21,17 +21,7 @@ | |||
| </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" afterDir="true" /> | |||
| <change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/EquipmentConfigurationActivity.java" afterDir="false" /> | |||
| <change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/RiserConfigurationActivity.java" afterDir="false" /> | |||
| <change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/RiserConfigurationViewModel.java" afterDir="false" /> | |||
| <change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/SightConfigurationActivity.java" afterDir="false" /> | |||
| <change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/ic_icon_add.xml" afterDir="false" /> | |||
| <change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/ic_icon_delete.xml" afterDir="false" /> | |||
| <change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/ic_icon_save.xml" afterDir="false" /> | |||
| <change afterPath="$PROJECT_DIR$/app/src/main/res/layout/activity_equipment_configuration.xml" afterDir="false" /> | |||
| <change afterPath="$PROJECT_DIR$/app/src/main/res/layout/activity_riser_configuration.xml" afterDir="false" /> | |||
| <change afterPath="$PROJECT_DIR$/app/src/main/res/layout/activity_sight_configuration.xml" afterDir="false" /> | |||
| <change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/configuration/SightConfigurationViewModel.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" /> | |||
| @@ -41,13 +31,25 @@ | |||
| <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/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/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/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/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/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/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/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_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/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" /> | |||
| @@ -113,7 +115,7 @@ | |||
| <property name="format.on.save" value="true" /> | |||
| <property name="last_opened_file_path" value="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight" /> | |||
| <property name="optimize.imports.on.save" value="true" /> | |||
| <property name="settings.editor.selected.configurable" value="preferences.keymap" /> | |||
| <property name="settings.editor.selected.configurable" value="preferences.editor.code.editing" /> | |||
| </component> | |||
| <component name="RecentsManager"> | |||
| <key name="android.template.-1377507120"> | |||
| @@ -252,39 +254,39 @@ | |||
| </line-breakpoint> | |||
| <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> | |||
| <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/EquipmentRecyclerViewAdapter.java</url> | |||
| <line>48</line> | |||
| <line>51</line> | |||
| <option name="timeStamp" value="10" /> | |||
| </line-breakpoint> | |||
| <line-breakpoint enabled="true" suspend="THREAD" type="java-line"> | |||
| <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/equipment/EquipmentRecyclerViewAdapter.java</url> | |||
| <line>51</line> | |||
| <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>75</line> | |||
| <option name="timeStamp" value="25" /> | |||
| </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>80</line> | |||
| <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>95</line> | |||
| <line>98</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>168</line> | |||
| <line>171</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>124</line> | |||
| <line>127</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>73</line> | |||
| <option name="timeStamp" value="43" /> | |||
| </line-breakpoint> | |||
| </breakpoints> | |||
| </breakpoint-manager> | |||
| <watches-manager> | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight; | |||
| import android.os.Bundle; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.calcsight; | |||
| import androidx.annotation.NonNull; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.calcsight; | |||
| import android.os.Bundle; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.calcsight; | |||
| import android.os.Bundle; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.calcsight; | |||
| import androidx.lifecycle.LiveData; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.calcsight; | |||
| import android.os.Bundle; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.calcsight; | |||
| import androidx.lifecycle.LiveData; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.calcsight; | |||
| import android.os.Bundle; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.calcsight; | |||
| import androidx.lifecycle.LiveData; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.calcsight; | |||
| import android.text.TextUtils; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.configuration; | |||
| import android.os.Bundle; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.configuration; | |||
| import android.app.AlertDialog; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.configuration; | |||
| import androidx.lifecycle.LiveData; | |||
| @@ -1,14 +1,34 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.configuration; | |||
| import android.app.AlertDialog; | |||
| import android.content.DialogInterface; | |||
| 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.SightDao; | |||
| import ch.spherIC.recurvebowsight.databinding.ActivitySightConfigurationBinding; | |||
| import ch.spherIC.recurvebowsight.model.ISight; | |||
| import ch.spherIC.recurvebowsight.model.Sight; | |||
| import ch.spherIC.recurvebowsight.utilities.PlatformUtils; | |||
| public class SightConfigurationActivity extends AppCompatActivity { | |||
| private ActivitySightConfigurationBinding binding; | |||
| private SightConfigurationViewModel sightConfigurationViewModel; | |||
| @Override | |||
| protected void onCreate(Bundle savedInstanceState) { | |||
| super.onCreate(savedInstanceState); | |||
| @@ -16,8 +36,16 @@ public class SightConfigurationActivity extends AppCompatActivity { | |||
| getSupportActionBar().setDisplayHomeAsUpEnabled(true); | |||
| getSupportActionBar().setTitle(R.string.title_activity_sight_configuration); | |||
| this.sightConfigurationViewModel = new ViewModelProvider(this).get(SightConfigurationViewModel.class); | |||
| this.binding = ActivitySightConfigurationBinding.bind(findViewById(R.id.activity_sight_configuration)); | |||
| addObservers(); | |||
| addSightSpinnerListener(); | |||
| addButtonListeners(); | |||
| loadSights(); | |||
| } | |||
| @Override | |||
| public boolean onOptionsItemSelected(@NonNull MenuItem item) { | |||
| switch (item.getItemId()) { | |||
| @@ -28,4 +56,147 @@ public class SightConfigurationActivity extends AppCompatActivity { | |||
| return super.onOptionsItemSelected(item); | |||
| } | |||
| } | |||
| private void addObservers() { | |||
| DecimalFormat dF = new DecimalFormat("#.#"); | |||
| this.sightConfigurationViewModel.getManufacturer().observe(this, manufacturer -> this.binding.scManufacturerTxt.setText(manufacturer)); | |||
| this.sightConfigurationViewModel.getModel().observe(this, model -> this.binding.scModelTxt.setText(model)); | |||
| this.sightConfigurationViewModel.getAH().observe(this, aH -> this.binding.scaHTxt.setText(aH != null ? dF.format(aH) : "")); | |||
| this.sightConfigurationViewModel.getAV().observe(this, aV -> this.binding.scaVTxt.setText(aV != null ? dF.format(aV) : "")); | |||
| this.sightConfigurationViewModel.getHeVis().observe(this, heVis -> this.binding.sccHeVSTxt.setText(heVis)); | |||
| this.sightConfigurationViewModel.getVertSkalaRangMin().observe(this, vertScRngMin -> this.binding.scVertScaleRngMinTxt.setText(vertScRngMin != null ? dF.format(vertScRngMin) : "")); | |||
| this.sightConfigurationViewModel.getVertSkalaRangMax().observe(this, vertScRngMax -> this.binding.scVertScaleRngMaxTxt.setText(vertScRngMax != null ? dF.format(vertScRngMax) : "")); | |||
| this.sightConfigurationViewModel.getPointerOffset().observe(this, pointerOffset -> this.binding.scPointerOffsetTxt.setText(pointerOffset != null ? dF.format(pointerOffset) : "")); | |||
| } | |||
| private void addSightSpinnerListener() { | |||
| AutoCompleteTextView textView = findViewById(R.id.sightSelectionTxt); | |||
| textView.setOnItemClickListener((parent, view, position, id) -> { | |||
| ISight selectedSight = (ISight) textView.getAdapter().getItem(position); | |||
| if (selectedSight != null) { | |||
| sightConfigurationViewModel.setSight(selectedSight); | |||
| } | |||
| }); | |||
| } | |||
| private void addButtonListeners() { | |||
| Button newButton = findViewById(R.id.sightcfg_button_new); | |||
| newButton.setOnClickListener(v -> addNewSight()); | |||
| Button deleteButton = findViewById(R.id.sightcfg_button_delete); | |||
| deleteButton.setOnClickListener(v -> deleteSight()); | |||
| Button saveButton = findViewById(R.id.sightcfg_button_save); | |||
| saveButton.setOnClickListener(v -> saveSightConfiguration()); | |||
| } | |||
| private void loadSights() { | |||
| List<ISight> sights = SightDao.getInstance().loadAll(); | |||
| ArrayAdapter<ISight> adapter = new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line, sights); | |||
| AutoCompleteTextView textView = this.binding.sightSelectionTxt; | |||
| textView.setAdapter(adapter); | |||
| textView.invalidate(); | |||
| } | |||
| private void addNewSight() { | |||
| ISight newSight = new Sight(0, "", "", null, null, null, null, null, null); | |||
| this.sightConfigurationViewModel.setSight(newSight); | |||
| String strMandatory = getString(R.string.caption_mandatory); | |||
| this.binding.sightSelectionTxt.setText(null); | |||
| this.binding.scManufacturerTxt.setError(strMandatory); | |||
| this.binding.scModelTxt.setError(strMandatory); | |||
| this.binding.scaVTxt.setError(strMandatory); | |||
| this.binding.scaHTxt.setError(strMandatory); | |||
| this.binding.sccHeVSTxt.setError(strMandatory); | |||
| this.binding.scVertScaleRngMinTxt.setError(strMandatory); | |||
| this.binding.scVertScaleRngMaxTxt.setError(strMandatory); | |||
| this.binding.scPointerOffsetTxt.setError(strMandatory); | |||
| AutoCompleteTextView textView = this.binding.sightSelectionTxt; | |||
| ((ArrayAdapter<ISight>) textView.getAdapter()).insert(newSight, 0); | |||
| textView.setAdapter((ArrayAdapter<ISight>) textView.getAdapter()); | |||
| textView.setSelection(0); | |||
| } | |||
| private void saveSightConfiguration() { | |||
| if (!validateInputs()) { | |||
| return; | |||
| } | |||
| this.sightConfigurationViewModel.setManufacturerText(this.binding.scManufacturerTxt.getText().toString()); | |||
| this.sightConfigurationViewModel.setModelText(this.binding.scModelTxt.getText().toString()); | |||
| this.sightConfigurationViewModel.setAH(Double.parseDouble(this.binding.scaHTxt.getText().toString())); | |||
| this.sightConfigurationViewModel.setAV(Double.parseDouble(this.binding.scaVTxt.getText().toString())); | |||
| this.sightConfigurationViewModel.setHeVis(this.binding.sccHeVSTxt.getText().toString()); | |||
| this.sightConfigurationViewModel.setVertSkalaRangMin(Double.parseDouble(this.binding.scVertScaleRngMinTxt.getText().toString())); | |||
| this.sightConfigurationViewModel.setVertSkalaRangMax(Double.parseDouble(this.binding.scVertScaleRngMaxTxt.getText().toString())); | |||
| this.sightConfigurationViewModel.setPointerOffset(Double.parseDouble(this.binding.scPointerOffsetTxt.getText().toString())); | |||
| ISight lSight = this.sightConfigurationViewModel.getRiser().getValue(); | |||
| if (lSight.getId() > 0) { | |||
| SightDao.getInstance().update(lSight); | |||
| } else { | |||
| lSight = SightDao.getInstance().insert(lSight); | |||
| loadSights(); | |||
| AutoCompleteTextView textView = this.binding.sightSelectionTxt; | |||
| final int position = ((ArrayAdapter<ISight>) textView.getAdapter()).getPosition(lSight); | |||
| textView.setListSelection(position); | |||
| textView.setText(lSight.toString()); | |||
| ((ArrayAdapter<ISight>) textView.getAdapter()).getFilter().filter(null); | |||
| PlatformUtils.toast(SightConfigurationActivity.this, String.format(getString(R.string.caption_Cfg_SaveSuccessful), lSight)).show(); | |||
| } | |||
| } | |||
| private boolean validateInputs() { | |||
| int invalidFields = 0; | |||
| if (this.binding.scManufacturerTxt.getText().toString().isEmpty() || this.binding.scManufacturerTxt.getText().toString().equals("*")) { | |||
| invalidFields++; | |||
| } | |||
| if (this.binding.scModelTxt.getText().toString().isEmpty() || this.binding.scModelTxt.getText().toString().equals("*")) { | |||
| invalidFields++; | |||
| } | |||
| if (this.binding.scaVTxt.getText() == null || this.binding.scaVTxt.getText().toString().equals("")) { | |||
| invalidFields++; | |||
| } | |||
| if (this.binding.scaHTxt.getText() == null || this.binding.scaHTxt.getText().toString().equals("")) { | |||
| invalidFields++; | |||
| } | |||
| if (this.binding.sccHeVSTxt.getText() == null || this.binding.sccHeVSTxt.getText().toString().equals("")) { | |||
| invalidFields++; | |||
| } | |||
| if (this.binding.scVertScaleRngMinTxt.getText() == null || this.binding.scVertScaleRngMinTxt.getText().toString().equals("")) { | |||
| invalidFields++; | |||
| } | |||
| if (this.binding.scVertScaleRngMaxTxt.getText() == null || this.binding.scVertScaleRngMaxTxt.getText().toString().equals("")) { | |||
| invalidFields++; | |||
| } | |||
| if (this.binding.scPointerOffsetTxt.getText() == null || this.binding.scPointerOffsetTxt.getText().toString().equals("")) { | |||
| invalidFields++; | |||
| } | |||
| if (invalidFields > 0) { | |||
| PlatformUtils.toast(this, getResources().getString(R.string.caption_Cfg_FillAllMandatoryFields)).show(); | |||
| return false; | |||
| } | |||
| return true; | |||
| } | |||
| private void deleteSight() { | |||
| ISight lSight = this.sightConfigurationViewModel.getRiser().getValue(); | |||
| if (lSight != null) { | |||
| AlertDialog dlg = PlatformUtils.getDeleteConfirmDialog(this, lSight.toString(), new DialogInterface.OnClickListener() { | |||
| @Override | |||
| public void onClick(final DialogInterface dialog, final int which) { | |||
| String message = String.format(getString(R.string.caption_Cfg_DeleteSuccessful), lSight); | |||
| try { | |||
| SightDao.getInstance().delete(lSight); | |||
| loadSights(); | |||
| sightConfigurationViewModel.setSight(null); | |||
| binding.sightSelectionTxt.setText(null); | |||
| } catch (Exception e) { | |||
| message = getString(R.string.caption_Cfg_DeleteNotPossible); | |||
| } | |||
| PlatformUtils.toast(SightConfigurationActivity.this, message).show(); | |||
| } | |||
| }); | |||
| dlg.show(); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,149 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.configuration; | |||
| import androidx.lifecycle.LiveData; | |||
| import androidx.lifecycle.MutableLiveData; | |||
| import androidx.lifecycle.ViewModel; | |||
| import ch.spherIC.recurvebowsight.model.ISight; | |||
| public class SightConfigurationViewModel extends ViewModel { | |||
| private final MutableLiveData<ISight> mSight; | |||
| private final MutableLiveData<String> mManufacturer; | |||
| private final MutableLiveData<String> mModel; | |||
| private final MutableLiveData<Double> maV; | |||
| private final MutableLiveData<Double> maH; | |||
| private final MutableLiveData<String> mheVis; | |||
| private final MutableLiveData<Double> mVertSkalaRangMin; | |||
| private final MutableLiveData<Double> mVertSkalaRangMax; | |||
| private final MutableLiveData<Double> mPointerOffset; | |||
| public SightConfigurationViewModel() { | |||
| this.mSight = new MutableLiveData<>(); | |||
| this.mManufacturer = new MutableLiveData<>(); | |||
| this.mModel = new MutableLiveData<>(); | |||
| this.maV = new MutableLiveData<>(); | |||
| this.maH = new MutableLiveData<>(); | |||
| this.mheVis = new MutableLiveData<>(); | |||
| this.mVertSkalaRangMin = new MutableLiveData<>(); | |||
| this.mVertSkalaRangMax = new MutableLiveData<>(); | |||
| this.mPointerOffset = new MutableLiveData<>(); | |||
| this.mSight.setValue(null); | |||
| this.mManufacturer.setValue(""); | |||
| this.mModel.setValue(""); | |||
| this.maV.setValue(null); | |||
| this.maH.setValue(null); | |||
| this.mheVis.setValue(""); | |||
| this.mVertSkalaRangMin.setValue(null); | |||
| this.mVertSkalaRangMax.setValue(null); | |||
| this.mPointerOffset.setValue(null); | |||
| } | |||
| public void setSight(ISight aSight) { | |||
| this.mSight.setValue(aSight); | |||
| this.mManufacturer.setValue(aSight != null ? aSight.getManufacturer() : ""); | |||
| this.mModel.setValue(aSight != null ? aSight.getModel() : ""); | |||
| this.maV.setValue(aSight != null ? aSight.getAV() : null); | |||
| this.maH.setValue(aSight != null ? aSight.getAH() : null); | |||
| this.mheVis.setValue(aSight != null ? aSight.getHeVis() : ""); | |||
| this.mVertSkalaRangMin.setValue(aSight != null ? aSight.getVertSkalaRangeMin() : null); | |||
| this.mVertSkalaRangMax.setValue(aSight != null ? aSight.getVertSkalaRangeMax() : null); | |||
| this.mPointerOffset.setValue(aSight != null ? aSight.getPointerOffset() : null); | |||
| } | |||
| public void setManufacturerText(String manufacturerText) { | |||
| if (this.mSight.getValue() != null) { | |||
| this.mSight.getValue().setManufacturer(manufacturerText); | |||
| } | |||
| this.mManufacturer.setValue(manufacturerText); | |||
| } | |||
| public void setModelText(String modelText) { | |||
| if (this.mSight.getValue() != null) { | |||
| this.mSight.getValue().setModel(modelText); | |||
| } | |||
| this.mModel.setValue(modelText); | |||
| } | |||
| public void setAH(Double aH) { | |||
| if (this.mSight.getValue() != null) { | |||
| this.mSight.getValue().setAH(aH); | |||
| } | |||
| this.maH.setValue(aH); | |||
| } | |||
| public void setAV(Double aV) { | |||
| if (this.mSight.getValue() != null) { | |||
| this.mSight.getValue().setAV(aV); | |||
| } | |||
| this.maV.setValue(aV); | |||
| } | |||
| public void setHeVis(String heVis) { | |||
| if (this.mSight.getValue() != null) { | |||
| this.mSight.getValue().setHeVis(heVis); | |||
| } | |||
| this.mheVis.setValue(heVis); | |||
| } | |||
| public void setVertSkalaRangMin(Double aVertSkalaRangMin) { | |||
| if (this.mSight.getValue() != null) { | |||
| this.mSight.getValue().setVertSkalaRangeMin(aVertSkalaRangMin); | |||
| } | |||
| this.mVertSkalaRangMin.setValue(aVertSkalaRangMin); | |||
| } | |||
| public void setVertSkalaRangMax(Double aVertSkalaRangMax) { | |||
| if (this.mSight.getValue() != null) { | |||
| this.mSight.getValue().setVertSkalaRangeMax(aVertSkalaRangMax); | |||
| } | |||
| this.mVertSkalaRangMax.setValue(aVertSkalaRangMax); | |||
| } | |||
| public void setPointerOffset(Double aPointerOffset) { | |||
| if (this.mSight.getValue() != null) { | |||
| this.mSight.getValue().setPointerOffset(aPointerOffset); | |||
| } | |||
| this.mPointerOffset.setValue(aPointerOffset); | |||
| } | |||
| public LiveData<String> getManufacturer() { | |||
| return this.mManufacturer; | |||
| } | |||
| public LiveData<ISight> getRiser() { | |||
| return mSight; | |||
| } | |||
| public LiveData<String> getModel() { | |||
| return mModel; | |||
| } | |||
| public LiveData<Double> getAV() { | |||
| return maV; | |||
| } | |||
| public LiveData<Double> getAH() { | |||
| return maH; | |||
| } | |||
| public LiveData<String> getHeVis() { | |||
| return mheVis; | |||
| } | |||
| public LiveData<Double> getVertSkalaRangMin() { | |||
| return mVertSkalaRangMin; | |||
| } | |||
| public LiveData<Double> getVertSkalaRangMax() { | |||
| return mVertSkalaRangMax; | |||
| } | |||
| public LiveData<Double> getPointerOffset() { | |||
| return mPointerOffset; | |||
| } | |||
| } | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.equipment; | |||
| import android.content.Intent; | |||
| @@ -6,12 +9,10 @@ import android.view.LayoutInflater; | |||
| import android.view.MotionEvent; | |||
| import android.view.View; | |||
| import android.view.ViewGroup; | |||
| import android.widget.TextView; | |||
| import androidx.annotation.NonNull; | |||
| import androidx.constraintlayout.widget.ConstraintLayout; | |||
| import androidx.fragment.app.Fragment; | |||
| import androidx.lifecycle.ViewModelProvider; | |||
| import ch.spherIC.recurvebowsight.R; | |||
| import ch.spherIC.recurvebowsight.databinding.FragmentEquipmentAddListBinding; | |||
| import ch.spherIC.recurvebowsight.ui.configuration.EquipmentConfigurationActivity; | |||
| @@ -23,7 +24,6 @@ public class AddEquipmentFragment extends Fragment { | |||
| private FragmentEquipmentAddListBinding binding; | |||
| public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |||
| AddEquipmentViewModel homeViewModel = new ViewModelProvider(this).get(AddEquipmentViewModel.class); | |||
| binding = FragmentEquipmentAddListBinding.inflate(inflater, container, false); | |||
| View root = binding.getRoot(); | |||
| @@ -31,8 +31,6 @@ public class AddEquipmentFragment extends Fragment { | |||
| attachTouchListener(root, R.id.card_view_sight_border, R.id.card_view_sight_setup); | |||
| attachTouchListener(root, R.id.card_view_equipment_border, R.id.card_view_equipment_setup); | |||
| final TextView textView = binding.textEquipment; | |||
| homeViewModel.getText().observe(getViewLifecycleOwner(), textView::setText); | |||
| return root; | |||
| } | |||
| @@ -47,6 +45,7 @@ public class AddEquipmentFragment extends Fragment { | |||
| View setupCardView = root.findViewById(setupCardViewId); | |||
| if (borderCardView != null && setupCardView != null) { | |||
| borderCardView.setOnTouchListener(new View.OnTouchListener() { | |||
| @Override | |||
| public boolean onTouch(View v, MotionEvent event) { | |||
| float alpha = 1.0f; | |||
| @@ -65,25 +64,16 @@ public class AddEquipmentFragment extends Fragment { | |||
| if (event.getAction() == MotionEvent.ACTION_UP) { | |||
| if (v.getId() == R.id.card_view_riser_border) { | |||
| /* Toast.makeText(v.getContext(), | |||
| "Geklickt: " + v.getId(), | |||
| Toast.LENGTH_SHORT).show();*/ | |||
| // TODO: CALL RISER CONFIG ACTIVITY | |||
| Intent riserConfigurationIntent = new Intent(v.getContext(), RiserConfigurationActivity.class); | |||
| startActivity(riserConfigurationIntent); | |||
| } else if (v.getId() == R.id.card_view_sight_border) { | |||
| // TODO: CALL SIGHT CONFIG ACTIVITY | |||
| Intent sightConfigurationIntent = new Intent(v.getContext(), SightConfigurationActivity.class); | |||
| startActivity(sightConfigurationIntent); | |||
| } else if (v.getId() == R.id.card_view_equipment_border) { | |||
| // TODO: CALL EQUIPMENT CONFIG ACTIVITY | |||
| Intent equipmentConfigurationIntent = new Intent(v.getContext(), EquipmentConfigurationActivity.class); | |||
| startActivity(equipmentConfigurationIntent); | |||
| } | |||
| } | |||
| return true; | |||
| } | |||
| }); | |||
| @@ -1,19 +0,0 @@ | |||
| package ch.spherIC.recurvebowsight.ui.equipment; | |||
| import androidx.lifecycle.LiveData; | |||
| import androidx.lifecycle.MutableLiveData; | |||
| import androidx.lifecycle.ViewModel; | |||
| public class AddEquipmentViewModel extends ViewModel { | |||
| private final MutableLiveData<String> mText; | |||
| public AddEquipmentViewModel() { | |||
| mText = new MutableLiveData<>(); | |||
| mText.setValue("This is \"ADD Equipment\" fragment"); | |||
| } | |||
| public LiveData<String> getText() { | |||
| return mText; | |||
| } | |||
| } | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.equipment; | |||
| import android.content.Context; | |||
| @@ -1,3 +1,6 @@ | |||
| /** | |||
| * Copyright (C) 2022 - Florindo Smilari (spherIC) | |||
| */ | |||
| package ch.spherIC.recurvebowsight.ui.equipment; | |||
| import android.content.Context; | |||
| @@ -57,10 +60,10 @@ public class EquipmentRecyclerViewAdapter extends RecyclerView.Adapter<Equipment | |||
| horzMargin = v.getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin_onclick); | |||
| vertMargin = v.getResources().getDimensionPixelSize(R.dimen.activity_vertical_margin_onclick); | |||
| } | |||
| View setupCardView = ((ConstraintLayout) v).findViewById(R.id.card_view_setup); | |||
| View setupCardView = v.findViewById(R.id.card_view_setup); | |||
| setupCardView.setAlpha(alpha); | |||
| setupCardView = ((ConstraintLayout) v).findViewById(R.id.card_view_border); | |||
| setupCardView = v.findViewById(R.id.card_view_border); | |||
| ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) setupCardView.getLayoutParams(); | |||
| layoutParams.setMargins(horzMargin, vertMargin, horzMargin, vertMargin); | |||
| setupCardView.requestLayout(); | |||
| @@ -1,9 +1,279 @@ | |||
| <?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_sight_configuration" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="match_parent" | |||
| tools:context=".ui.configuration.SightConfigurationActivity"> | |||
| <ScrollView | |||
| android:layout_width="0dp" | |||
| android:layout_height="0dp" | |||
| 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/configSightLbl" | |||
| 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/scTitleSightConfig" | |||
| 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/sightSelectionLayout" | |||
| 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/configSightLbl"> | |||
| <AutoCompleteTextView | |||
| android:id="@+id/sightSelectionTxt" | |||
| 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/scManufacturerLayout" | |||
| 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/sightSelectionLayout"> | |||
| <com.google.android.material.textfield.TextInputEditText | |||
| android:id="@+id/scManufacturerTxt" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:hint="@string/scManufacturerLbl" | |||
| android:singleLine="true" /> | |||
| </com.google.android.material.textfield.TextInputLayout> | |||
| <com.google.android.material.textfield.TextInputLayout | |||
| android:id="@+id/scModelLayout" | |||
| 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/scManufacturerLayout"> | |||
| <com.google.android.material.textfield.TextInputEditText | |||
| android:id="@+id/scModelTxt" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:hint="@string/scModelLbl" | |||
| android:singleLine="true" /> | |||
| </com.google.android.material.textfield.TextInputLayout> | |||
| <com.google.android.material.textfield.TextInputLayout | |||
| android:id="@+id/sccHeVSLayout" | |||
| 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/scModelLayout"> | |||
| <com.google.android.material.textfield.TextInputEditText | |||
| android:id="@+id/sccHeVSTxt" | |||
| 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:id="@+id/scaVHLinearLayout" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:layout_marginTop="8dp" | |||
| android:orientation="horizontal" | |||
| app:layout_constraintEnd_toEndOf="parent" | |||
| app:layout_constraintStart_toStartOf="parent" | |||
| app:layout_constraintTop_toBottomOf="@+id/sccHeVSLayout"> | |||
| <com.google.android.material.textfield.TextInputLayout | |||
| android:id="@+id/scaVLayout" | |||
| style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" | |||
| android:layout_weight="1" | |||
| android:layout_width="fill_parent" | |||
| android:layout_height="wrap_content" | |||
| android:layout_marginHorizontal="8dp" | |||
| app:layout_constraintEnd_toEndOf="parent" | |||
| app:layout_constraintStart_toStartOf="parent" | |||
| app:layout_constraintTop_toBottomOf="@+id/sccHeVSLayout"> | |||
| <com.google.android.material.textfield.TextInputEditText | |||
| android:id="@+id/scaVTxt" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:hint="@string/scaVLbl" | |||
| android:singleLine="true" /> | |||
| </com.google.android.material.textfield.TextInputLayout> | |||
| <com.google.android.material.textfield.TextInputLayout | |||
| android:id="@+id/scaHLayout" | |||
| style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" | |||
| android:layout_weight="1" | |||
| android:layout_width="fill_parent" | |||
| android:layout_height="wrap_content" | |||
| android:layout_marginHorizontal="8dp" | |||
| app:layout_constraintEnd_toEndOf="parent" | |||
| app:layout_constraintStart_toStartOf="parent" | |||
| app:layout_constraintTop_toBottomOf="@+id/sccHeVSLayout"> | |||
| <com.google.android.material.textfield.TextInputEditText | |||
| android:id="@+id/scaHTxt" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:hint="@string/scaHLbl" | |||
| android:singleLine="true" /> | |||
| </com.google.android.material.textfield.TextInputLayout> | |||
| </LinearLayout> | |||
| <com.google.android.material.textfield.TextInputLayout | |||
| android:id="@+id/scVertScaleRngMinLayout" | |||
| style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" | |||
| android:layout_weight="1" | |||
| android:layout_width="fill_parent" | |||
| android:layout_height="wrap_content" | |||
| android:layout_marginTop="8dp" | |||
| android:layout_marginHorizontal="8dp" | |||
| app:layout_constraintEnd_toEndOf="parent" | |||
| app:layout_constraintStart_toStartOf="parent" | |||
| app:layout_constraintTop_toBottomOf="@+id/scaVHLinearLayout"> | |||
| <com.google.android.material.textfield.TextInputEditText | |||
| android:id="@+id/scVertScaleRngMinTxt" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:hint="@string/scVertScaleRngMinLbl" | |||
| android:singleLine="true" /> | |||
| </com.google.android.material.textfield.TextInputLayout> | |||
| <com.google.android.material.textfield.TextInputLayout | |||
| android:id="@+id/scVertScaleRngMaxLayout" | |||
| style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" | |||
| android:layout_weight="1" | |||
| android:layout_width="fill_parent" | |||
| android:layout_height="wrap_content" | |||
| android:layout_marginTop="8dp" | |||
| android:layout_marginHorizontal="8dp" | |||
| app:layout_constraintEnd_toEndOf="parent" | |||
| app:layout_constraintStart_toStartOf="parent" | |||
| app:layout_constraintTop_toBottomOf="@+id/scVertScaleRngMinLayout"> | |||
| <com.google.android.material.textfield.TextInputEditText | |||
| android:id="@+id/scVertScaleRngMaxTxt" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:hint="@string/scVertScaleRngMaxLbl" | |||
| android:singleLine="true" /> | |||
| </com.google.android.material.textfield.TextInputLayout> | |||
| <com.google.android.material.textfield.TextInputLayout | |||
| android:id="@+id/scPointerOffsetLayout" | |||
| style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" | |||
| android:layout_weight="1" | |||
| android:layout_width="fill_parent" | |||
| android:layout_height="wrap_content" | |||
| android:layout_marginTop="8dp" | |||
| android:layout_marginHorizontal="8dp" | |||
| app:layout_constraintEnd_toEndOf="parent" | |||
| app:layout_constraintStart_toStartOf="parent" | |||
| app:layout_constraintTop_toBottomOf="@+id/scVertScaleRngMaxLayout"> | |||
| <com.google.android.material.textfield.TextInputEditText | |||
| android:id="@+id/scPointerOffsetTxt" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:hint="@string/scPointerOffsetLbl" | |||
| 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/scPointerOffsetLayout"> | |||
| <Button | |||
| android:id="@+id/sightcfg_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/sightcfg_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/sightcfg_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> | |||
| @@ -315,16 +315,4 @@ | |||
| </androidx.cardview.widget.CardView> | |||
| </androidx.constraintlayout.widget.ConstraintLayout> | |||
| <TextView | |||
| android:id="@+id/text_equipment" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:layout_marginEnd="8dp" | |||
| android:layout_marginStart="8dp" | |||
| android:textAlignment="center" | |||
| android:textSize="20sp" | |||
| app:layout_constraintEnd_toEndOf="parent" | |||
| app:layout_constraintStart_toStartOf="parent" | |||
| app:layout_constraintTop_toBottomOf="@+id/constraintLayout3" /> | |||
| </androidx.constraintlayout.widget.ConstraintLayout> | |||
| @@ -62,6 +62,20 @@ | |||
| <string name="rcSizeLbl">Größe</string> | |||
| <string name="rcVvisHLbl">VvisH [mm]</string> | |||
| <string name="rcVvisVLbl">VvisV [mm]</string> | |||
| <string name="scTitleSightConfig">Konfiguration Visier</string> | |||
| <string name="rcSightLbl">Visier</string> | |||
| <string name="scManufacturerLbl">Hersteller</string> | |||
| <string name="scModelLbl">Modell</string> | |||
| <string name="scHeVSLbl">Horz. Einst. Visierschlitten [mm]</string> | |||
| <string name="scaHLbl">aH [mm]</string> | |||
| <string name="scaVLbl">aV [mm]</string> | |||
| <string name="scVertScaleRngLbl">Bereich vert. Skala [mm] /\nSkalenversatz [mm]</string> | |||
| <string name="scVertScaleRngMinLbl">Min. Bereich vert. Skala [mm]</string> | |||
| <string name="scVertScaleRngMaxLbl">Max. Bereich vert. Skala [mm]</string> | |||
| <string name="scVertSkalaMiddleLbl">Mittelstellung M vert. Skala [mm]</string> | |||
| <string name="scPointerOffsetLbl">Versatz Skalenzeiger [mm]</string> | |||
| <string name="scEvSLbl">EvS [mm]</string> | |||
| <string name="caption_Ok">OK</string> | |||
| <string name="caption_Cancel">Abbrechen</string> | |||
| @@ -62,6 +62,20 @@ | |||
| <string name="rcSizeLbl">Size</string> | |||
| <string name="rcVvisHLbl">VvisH [mm]</string> | |||
| <string name="rcVvisVLbl">VvisV [mm]</string> | |||
| <string name="scTitleSightConfig">Sight Configuration</string> | |||
| <string name="rcSightLbl">Sight</string> | |||
| <string name="scManufacturerLbl">Manufacturer</string> | |||
| <string name="scModelLbl">Model</string> | |||
| <string name="scHeVSLbl">Horz. Sight Sliding Carriage [mm]</string> | |||
| <string name="scaHLbl">aH [mm]</string> | |||
| <string name="scaVLbl">aV [mm]</string> | |||
| <string name="scVertScaleRngLbl">Vert. Scale Range [mm] /\nScale Pointer Offset [mm]</string> | |||
| <string name="scVertScaleRngMinLbl">Vert. Scale Range Min. [mm]</string> | |||
| <string name="scVertScaleRngMaxLbl">Vert. Scale Range Max. [mm]</string> | |||
| <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="caption_Ok">OK</string> | |||
| <string name="caption_Cancel">Cancel</string> | |||