Procházet zdrojové kódy

Calculation and results display

master
Flo Smilari před 3 roky
rodič
revize
dbc1846eae

binární
.gradle/7.3.3/executionHistory/executionHistory.bin Zobrazit soubor


binární
.gradle/7.3.3/executionHistory/executionHistory.lock Zobrazit soubor


binární
.gradle/7.3.3/fileHashes/fileHashes.bin Zobrazit soubor


binární
.gradle/7.3.3/fileHashes/fileHashes.lock Zobrazit soubor


binární
.gradle/7.3.3/fileHashes/resourceHashesCache.bin Zobrazit soubor


binární
.gradle/buildOutputCleanup/buildOutputCleanup.lock Zobrazit soubor


+ 13
- 49
.idea/workspace.xml Zobrazit soubor

</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/libs/achartengine-1.1.0.jar" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components" afterDir="true" />
<change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components/FlightCurveChart.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components/FontTextView.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/components/XTextView.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/logic/BallisticResults.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/checksums/checksums.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/checksums/checksums.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/checksums/sha1-checksums.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/checksums/sha1-checksums.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/executionHistory/executionHistory.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/fileHashes.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/resourceHashesCache.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/7.3.3/fileHashes/resourceHashesCache.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/buildOutputCleanup/outputFiles.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/outputFiles.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/modules/app/RecurveBowSight.app.androidTest.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/app/RecurveBowSight.app.androidTest.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/modules/app/RecurveBowSight.app.main.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/app/RecurveBowSight.app.main.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/modules/app/RecurveBowSight.app.unitTest.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/app/RecurveBowSight.app.unitTest.iml" 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/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/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/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/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/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/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/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/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-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/colors.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/colors.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/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.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" />
<line>6178</line> <line>6178</line>
<option name="timeStamp" value="68" /> <option name="timeStamp" value="68" />
</line-breakpoint> </line-breakpoint>
<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>
<line>211</line>
<option name="timeStamp" value="75" />
</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>52</line>
<option name="timeStamp" value="76" />
</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/CalculateSightTrajectoryFragment.java</url> <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightTrajectoryFragment.java</url>
<line>67</line>
<line>68</line>
<option name="timeStamp" value="79" /> <option name="timeStamp" value="79" />
</line-breakpoint> </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/CalculateSightTrajectoryFragment.java</url> <url>file://$PROJECT_DIR$/app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightTrajectoryFragment.java</url>
<line>122</line>
<option name="timeStamp" value="80" />
<line>53</line>
<option name="timeStamp" value="90" />
</line-breakpoint> </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/CalculateSightTrajectoryFragment.java</url>
<line>79</line>
<option name="timeStamp" value="81" />
</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>48</line>
<option name="timeStamp" value="83" />
<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-breakpoint> </line-breakpoint>
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>
<watch expression="getViewLifecycleOwner()" language="JAVA" /> <watch expression="getViewLifecycleOwner()" language="JAVA" />
<watch expression="getParentFragment()" language="JAVA" /> <watch expression="getParentFragment()" language="JAVA" />
<watch expression="getParentFragment().getArguments()" language="JAVA" /> <watch expression="getParentFragment().getArguments()" language="JAVA" />
<watch expression="getParentFragmentManager().getFragments().get(1).get" language="JAVA" />
<watch expression="getActivity()" language="JAVA" />
<watch expression="getChildFragmentManager().getFragments()" language="JAVA" />
<watch expression="getParentFragment().getView().findViewById(R.id.arrowNockHeightTxt)" language="JAVA" /> <watch expression="getParentFragment().getView().findViewById(R.id.arrowNockHeightTxt)" language="JAVA" />
<watch expression="this.calculator.getListener()" language="JAVA" />
<watch expression="this.calculator.getFlightCurve()[values[1]]" language="JAVA" />
<watch expression="(values[0]" language="JAVA" />
<watch expression="getParentFragmentManager().getFragments()" language="JAVA" />
<watch expression="getParentFragment().getView().findViewById(R.id.fragment_calcsight_parameters).getMeasuredWidth()" language="JAVA" custom="ch.spherIC.recurvebowsight.R" />
</configuration> </configuration>
</watches-manager> </watches-manager>
</component> </component>

+ 2
- 0
app/src/main/java/ch/spherIC/recurvebowsight/RBSMainActivity.java Zobrazit soubor

import androidx.navigation.ui.NavigationUI; import androidx.navigation.ui.NavigationUI;
import ch.spherIC.recurvebowsight.database.RBSDatabaseHelper; import ch.spherIC.recurvebowsight.database.RBSDatabaseHelper;
import ch.spherIC.recurvebowsight.databinding.ActivityMainBinding; import ch.spherIC.recurvebowsight.databinding.ActivityMainBinding;
import ch.spherIC.recurvebowsight.utilities.UnitConverter;


