| @@ -113,7 +113,7 @@ | |||
| android:layout_weight="1" | |||
| android:background="@color/yellow" | |||
| android:paddingBottom="3dip" | |||
| android:paddingLeft="3dip" | |||
| android:paddingLeft="6dp" | |||
| android:paddingTop="3dip" | |||
| android:text="@string/titleBowAndArrowParams" | |||
| android:textColor="@color/black" | |||
| @@ -291,7 +291,7 @@ | |||
| android:layout_weight="1" | |||
| android:background="@color/yellow" | |||
| android:paddingBottom="3dip" | |||
| android:paddingLeft="3dip" | |||
| android:paddingLeft="6dp" | |||
| android:paddingTop="3dip" | |||
| android:text="@string/titleAtmosphericalParams" | |||
| android:textColor="@color/black" | |||
| @@ -375,7 +375,7 @@ | |||
| android:layout_weight="1" | |||
| android:background="@color/yellow" | |||
| android:paddingBottom="3dip" | |||
| android:paddingLeft="3dip" | |||
| android:paddingLeft="6dp" | |||
| android:paddingTop="3dip" | |||
| android:text="@string/titleShootingParams" | |||
| android:textColor="@color/black" | |||
| @@ -490,7 +490,7 @@ | |||
| android:layout_weight="1" | |||
| android:background="@color/yellow" | |||
| android:paddingBottom="3dip" | |||
| android:paddingLeft="3dip" | |||
| android:paddingLeft="6dp" | |||
| android:paddingTop="3dip" | |||
| android:text="@string/titleCalculationParams" | |||
| android:textColor="@color/black" | |||
| @@ -606,23 +606,38 @@ | |||
| <TableRow | |||
| android:id="@+id/tableSCRow0" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:layout_gravity="center" | |||
| android:layout_margin="4dp" > | |||
| android:layout_height="wrap_content" > | |||
| <ch.spherIC.recurvebowsight.components.FontTextView | |||
| android:id="@+id/sightConfigTitle" | |||
| android:layout_width="0dp" | |||
| <LinearLayout | |||
| android:id="@+id/scTitleBarLayout" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:layout_margin="4dp" | |||
| android:layout_weight="1" | |||
| android:background="@color/yellow" | |||
| android:paddingBottom="3dip" | |||
| android:paddingLeft="3dip" | |||
| android:paddingTop="3dip" | |||
| android:text="@string/titleSightConfig" | |||
| android:textColor="@color/black" | |||
| android:textStyle="bold" | |||
| app:font="@string/TitilliumWeb_Bold" /> | |||
| android:orientation="horizontal" > | |||
| <ch.spherIC.recurvebowsight.components.FontTextView | |||
| android:id="@+id/sightConfigTitle" | |||
| android:layout_width="0dp" | |||
| android:layout_height="wrap_content" | |||
| android:layout_marginRight="4dp" | |||
| android:layout_weight="1" | |||
| android:background="@color/yellow" | |||
| android:paddingBottom="3dp" | |||
| android:paddingLeft="6dp" | |||
| android:paddingTop="3dp" | |||
| android:text="@string/titleSightConfig" | |||
| android:textColor="@color/black" | |||
| android:textStyle="bold" | |||
| app:font="@string/TitilliumWeb_Bold" /> | |||
| <Button | |||
| android:id="@+id/scBtnCalc" | |||
| style="@style/GlassButtonSmall" | |||
| android:layout_width="44dp" | |||
| android:layout_height="wrap_content" | |||
| android:drawableRight="@drawable/btn_calc" /> | |||
| </LinearLayout> | |||
| </TableRow> | |||
| <TableRow | |||
| @@ -787,7 +802,6 @@ | |||
| android:textSize="18sp" | |||
| android:visibility="invisible" | |||
| app:txtFont="@string/TitilliumWeb_Regular" /> | |||
| </LinearLayout> | |||
| </TableRow> | |||
| @@ -929,15 +943,6 @@ | |||
| app:txtFont="@string/TitilliumWeb_Bold" /> | |||
| </TableRow> | |||
| </TableLayout> | |||
| <Button | |||
| android:id="@+id/scBtnCalc" | |||
| style="@style/GlassButtonSmall" | |||
| android:layout_width="44dp" | |||
| android:layout_height="wrap_content" | |||
| android:layout_gravity="right" | |||
| android:layout_marginRight="4dp" | |||
| android:drawableRight="@drawable/btn_calc" /> | |||
| </LinearLayout> | |||
| </ScrollView> | |||
| @@ -577,35 +577,37 @@ public class RBSMainActivity extends Activity implements ChooseArcherySetupDlgDi | |||
| @Override | |||
| public void onArcherySetupDlgDismissed(final IArcherySetup archerySetup) { | |||
| this.selectedArcherySetup = archerySetup; | |||
| if (archerySetup != null) { | |||
| if (archerySetup.getId() != -999) { | |||
| this.arrowDiameterTxtFld.setText(archerySetup.getArrowDiameter().toString()); | |||
| this.arrowCwTxtFld.setText(archerySetup.getArrowCw().toString()); | |||
| this.arrowWeightTxtFld.setText(archerySetup.getArrowWeight().toString()); | |||
| this.bowPulloutTxtFld.setText(archerySetup.getBowPullout().toString()); | |||
| this.arrowV0TxtFld.setText(archerySetup.getArrowV0().toString()); | |||
| this.arrowNockHeightTxtFld.setText(archerySetup.getArrowNockHeight().toString()); | |||
| this.targetCenterHeightTxtFld.setText(archerySetup.getArrowCenterHeight().toString()); | |||
| this.calcTimeIntervalCboBox.setSelectionByVal(archerySetup.getDeltaTime().toString()); | |||
| this.calcAccuracyCboBox.setSelectionByVal(archerySetup.getCalcPrecision().toString()); | |||
| this.scRiserSpinner.setSelectedRiser(archerySetup.getRiser()); | |||
| this.scSightSpinner.setSelectedSight(archerySetup.getSight()); | |||
| this.scVertScaleMiddleTxtFld.setText(archerySetup.getSightVertSkalaMiddle().toString()); | |||
| } else { | |||
| this.arrowDiameterTxtFld.setText(""); | |||
| this.arrowDiameterTxtFld.setText(""); | |||
| this.arrowCwTxtFld.setText(""); | |||
| this.arrowWeightTxtFld.setText(""); | |||
| this.bowPulloutTxtFld.setText(""); | |||
| this.arrowV0TxtFld.setText(""); | |||
| this.arrowNockHeightTxtFld.setText(""); | |||
| this.targetCenterHeightTxtFld.setText(""); | |||
| this.calcTimeIntervalCboBox.setSelectionByVal(""); | |||
| this.calcAccuracyCboBox.setSelectionByVal(""); | |||
| this.scRiserSpinner.setSelection(0); | |||
| this.scSightSpinner.setSelection(0); | |||
| this.scVertScaleMiddleTxtFld.setText(""); | |||
| } | |||
| if (archerySetup != null && archerySetup.getId() != -999) { | |||
| this.arrowDiameterTxtFld.setText(archerySetup.getArrowDiameter().toString()); | |||
| this.arrowCwTxtFld.setText(archerySetup.getArrowCw().toString()); | |||
| this.arrowWeightTxtFld.setText(archerySetup.getArrowWeight().toString()); | |||
| this.bowPulloutTxtFld.setText(archerySetup.getBowPullout().toString()); | |||
| this.arrowV0TxtFld.setText(archerySetup.getArrowV0().toString()); | |||
| this.arrowNockHeightTxtFld.setText(archerySetup.getArrowNockHeight().toString()); | |||
| this.targetCenterHeightTxtFld.setText(archerySetup.getArrowCenterHeight().toString()); | |||
| this.calcTimeIntervalCboBox.setSelectionByVal(archerySetup.getDeltaTime().toString()); | |||
| this.calcAccuracyCboBox.setSelectionByVal(archerySetup.getCalcPrecision().toString()); | |||
| this.scRiserSpinner.setSelectedRiser(archerySetup.getRiser()); | |||
| this.scRiserSpinner.fireSelectionChangedEvent(); | |||
| this.scSightSpinner.setSelectedSight(archerySetup.getSight()); | |||
| this.scSightSpinner.fireSelectionChangedEvent(); | |||
| this.scVertScaleMiddleTxtFld.setText(archerySetup.getSightVertSkalaMiddle().toString()); | |||
| } else { | |||
| this.arrowDiameterTxtFld.setText(""); | |||
| this.arrowDiameterTxtFld.setText(""); | |||
| this.arrowCwTxtFld.setText(""); | |||
| this.arrowWeightTxtFld.setText(""); | |||
| this.bowPulloutTxtFld.setText(""); | |||
| this.arrowV0TxtFld.setText(""); | |||
| this.arrowNockHeightTxtFld.setText(""); | |||
| this.targetCenterHeightTxtFld.setText(""); | |||
| this.calcTimeIntervalCboBox.setSelectionByVal(""); | |||
| this.calcAccuracyCboBox.setSelectionByVal(""); | |||
| this.scRiserSpinner.setSelection(0); | |||
| this.scRiserSpinner.fireSelectionChangedEvent(); | |||
| this.scSightSpinner.setSelection(0); | |||
| this.scSightSpinner.fireSelectionChangedEvent(); | |||
| this.scVertScaleMiddleTxtFld.setText(""); | |||
| } | |||
| } | |||
| @@ -62,4 +62,11 @@ public class RiserSpinner extends XSpinner { | |||
| } | |||
| } | |||
| public void fireSelectionChangedEvent() { | |||
| OnItemSelectedListener listener = getOnItemSelectedListener(); | |||
| if (listener != null) { | |||
| listener.onItemSelected(this, getSelectedView(), getSelectedItemPosition(), getSelectedView().getId()); | |||
| } | |||
| } | |||
| } | |||
| @@ -62,4 +62,11 @@ public class SightSpinner extends XSpinner { | |||
| } | |||
| } | |||
| public void fireSelectionChangedEvent() { | |||
| OnItemSelectedListener listener = getOnItemSelectedListener(); | |||
| if (listener != null) { | |||
| listener.onItemSelected(this, getSelectedView(), getSelectedItemPosition(), getSelectedView().getId()); | |||
| } | |||
| } | |||
| } | |||