瀏覽代碼

GUI Funktionen (Berechnung)

master
gitsvn 12 年之前
父節點
當前提交
c1ca1159dc

+ 33
- 28
res/layout/rbs_main.xml 查看文件

android:layout_weight="1" android:layout_weight="1"
android:background="@color/yellow" android:background="@color/yellow"
android:paddingBottom="3dip" android:paddingBottom="3dip"
android:paddingLeft="3dip"
android:paddingLeft="6dp"
android:paddingTop="3dip" android:paddingTop="3dip"
android:text="@string/titleBowAndArrowParams" android:text="@string/titleBowAndArrowParams"
android:textColor="@color/black" android:textColor="@color/black"
android:layout_weight="1" android:layout_weight="1"
android:background="@color/yellow" android:background="@color/yellow"
android:paddingBottom="3dip" android:paddingBottom="3dip"
android:paddingLeft="3dip"
android:paddingLeft="6dp"
android:paddingTop="3dip" android:paddingTop="3dip"
android:text="@string/titleAtmosphericalParams" android:text="@string/titleAtmosphericalParams"
android:textColor="@color/black" android:textColor="@color/black"
android:layout_weight="1" android:layout_weight="1"
android:background="@color/yellow" android:background="@color/yellow"
android:paddingBottom="3dip" android:paddingBottom="3dip"
android:paddingLeft="3dip"
android:paddingLeft="6dp"
android:paddingTop="3dip" android:paddingTop="3dip"
android:text="@string/titleShootingParams" android:text="@string/titleShootingParams"
android:textColor="@color/black" android:textColor="@color/black"
android:layout_weight="1" android:layout_weight="1"
android:background="@color/yellow" android:background="@color/yellow"
android:paddingBottom="3dip" android:paddingBottom="3dip"
android:paddingLeft="3dip"
android:paddingLeft="6dp"
android:paddingTop="3dip" android:paddingTop="3dip"
android:text="@string/titleCalculationParams" android:text="@string/titleCalculationParams"
android:textColor="@color/black" android:textColor="@color/black"
<TableRow <TableRow
android:id="@+id/tableSCRow0" android:id="@+id/tableSCRow0"
android:layout_width="match_parent" 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_height="wrap_content"
android:layout_margin="4dp"
android:layout_weight="1" 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>
<TableRow <TableRow
android:textSize="18sp" android:textSize="18sp"
android:visibility="invisible" android:visibility="invisible"
app:txtFont="@string/TitilliumWeb_Regular" /> app:txtFont="@string/TitilliumWeb_Regular" />
</LinearLayout> </LinearLayout>
</TableRow> </TableRow>
app:txtFont="@string/TitilliumWeb_Bold" /> app:txtFont="@string/TitilliumWeb_Bold" />
</TableRow> </TableRow>
</TableLayout> </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> </LinearLayout>
</ScrollView> </ScrollView>

+ 31
- 29
src/ch/spherIC/recurvebowsight/RBSMainActivity.java 查看文件

@Override @Override
public void onArcherySetupDlgDismissed(final IArcherySetup archerySetup) { public void onArcherySetupDlgDismissed(final IArcherySetup archerySetup) {
this.selectedArcherySetup = 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("");
} }
} }

+ 7
- 0
src/ch/spherIC/recurvebowsight/components/RiserSpinner.java 查看文件

} }
} }
public void fireSelectionChangedEvent() {
OnItemSelectedListener listener = getOnItemSelectedListener();
if (listener != null) {
listener.onItemSelected(this, getSelectedView(), getSelectedItemPosition(), getSelectedView().getId());
}
}
} }

+ 7
- 0
src/ch/spherIC/recurvebowsight/components/SightSpinner.java 查看文件

} }
} }
public void fireSelectionChangedEvent() {
OnItemSelectedListener listener = getOnItemSelectedListener();
if (listener != null) {
listener.onItemSelected(this, getSelectedView(), getSelectedItemPosition(), getSelectedView().getId());
}
}
} }

Loading…
取消
儲存