public class RBSMainActivity extends AppCompatActivity { public class RBSMainActivity extends AppCompatActivity {


NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration); NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController); NavigationUI.setupWithNavController(navigationView, navController);


UnitConverter.setApplication(getApplication());
RBSDatabaseHelper.setContext(this); RBSDatabaseHelper.setContext(this);
RBSDatabaseHelper.getInstance().initializeDB(); RBSDatabaseHelper.getInstance().initializeDB();
} }

+ 10
- 2
app/src/main/java/ch/spherIC/recurvebowsight/logic/BallisticResults.java Zobrazit soubor

private Double[][] flightCurve; private Double[][] flightCurve;
private Double startAngle; private Double startAngle;
private Double[] maxHCurve;
private Double flightDuration;
/** /**
* Constructor for ballistic results. * Constructor for ballistic results.
* @param startAngle flight curve start angle * @param startAngle flight curve start angle
* @param maxHCurve max height of flight curve * @param maxHCurve max height of flight curve
*/ */
public BallisticResults(Double[][] flightCurve, Double startAngle, Double[] maxHCurve) {
public BallisticResults(Double[][] flightCurve, Double startAngle, Double[] maxHCurve, Double flightDuration) {
this.flightCurve = flightCurve; this.flightCurve = flightCurve;
this.startAngle = startAngle; this.startAngle = startAngle;
this.maxHCurve = maxHCurve; this.maxHCurve = maxHCurve;
this.flightDuration = flightDuration;
} }
public Double[][] getFlightCurve() { public Double[][] getFlightCurve() {
this.maxHCurve = maxHCurve; this.maxHCurve = maxHCurve;
} }
private Double[] maxHCurve;
public Double getFlightDuration() {
return flightDuration;
}
public void setFlightDuration(Double flightDuration) {
this.flightDuration = flightDuration;
}
@Override @Override
public int describeContents() { public int describeContents() {

+ 3
- 1
app/src/main/java/ch/spherIC/recurvebowsight/logic/CalculationTask.java Zobrazit soubor

@Override @Override
protected void onPostExecute(final TrajectoryCalculator calculator) { protected void onPostExecute(final TrajectoryCalculator calculator) {
super.onPostExecute(calculator); super.onPostExecute(calculator);
BallisticResults ballisticResults = new BallisticResults(calculator.getFlightCurve(), calculator.getStartAngle(), calculator.getMaxHCurve());
Double[][] flightCurve = calculator.getFlightCurve();
Double flightDuration = flightCurve[flightCurve.length - 1][0];
BallisticResults ballisticResults = new BallisticResults(flightCurve, calculator.getStartAngle(), calculator.getMaxHCurve(), flightDuration);
calculator.getListener().onCalculationDone(ballisticResults); calculator.getListener().onCalculationDone(ballisticResults);
} }

+ 4
- 0
app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightFragment.java Zobrazit soubor

this.binding = null; this.binding = null;
this.viewPager.unregisterOnPageChangeCallback(this.pageChangeCallback); this.viewPager.unregisterOnPageChangeCallback(this.pageChangeCallback);
} }

public void scrollToTab(int position) {
this.viewPager.setCurrentItem(position);
}
} }

+ 5
- 15
app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightParametersFragment.java Zobrazit soubor

import android.widget.Toast; import android.widget.Toast;


import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.stream.Stream;


import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;


@Override @Override
public void updateTrajectoryTxtFld(Integer step, Double[] flightCurveRow, Double startAngle, Double[] maxHCurve) { public void updateTrajectoryTxtFld(Integer step, Double[] flightCurveRow, Double startAngle, Double[] maxHCurve) {
Bundle bundle = new Bundle();
bundle.putInt("step", step);
bundle.putDoubleArray("flightCurveRow", Stream.of(flightCurveRow).mapToDouble(Double::doubleValue).toArray());
bundle.putDouble("startAngle", startAngle);
bundle.putDoubleArray("maxHCurve", Stream.of(maxHCurve).mapToDouble(Double::doubleValue).toArray());
getParentFragmentManager().setFragmentResult("updateTrajectory", bundle);
} }


@Override @Override
public void onCalculationDone(BallisticResults ballisticResults) { public void onCalculationDone(BallisticResults ballisticResults) {
if (this.progressDialog != null) {
this.progressDialog.dismiss();
}

Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putParcelable("ballisticResults", ballisticResults); bundle.putParcelable("ballisticResults", ballisticResults);
getParentFragmentManager().setFragmentResult("ballisticResults", bundle); getParentFragmentManager().setFragmentResult("ballisticResults", bundle);


//TODO: Remove toast when result fragments are done
Toast toast = Toast.makeText(binding.getRoot().getContext(), "Abschusswinkel: " + ballisticResults.getStartAngle(), Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
if (this.progressDialog != null) {
this.progressDialog.dismiss();
}

((CalculateSightFragment) getParentFragment()).scrollToTab(1);
} }
} }

