| @@ -621,36 +621,19 @@ | |||
| android:layout_gravity="center" | |||
| android:layout_margin="4dp" > | |||
| <LinearLayout | |||
| android:id="@+id/sightConfigTitleWrap" | |||
| android:layout_width="fill_parent" | |||
| <ch.spherIC.recurvebowsight.components.FontTextView | |||
| android:id="@+id/sightConfigTitle" | |||
| android:layout_width="0dp" | |||
| android:layout_height="wrap_content" | |||
| android:layout_weight="1" > | |||
| <ch.spherIC.recurvebowsight.components.FontTextView | |||
| android:id="@+id/sightConfigTitle" | |||
| android:layout_width="0dp" | |||
| android:layout_height="wrap_content" | |||
| 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" /> | |||
| <Button | |||
| android:id="@+id/scBtnInfo" | |||
| style="@style/GlassButtonSmall" | |||
| android:layout_width="40dp" | |||
| android:layout_height="40dp" | |||
| android:layout_marginLeft="4dp" | |||
| android:drawableLeft="@drawable/stat_sys_certificate_info" | |||
| android:gravity="center" | |||
| android:padding="7dp" /> | |||
| </LinearLayout> | |||
| 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" /> | |||
| </TableRow> | |||
| <TableRow | |||
| @@ -710,7 +693,10 @@ | |||
| android:paddingTop="9dp" | |||
| android:text="22" | |||
| android:textAppearance="?android:attr/textAppearanceMediumInverse" | |||
| app:txtFont="@string/TitilliumWeb_Regular" /> | |||
| app:txtFont="@string/TitilliumWeb_Regular" > | |||
| <requestFocus /> | |||
| </ch.spherIC.recurvebowsight.components.FontEditText> | |||
| </TableRow> | |||
| <TableRow | |||
| @@ -7,27 +7,18 @@ | |||
| <item | |||
| android:id="@+id/itemAbout" | |||
| android:enabled="true" | |||
| android:icon="@android:drawable/ic_menu_info_details" | |||
| android:icon="@drawable/ic_menu_info_details" | |||
| android:menuCategory="container" | |||
| android:orderInCategory="1" | |||
| android:title="@string/menuAbout" | |||
| android:visible="true"> | |||
| </item> | |||
| <item | |||
| android:id="@+id/itemSettings" | |||
| android:enabled="true" | |||
| android:icon="@android:drawable/ic_menu_preferences" | |||
| android:menuCategory="container" | |||
| android:orderInCategory="2" | |||
| android:title="@string/menuSettings" | |||
| android:visible="true"> | |||
| </item> | |||
| <item | |||
| android:id="@+id/itemUserGuide" | |||
| android:enabled="true" | |||
| android:icon="@android:drawable/ic_menu_help" | |||
| android:icon="@drawable/ic_menu_help" | |||
| android:menuCategory="container" | |||
| android:orderInCategory="3" | |||
| android:orderInCategory="2" | |||
| android:title="@string/menuUserGuide" | |||
| android:visible="true"> | |||
| </item> | |||
| @@ -4,17 +4,15 @@ | |||
| android:id="@+id/groupCalculation" | |||
| android:menuCategory="system" | |||
| android:orderInCategory="2" > | |||
| <item android:id="@+id/addConfiguration" android:enabled="true" android:icon="@android:drawable/ic_menu_edit" android:menuCategory="secondary" android:orderInCategory="1" android:title="@string/menuAddEquipment" android:visible="true"> | |||
| </item><item | |||
| <item | |||
| android:id="@+id/chooseConfiguration" | |||
| android:enabled="true" | |||
| android:icon="@android:drawable/ic_menu_edit" | |||
| android:icon="@drawable/ic_menu_choose_equipment" | |||
| android:menuCategory="secondary" | |||
| android:orderInCategory="1" | |||
| android:title="@string/menuChooseEquipment" | |||
| android:visible="true"> | |||
| </item> | |||
| <item | |||
| android:id="@+id/doCalculation" | |||
| android:enabled="true" | |||
| @@ -24,19 +22,27 @@ | |||
| android:title="@string/menuDoCalculation" | |||
| android:visible="true"> | |||
| </item> | |||
| <item | |||
| android:id="@+id/addConfiguration" | |||
| android:enabled="true" | |||
| android:icon="@drawable/ic_menu_add_equipment" | |||
| android:menuCategory="secondary" | |||
| android:orderInCategory="3" | |||
| android:title="@string/menuAddEquipment" | |||
| android:visible="true"> | |||
| </item> | |||
| <item | |||
| android:id="@+id/moreItems" | |||
| android:enabled="true" | |||
| android:icon="@android:drawable/ic_menu_more" | |||
| android:icon="@drawable/ic_menu_more" | |||
| android:menuCategory="secondary" | |||
| android:orderInCategory="2" | |||
| android:title="@string/menuMoreItems" | |||
| android:orderInCategory="4" | |||
| android:title="@string/menuMoreItems" | |||
| android:visible="true"> | |||
| <menu> | |||
| <!-- Container der zur Laufzeit gefüllt wird --> | |||
| <!-- Container der zur Laufzeit gefüllt wird --> | |||
| </menu> | |||
| </item> | |||
| </group> | |||
| @@ -42,9 +42,8 @@ | |||
| <string name="scVertSkalaMiddleLbl">Mittelstellung M vert. Skala [mm]</string> | |||
| <string name="scEvSLbl">EvS [mm]</string> | |||
| <!-- --> | |||
| <string name="menuAbout">Über RBS…</string> | |||
| <string name="menuUserGuide">Benutzeranleitung</string> | |||
| <string name="menuSettings">Einstellungen…</string> | |||
| <string name="menuAbout">Info</string> | |||
| <!-- --> | |||
| <string name="menuChooseEquipment">Ausrüstung wählen</string> | |||
| <string name="menuAddEquipment">Ausrüstung hinzufügen</string> | |||
| @@ -14,7 +14,7 @@ | |||
| <!-- --> | |||
| <string name="titleBowAndArrowParams">Bow and Arrow Parameters</string> | |||
| <string name="arrowDiameterLbl">Arrow Diameter [mm]</string> | |||
| <string name="arrowCwLbl">Cw-Value of Arrow</string> | |||
| <string name="arrowCwLbl">Cd-Value of Arrow</string> | |||
| <string name="arrowV0Lbl">Arrow initial velocity V0 [m/s]</string> | |||
| <string name="bowPulloutLbl">Bow Pullout [cm]</string> | |||
| <string name="arrowWeightLbl">Arrow Weight [g]</string> | |||
| @@ -43,9 +43,8 @@ | |||
| <string name="scVertSkalaMiddleLbl">Vert. Scale Middle Setting M [mm]</string> | |||
| <string name="scEvSLbl">EvS [mm]</string> | |||
| <!-- --> | |||
| <string name="menuAbout">About RBS…</string> | |||
| <string name="menuUserGuide">User Guide</string> | |||
| <string name="menuSettings">Settings…</string> | |||
| <string name="menuAbout">Info</string> | |||
| <!-- --> | |||
| <string name="menuChooseEquipment">Choose Equipment</string> | |||
| <string name="menuAddEquipment">Add Equipment</string> | |||
| @@ -5,6 +5,7 @@ import android.app.Activity; | |||
| import android.content.Intent; | |||
| import android.os.Bundle; | |||
| import android.os.Handler; | |||
| import android.view.Menu; | |||
| import android.view.MenuItem; | |||
| @@ -47,7 +48,7 @@ public class RBSMainActivity extends Activity { | |||
| private Activity riserSightConfigActivity; | |||
| private boolean showInfoMenu; | |||
| private Menu optionsMenu; | |||
| // private Menu optionsMenu; | |||
| @Override | |||
| public void onCreate(final Bundle savedInstanceState) { | |||
| @@ -244,7 +245,12 @@ public class RBSMainActivity extends Activity { | |||
| } | |||
| @Override | |||
| public boolean onPrepareOptionsMenu(Menu menu) { | |||
| public boolean onPrepareOptionsMenu(final Menu menu) { | |||
| int size = menu.size(); | |||
| for (int i = size - 1; i >= 0; i--) { | |||
| menu.removeItem(menu.getItem(i).getItemId()); | |||
| } | |||
| if (this.showInfoMenu) { | |||
| this.showInfoMenu = false; | |||
| @@ -253,46 +259,28 @@ public class RBSMainActivity extends Activity { | |||
| getMenuInflater().inflate(R.menu.rbs_main, menu); | |||
| } | |||
| return super.onPrepareOptionsMenu(menu); | |||
| } | |||
| @Override | |||
| public boolean onCreateOptionsMenu(final Menu menu) { | |||
| // getMenuInflater().inflate(R.menu.rbs_main, menu); | |||
| // getMenuInflater().inflate(R.menu.rbs_info_menu, menu.getItem(3).getSubMenu()); | |||
| super.onCreateOptionsMenu(menu); | |||
| this.optionsMenu = menu; | |||
| return true; | |||
| } | |||
| @Override | |||
| public void closeOptionsMenu() { | |||
| for (int i = 0; i < this.optionsMenu.size(); i++) { | |||
| this.optionsMenu.removeItem(i); | |||
| } | |||
| super.closeOptionsMenu(); | |||
| } | |||
| @Override | |||
| public boolean onOptionsItemSelected(MenuItem item) { | |||
| public boolean onOptionsItemSelected(final MenuItem item) { | |||
| if (item.getItemId() == R.id.moreItems) { | |||
| this.showInfoMenu = true; | |||
| closeOptionsMenu(); | |||
| runOnUiThread(new Runnable() { | |||
| new Handler().post(new Runnable() { | |||
| @Override | |||
| public void run() { | |||
| openOptionsMenu(); | |||
| } | |||
| }); | |||
| return true; | |||
| } | |||
| return super.onOptionsItemSelected(item); | |||
| return true; | |||
| } | |||
| @Override | |||
| public boolean onTouchEvent(final MotionEvent touchevent) { | |||
| switch (touchevent.getAction()) { | |||
| @@ -5,6 +5,8 @@ package ch.spherIC.recurvebowsight.components; | |||
| import android.content.Context; | |||
| import android.graphics.Typeface; | |||
| import android.view.LayoutInflater; | |||
| import android.view.View; | |||
| import android.view.ViewGroup; | |||
| @@ -60,9 +62,11 @@ public class FontArrayAdapter<O extends Object> extends ArrayAdapter<O> { | |||
| if (this.parentSpinner.getSelectedItemPosition() == position) { | |||
| textView.setTextColor(getContext().getResources().getColor(R.color.android_blue_dark)); | |||
| textView.setTypeface(null, Typeface.BOLD); | |||
| checkBoxView.setVisibility(View.VISIBLE); | |||
| } else { | |||
| textView.setTextColor(getContext().getResources().getColor(R.color.white)); | |||
| textView.setTypeface(null, Typeface.NORMAL); | |||
| checkBoxView.setVisibility(View.INVISIBLE); | |||
| } | |||