| @@ -474,16 +474,14 @@ | |||
| android:id="@+id/deltaTimeCboBox" | |||
| style="@style/GlassSpinner" | |||
| android:layout_width="150dp" | |||
| android:layout_height="36dp" | |||
| android:layout_height="40dp" | |||
| android:layout_marginLeft="4dp" | |||
| android:ems="10" | |||
| android:entries="@array/CalculationTimeIntervals" | |||
| android:gravity="center_vertical" | |||
| android:inputType="numberDecimal" | |||
| android:paddingBottom="9dp" | |||
| android:paddingTop="9dp" | |||
| android:textSize="18sp" | |||
| app:txtFont="@string/TitilliumWeb_Regular" /> | |||
| android:textSize="18sp" /> | |||
| </TableRow> | |||
| @@ -507,7 +505,7 @@ | |||
| android:id="@+id/calcPrecisionCboBox" | |||
| style="@style/GlassSpinner" | |||
| android:layout_width="150dp" | |||
| android:layout_height="36dp" | |||
| android:layout_height="40dp" | |||
| android:layout_marginLeft="4dp" | |||
| android:ems="10" | |||
| android:entries="@array/CalculationAccuracies" | |||
| @@ -515,8 +513,7 @@ | |||
| android:inputType="numberDecimal" | |||
| android:paddingBottom="9dp" | |||
| android:paddingTop="9dp" | |||
| android:textSize="18sp" | |||
| app:txtFont="@string/TitilliumWeb_Regular" /> | |||
| android:textSize="18sp" /> | |||
| </TableRow> | |||
| @@ -0,0 +1,22 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
| xmlns:app="http://schemas.android.com/apk/res/ch.spherIC.recurvebowsight" | |||
| android:layout_width="fill_parent" | |||
| android:layout_height="wrap_content" | |||
| android:gravity="center" | |||
| android:orientation="horizontal" > | |||
| <ch.spherIC.recurvebowsight.components.FontTextView | |||
| android:id="@+id/spinner_view" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:gravity="bottom|left" | |||
| android:lines="1" | |||
| android:paddingLeft="2dp" | |||
| android:text="FontTextView" | |||
| android:textColor="@color/white" | |||
| android:textSize="18sp" | |||
| android:typeface="sans" | |||
| app:font="@string/TitilliumWeb_Regular" /> | |||
| </LinearLayout> | |||
| @@ -0,0 +1,7 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="match_parent" | |||
| android:orientation="vertical" > | |||
| </LinearLayout> | |||
| @@ -42,4 +42,13 @@ | |||
| </declare-styleable> | |||
| <declare-styleable | |||
| name="FontSpinner"> | |||
| <attr | |||
| name="spinnerFont" | |||
| format="string" /> | |||
| </declare-styleable> | |||
| </resources> | |||
| @@ -16,9 +16,10 @@ import android.widget.AdapterView; | |||
| import android.widget.ArrayAdapter; | |||
| import android.widget.ListView; | |||
| import android.widget.ScrollView; | |||
| import android.widget.Spinner; | |||
| import android.widget.ViewFlipper; | |||
| import ch.spherIC.recurvebowsight.R; | |||
| import ch.spherIC.recurvebowsight.components.FontArrayAdapter; | |||
| import ch.spherIC.recurvebowsight.components.XSpinner; | |||
| import ch.spherIC.recurvebowsight.components.XTextView; | |||
| import ch.spherIC.recurvebowsight.database.RBSDatabaseHelper; | |||
| @@ -36,7 +37,7 @@ public class RBSMainActivity extends Activity { | |||
| private XTextView txtViewParams; | |||
| private XTextView txtViewResults; | |||
| private XTextView txtViewSight; | |||
| private XSpinner calcTimeIntervalCboBox; | |||
| private Spinner calcTimeIntervalCboBox; | |||
| private XSpinner calcAccuracyCboBox; | |||
| private Activity riserSightConfigActivity; | |||
| @@ -57,7 +58,7 @@ public class RBSMainActivity extends Activity { | |||
| this.txtViewParams = (XTextView) findViewById(R.id.viewParams); | |||
| this.txtViewResults = (XTextView) findViewById(R.id.viewResults); | |||
| this.txtViewSight = (XTextView) findViewById(R.id.viewSight); | |||
| this.calcTimeIntervalCboBox = (XSpinner) findViewById(R.id.deltaTimeCboBox); | |||
| this.calcTimeIntervalCboBox = (Spinner) findViewById(R.id.deltaTimeCboBox); | |||
| this.calcAccuracyCboBox = (XSpinner) findViewById(R.id.calcPrecisionCboBox); | |||
| this.scrollView.setOnTouchListener(new OnTouchListener() { | |||
| @@ -149,6 +150,14 @@ public class RBSMainActivity extends Activity { | |||
| this.txtViewResults.setOnTouchListener(tabListener); | |||
| this.txtViewSight.setOnTouchListener(tabListener); | |||
| xTextViewUp(this.txtViewParams); | |||
| this.calcTimeIntervalCboBox.setAdapter(new FontArrayAdapter<String>(this, R.layout.rbs_spinner, | |||
| getResources().getStringArray(R.array.CalculationTimeIntervals), | |||
| this.calcTimeIntervalCboBox)); | |||
| this.calcAccuracyCboBox.setAdapter(new FontArrayAdapter<String>(this, R.layout.rbs_spinner, | |||
| getResources().getStringArray(R.array.CalculationAccuracies), | |||
| this.calcAccuracyCboBox)); | |||
| // ** TEST WEISE AB HIER******* | |||
| @@ -0,0 +1,71 @@ | |||
| /** | |||
| * Copyright (C) 2005-2012 XELOG AG | |||
| */ | |||
| package ch.spherIC.recurvebowsight.components; | |||
| import android.content.Context; | |||
| import android.view.LayoutInflater; | |||
| import android.view.View; | |||
| import android.view.ViewGroup; | |||
| import android.widget.ArrayAdapter; | |||
| import android.widget.Spinner; | |||
| import android.widget.TextView; | |||
| import ch.spherIC.recurvebowsight.R; | |||
| /** | |||
| * @author FC Smilari | |||
| */ | |||
| public class FontArrayAdapter<O extends Object> extends ArrayAdapter<O> { | |||
| private Spinner parentSpinner; | |||
| /** | |||
| * @param context | |||
| * @param textViewResourceId | |||
| * @param objects | |||
| */ | |||
| public FontArrayAdapter(final Context context, final int textViewResourceId, final O[] objects, final Spinner parent) { | |||
| super(context, textViewResourceId, objects); | |||
| this.parentSpinner = parent; | |||
| } | |||
| @Override | |||
| public View getView(final int position, final View convertView, final ViewGroup parent) { | |||
| return getCustomView(position, convertView, parent, false); | |||
| } | |||
| @Override | |||
| public View getDropDownView(final int position, final View convertView, final ViewGroup parent) { | |||
| return getCustomView(position, convertView, parent, true); | |||
| } | |||
| protected LayoutInflater getLayoutInflater() { | |||
| return (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |||
| } | |||
| protected View getCustomView(final int position, final View convertView, final ViewGroup parent, final boolean dropdown) { | |||
| LayoutInflater inflater = getLayoutInflater(); | |||
| View spinnerItem = inflater.inflate(R.layout.rbs_spinner, parent, false); | |||
| TextView textView = (TextView) spinnerItem.findViewById(R.id.spinner_view); | |||
| textView.setText(getItem(position).toString()); | |||
| if (dropdown) { | |||
| if (this.parentSpinner.getSelectedItemPosition() == position) { | |||
| textView.setTextColor(getContext().getResources().getColor(R.color.android_blue_dark)); | |||
| } else { | |||
| textView.setTextColor(getContext().getResources().getColor(R.color.black)); | |||
| } | |||
| textView.setPadding(20, 20, 20, 20); | |||
| } | |||
| return spinnerItem; | |||
| } | |||
| } | |||