+ 15
- 14
app/src/main/java/ch/spherIC/recurvebowsight/ui/calcsight/CalculateSightTrajectoryFragment.java Zobrazit soubor

import ch.spherIC.recurvebowsight.databinding.FragmentCalcsightTrajectoryBinding; import ch.spherIC.recurvebowsight.databinding.FragmentCalcsightTrajectoryBinding;
import ch.spherIC.recurvebowsight.logic.BallisticResults; import ch.spherIC.recurvebowsight.logic.BallisticResults;
import ch.spherIC.recurvebowsight.logic.TrajectoryCalculator; import ch.spherIC.recurvebowsight.logic.TrajectoryCalculator;
import ch.spherIC.recurvebowsight.utilities.UnitConverter;


public class CalculateSightTrajectoryFragment extends Fragment { public class CalculateSightTrajectoryFragment extends Fragment {


public void onFragmentResult(@NonNull String requestKey, @NonNull Bundle bundle) { public void onFragmentResult(@NonNull String requestKey, @NonNull Bundle bundle) {
BallisticResults ballisticResults = bundle.getParcelable("ballisticResults"); BallisticResults ballisticResults = bundle.getParcelable("ballisticResults");
updateFlightCurveChart(ballisticResults.getFlightCurve()); updateFlightCurveChart(ballisticResults.getFlightCurve());
}
});

getParentFragmentManager().setFragmentResultListener("updateTrajectory", this, new FragmentResultListener() {
@Override
public void onFragmentResult(@NonNull String requestKey, @NonNull Bundle bundle) {
int step = bundle.getInt("step");
double[] flightCurveRow = bundle.getDoubleArray("flightCurveRow");
double startAngle = bundle.getDouble("startAngle");
double[] maxHCurve = bundle.getDoubleArray("maxHCurve");
updateTrajectoryTxtFld(step, convert(flightCurveRow), startAngle, convert(maxHCurve));
updateTrajectoryTxtFld(ballisticResults);
} }
}); });


return root; return root;
} }



@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
this.flightCurveChart.updateRendererAfterCalculation(flightCurve[flightCurve.length - 1][TrajectoryCalculator.IDX_X], flightCurve); this.flightCurveChart.updateRendererAfterCalculation(flightCurve[flightCurve.length - 1][TrajectoryCalculator.IDX_X], flightCurve);
} }


private void updateTrajectoryTxtFld(BallisticResults ballisticResults) {
updateTrajectoryTxtFld(0, ballisticResults.getFlightCurve()[0], ballisticResults.getStartAngle(), ballisticResults.getMaxHCurve(), ballisticResults.getFlightDuration());
Double[][] flightCurve = ballisticResults.getFlightCurve();
for (int i = 0; i < flightCurve.length; i++) {
updateTrajectoryTxtFld(1, flightCurve[i], null, null, null);
}
}


/** /**
* Updates the text table field. * Updates the text table field.
* *
* @param startAngle the start angle to display * @param startAngle the start angle to display
* @param maxHCurve max values of the flight curve * @param maxHCurve max values of the flight curve
*/ */
private void updateTrajectoryTxtFld(final Integer step, final Double[] flightCurveRow, final Double startAngle, final Double[] maxHCurve) {
int width = this.flightCurveTxtFld.getMeasuredWidth();
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);
Double[] r1 = flightCurveRow; Double[] r1 = flightCurveRow;


switch (step) { switch (step) {
+ DF_FC.format(maxHCurve[0] + Double.valueOf(arrowNockHeightTxtFld.getText().toString().trim())) + DF_FC.format(maxHCurve[0] + Double.valueOf(arrowNockHeightTxtFld.getText().toString().trim()))
+ " m, [t = " + DF_FC.format(maxHCurve[1]) + " s]\n\n"); + " 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(r1[TrajectoryCalculator.IDX_T])
+ DF_FC.format(flightDuration)
+ " sec\n\n"); + " sec\n\n");





+ 1
- 1
app/src/main/res/layout/fragment_calcsight_trajectory.xml Zobrazit soubor

android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginHorizontal="8dp" android:layout_marginHorizontal="8dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:background="@color/white"
android:background="@color/light_gray"
android:ems="10" android:ems="10"
android:inputType="textMultiLine" android:inputType="textMultiLine"
android:padding="4dp" android:padding="4dp"

+ 1
- 0
app/src/main/res/values/colors.xml Zobrazit soubor

<color name="teal_700">#FF018786</color> <color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="light_gray">#EBF1F8</color>
<color name="qrt_translucent_white">#BDFFFFFF</color> <color name="qrt_translucent_white">#BDFFFFFF</color>
<color name="semi_translucent_black">#80000000</color> <color name="semi_translucent_black">#80000000</color>
</resources> </resources>

Načítá se…
Zrušit
Uložit