| <?xml version="1.0" encoding="utf-8"?> | |||||
| <LinearLayout | |||||
| xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:background="@drawable/bg_about" | |||||
| android:padding="10dp" | |||||
| android:layout_height="fill_parent" | |||||
| android:layout_width="fill_parent" | |||||
| android:orientation="vertical"> | |||||
| <ScrollView | |||||
| android:id="@+id/ug_ScrollView" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="1" | |||||
| android:addStatesFromChildren="true" > | |||||
| <LinearLayout | |||||
| android:id="@+id/linearLayout1" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="vertical" > | |||||
| <ImageView | |||||
| android:id="@+id/ug_image" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginBottom="20dp" | |||||
| android:scaleType="fitCenter" /> | |||||
| <TextView | |||||
| android:id="@+id/ug_txt_HowTo" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:lineSpacingExtra="1dp" | |||||
| android:text="Text hier..." | |||||
| android:textColor="@color/black" | |||||
| android:textSize="12dp" > | |||||
| </TextView> | |||||
| </LinearLayout> | |||||
| </ScrollView> | |||||
| <Button | |||||
| android:id="@+id/btn_ugClose" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_gravity="center_horizontal" | |||||
| android:layout_marginTop="20dp" | |||||
| android:background="@drawable/btn_fs" | |||||
| android:text="@string/caption_Close" | |||||
| android:textColor="@color/white" > | |||||
| </Button> | |||||
| </LinearLayout> |
| <item>0.1</item> | <item>0.1</item> | ||||
| </string-array> | </string-array> | ||||
| <string name="caption_UserguideParams">1. %1$s\n2. %2$s\n3. %3$s\n4. %4$s\n5. %5$s\n6. %6$s\n7. %7$s\n</string> | |||||
| </resources> | </resources> |
| dlg = createAboutDialog(parent); | dlg = createAboutDialog(parent); | ||||
| break; | break; | ||||
| case RBSMainActivity.DLG_USERGUIDE_PARAMS_SIGHT: | |||||
| dlg = createUserguideParamsDialog(parent); | |||||
| break; | |||||
| default: | default: | ||||
| dlg = null; | dlg = null; | ||||
| break; | break; | ||||
| return dlg; | return dlg; | ||||
| } | } | ||||
| /** | |||||
| * @param parent | |||||
| * | |||||
| * @return | |||||
| */ | |||||
| private static Dialog createUserguideParamsDialog(final Activity parent) { | |||||
| final Dialog dialog = new Dialog(parent); | |||||
| dialog.setContentView(R.layout.rbs_userguide_dialog); | |||||
| dialog.setTitle(parent.getResources().getText(R.string.menuUserGuide).toString()); | |||||
| ImageView image = (ImageView) dialog.findViewById(R.id.ug_image); | |||||
| image.setImageResource(R.drawable.userguide_params); | |||||
| TextView text = (TextView) dialog.findViewById(R.id.ug_txt_HowTo); | |||||
| text.setText(parent.getResources().getString(R.string.caption_UserguideParams, parent.getResources().getString(R.string.arrowNockHeightLbl), | |||||
| parent.getResources().getString(R.string.targetCenterHeightLbl), | |||||
| parent.getResources().getString(R.string.shootingDistanzLbl), | |||||
| parent.getResources().getString(R.string.ashNA), | |||||
| parent.getResources().getString(R.string.bowPulloutLbl), | |||||
| parent.getResources().getString(R.string.asNockRaising), | |||||
| parent.getResources().getString(R.string.asBraceHeight))); | |||||
| ((Button) dialog.findViewById(R.id.btn_ugClose)).setOnClickListener(new OnClickListener() { | |||||
| @Override | |||||
| public void onClick(final View v) { | |||||
| dialog.dismiss(); | |||||
| } | |||||
| }); | |||||
| return dialog; | |||||
| } | |||||
| private static Dialog createChooseArcherySetupDialog(final Activity parent) { | private static Dialog createChooseArcherySetupDialog(final Activity parent) { | ||||
| final ChooseArcherySetupDlg dialog = new ChooseArcherySetupDlg(parent); | final ChooseArcherySetupDlg dialog = new ChooseArcherySetupDlg(parent); | ||||
| return dialog; | return dialog; | ||||
| final Dialog dialog = new Dialog(parent); | final Dialog dialog = new Dialog(parent); | ||||
| dialog.setContentView(R.layout.rbs_about_dialog); | dialog.setContentView(R.layout.rbs_about_dialog); | ||||
| parent.getResources().getText(R.string.menuAbout); | |||||
| dialog.setTitle(parent.getResources().getText(R.string.menuAbout).toString()); | dialog.setTitle(parent.getResources().getText(R.string.menuAbout).toString()); | ||||
| try { | try { |
| public static final DecimalFormat DF_EVS = new DecimalFormat("0.#"); | public static final DecimalFormat DF_EVS = new DecimalFormat("0.#"); | ||||
| public static final int DLG_CHOOSE_ARCHERYSETUP = 0; | public static final int DLG_CHOOSE_ARCHERYSETUP = 0; | ||||
| public static final int DLG_USERGUIDE_PARAMS = 1; | |||||
| public static final int DLG_USERGUIDE_SIGHT = 2; | |||||
| public static final int DLG_ABOUT = 3; | |||||
| public static final int DLG_USERGUIDE_PARAMS_SIGHT = 1; | |||||
| public static final int DLG_USERGUIDE_RISER_CFG = 2; | |||||
| public static final int DLG_USERGUIDE_SIGHT_CFG = 3; | |||||
| public static final int DLG_USERGUIDE_AS_CFG = 4; | |||||
| public static final int DLG_ABOUT = 5; | |||||
| private static final Double ANGLE_90 = 90d; | private static final Double ANGLE_90 = 90d; | ||||
| private static final int MIN_DISTANCE = 50; | private static final int MIN_DISTANCE = 50; | ||||
| }); | }); | ||||
| return true; | return true; | ||||
| case R.id.itemAbout: | case R.id.itemAbout: | ||||
| showDialog(DLG_ABOUT); | showDialog(DLG_ABOUT); | ||||
| return true; | return true; | ||||
| case R.id.itemUserGuide: | |||||
| showDialog(DLG_USERGUIDE_PARAMS_SIGHT); | |||||
| return true; | |||||
| default: | default: | ||||
| return super.onOptionsItemSelected(item); | return super.onOptionsItemSelected(item); | ||||
| } | } |