| android:background="@color/qrt_translucent_white" | android:background="@color/qrt_translucent_white" | ||||
| android:gravity="bottom|left" | android:gravity="bottom|left" | ||||
| android:lines="1" | android:lines="1" | ||||
| android:paddingLeft="2dp" | |||||
| android:paddingRight="2dp" | |||||
| android:paddingLeft="6dp" | |||||
| android:paddingRight="6dp" | |||||
| android:scrollHorizontally="true" | android:scrollHorizontally="true" | ||||
| android:text="Hoyt / Avalon" | android:text="Hoyt / Avalon" | ||||
| android:textAppearance="?android:attr/textAppearanceMediumInverse" | android:textAppearance="?android:attr/textAppearanceMediumInverse" |
| android:paddingBottom="9dp" | android:paddingBottom="9dp" | ||||
| android:paddingTop="9dp" | android:paddingTop="9dp" | ||||
| android:textSize="18sp" | android:textSize="18sp" | ||||
| app:txtFont="@string/TitilliumWeb_Regular" /> | |||||
| app:txtFont="@string/TitilliumWeb_Regular" > | |||||
| <requestFocus /> | |||||
| </ch.spherIC.recurvebowsight.components.FontEditText> | |||||
| </TableRow> | </TableRow> | ||||
| <TableRow | <TableRow | ||||
| <ch.spherIC.recurvebowsight.components.FontTextView | <ch.spherIC.recurvebowsight.components.FontTextView | ||||
| android:id="@+id/scEvSValue" | android:id="@+id/scEvSValue" | ||||
| android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
| android:layout_height="40dp" | |||||
| android:layout_marginLeft="4dp" | |||||
| android:layout_height="38dp" | |||||
| android:layout_marginLeft="5dp" | |||||
| android:layout_marginRight="1dp" | |||||
| android:layout_weight="1" | android:layout_weight="1" | ||||
| android:background="@drawable/evs_ok_background" | android:background="@drawable/evs_ok_background" | ||||
| android:gravity="left|center_vertical" | android:gravity="left|center_vertical" | ||||
| android:paddingLeft="9dp" | android:paddingLeft="9dp" | ||||
| android:text="12.2" | |||||
| android:textAppearance="?android:attr/textAppearanceMediumInverse" | android:textAppearance="?android:attr/textAppearanceMediumInverse" | ||||
| app:txtFont="@string/TitilliumWeb_Bold" /> | app:txtFont="@string/TitilliumWeb_Bold" /> | ||||
| </TableRow> | </TableRow> | ||||
| </TableLayout> | </TableLayout> | ||||
| </LinearLayout> | </LinearLayout> | ||||
| </ScrollView> | </ScrollView> | ||||
| </ViewFlipper> | </ViewFlipper> | ||||
| </RelativeLayout> | </RelativeLayout> |
| xmlns:app="http://schemas.android.com/apk/res/ch.spherIC.recurvebowsight" | xmlns:app="http://schemas.android.com/apk/res/ch.spherIC.recurvebowsight" | ||||
| android:layout_width="fill_parent" | android:layout_width="fill_parent" | ||||
| android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
| android:background="@drawable/list_item_background" | |||||
| android:gravity="center" | android:gravity="center" | ||||
| android:orientation="horizontal" | android:orientation="horizontal" | ||||
| android:padding="8dp" > | android:padding="8dp" > | ||||
| <ch.spherIC.recurvebowsight.components.FontTextView | <ch.spherIC.recurvebowsight.components.FontTextView | ||||
| android:id="@+id/spinner_item_view" | android:id="@+id/spinner_item_view" | ||||
| android:layout_width="0dp" | android:layout_width="0dp" | ||||
| android:layout_height="wrap_content" | |||||
| android:layout_height="fill_parent" | |||||
| android:layout_marginRight="10dp" | |||||
| android:layout_weight="1" | android:layout_weight="1" | ||||
| android:ellipsize="end" | android:ellipsize="end" | ||||
| android:gravity="bottom|left" | |||||
| android:gravity="left|center_vertical" | |||||
| android:lines="1" | android:lines="1" | ||||
| android:paddingLeft="2dp" | android:paddingLeft="2dp" | ||||
| android:textAppearance="?android:attr/textAppearanceMediumInverse" | android:textAppearance="?android:attr/textAppearanceMediumInverse" | ||||
| android:textSize="18sp" | android:textSize="18sp" | ||||
| app:font="@string/TitilliumWeb_Regular" /> | app:font="@string/TitilliumWeb_Regular" /> | ||||
| <ImageView | |||||
| android:id="@+id/spinner_item_checkBox" | |||||
| <CheckBox | |||||
| android:id="@+id/spinner_item_RadioBtn" | |||||
| android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
| android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
| android:src="@drawable/btn_check_on" /> | |||||
| android:button="@android:drawable/btn_radio" | |||||
| android:checked="false" | |||||
| android:clickable="false" | |||||
| android:focusable="false" /> | |||||
| </LinearLayout> | </LinearLayout> |
| <?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:id="@+id/riserLayout" | |||||
| android:layout_width="fill_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="vertical" > | |||||
| <LinearLayout | |||||
| 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:ellipsize="end" | |||||
| android:gravity="bottom|left" | |||||
| android:lines="1" | |||||
| android:paddingLeft="2dp" | |||||
| android:text="Riser" | |||||
| android:textColor="@color/white" | |||||
| android:textSize="18sp" | |||||
| android:typeface="sans" | |||||
| app:font="@string/TitilliumWeb_Regular" /> | |||||
| </LinearLayout> | |||||
| <LinearLayout | |||||
| android:layout_width="fill_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:gravity="center" | |||||
| android:orientation="horizontal" | |||||
| android:padding="8dp" > | |||||
| <ch.spherIC.recurvebowsight.components.FontTextView | |||||
| android:id="@+id/spinner_item_view" | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="1" | |||||
| android:ellipsize="end" | |||||
| android:gravity="bottom|left" | |||||
| android:lines="1" | |||||
| android:paddingLeft="2dp" | |||||
| android:textAppearance="?android:attr/textAppearanceMediumInverse" | |||||
| android:textColor="@color/white" | |||||
| android:textSize="18sp" | |||||
| app:font="@string/TitilliumWeb_Regular" /> | |||||
| <ImageView | |||||
| android:id="@+id/spinner_item_checkBox" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:src="@drawable/btn_check_on" /> | |||||
| </LinearLayout> | |||||
| </LinearLayout> |
| LayoutInflater inflater = getLayoutInflater(); | LayoutInflater inflater = getLayoutInflater(); | ||||
| View item = inflater.inflate(R.layout.rbs_archerysetup_item, parent, false); | View item = inflater.inflate(R.layout.rbs_archerysetup_item, parent, false); | ||||
| TextView textViewMain = (TextView) item.findViewById(R.id.chooseArcherySetupTxtMain); | |||||
| XTextView textViewMain = (XTextView) item.findViewById(R.id.chooseArcherySetupTxtMain); | |||||
| TextView textViewSub = (TextView) item.findViewById(R.id.chooseArcherySetupTxtSub); | TextView textViewSub = (TextView) item.findViewById(R.id.chooseArcherySetupTxtSub); | ||||
| if (getItem(position).getId() != -999) { | if (getItem(position).getId() != -999) { | ||||
| textViewMain.setText(getItem(position).getName()); | textViewMain.setText(getItem(position).getName()); | ||||
| textViewSub.setText(getItem(position).getRiser().toString() + " ● " + getItem(position).getSight().toString()); | textViewSub.setText(getItem(position).getRiser().toString() + " ● " + getItem(position).getSight().toString()); | ||||
| } else { | } else { | ||||
| textViewMain.setText("[ ]"); | |||||
| textViewMain.setText("-"); | |||||
| textViewMain.setDrawborder(false); | |||||
| textViewMain.setBackgroundColor(getContext().getResources().getColor(R.color.translucent)); | |||||
| textViewSub.setText(getContext().getString(R.string.caption_NoSelection)); | textViewSub.setText(getContext().getString(R.string.caption_NoSelection)); | ||||
| } | } | ||||
| import android.view.ViewGroup; | import android.view.ViewGroup; | ||||
| import android.widget.ArrayAdapter; | import android.widget.ArrayAdapter; | ||||
| import android.widget.ImageView; | |||||
| import android.widget.Spinner; | |||||
| import android.widget.CheckBox; | |||||
| import android.widget.TextView; | import android.widget.TextView; | ||||
| import ch.spherIC.recurvebowsight.R; | import ch.spherIC.recurvebowsight.R; | ||||
| */ | */ | ||||
| public class FontArrayAdapter<O extends Object> extends ArrayAdapter<O> { | public class FontArrayAdapter<O extends Object> extends ArrayAdapter<O> { | ||||
| private Spinner parentSpinner; | |||||
| private XSpinner parentSpinner; | |||||
| /** | /** | ||||
| * @param context | * @param context | ||||
| * @param objects | * @param objects | ||||
| */ | */ | ||||
| public FontArrayAdapter(final Context context, final int textViewResourceId, final O[] objects, | public FontArrayAdapter(final Context context, final int textViewResourceId, final O[] objects, | ||||
| final Spinner parent) { | |||||
| final XSpinner parent) { | |||||
| super(context, textViewResourceId, objects); | super(context, textViewResourceId, objects); | ||||
| this.parentSpinner = parent; | this.parentSpinner = parent; | ||||
| } | } | ||||
| * @param objects | * @param objects | ||||
| */ | */ | ||||
| public FontArrayAdapter(final Context context, final int textViewResourceId, final List<O> objects, | public FontArrayAdapter(final Context context, final int textViewResourceId, final List<O> objects, | ||||
| final Spinner parent) { | |||||
| final XSpinner parent) { | |||||
| super(context, textViewResourceId, objects); | super(context, textViewResourceId, objects); | ||||
| this.parentSpinner = parent; | this.parentSpinner = parent; | ||||
| } | } | ||||
| LayoutInflater inflater = getLayoutInflater(); | LayoutInflater inflater = getLayoutInflater(); | ||||
| View spinnerItem = inflater.inflate(R.layout.rbs_spinner_item, parent, false); | View spinnerItem = inflater.inflate(R.layout.rbs_spinner_item, parent, false); | ||||
| FontTextView textView = (FontTextView) spinnerItem.findViewById(R.id.spinner_item_view); | FontTextView textView = (FontTextView) spinnerItem.findViewById(R.id.spinner_item_view); | ||||
| ImageView checkBoxView = (ImageView) spinnerItem.findViewById(R.id.spinner_item_checkBox); | |||||
| final CheckBox checkBoxView = (CheckBox) spinnerItem.findViewById(R.id.spinner_item_RadioBtn); | |||||
| textView.setText(getItem(position).toString()); | textView.setText(getItem(position).toString()); | ||||
| spinnerItem.setBackgroundResource(R.drawable.list_item_background); | |||||
| // spinnerItem.setBackgroundResource(R.drawable.list_item_background); | |||||
| if (this.parentSpinner.getSelectedItemPosition() == position) { | if (this.parentSpinner.getSelectedItemPosition() == position) { | ||||
| textView.setFont(getContext(), "fonts/TitilliumWeb-Bold.ttf"); | textView.setFont(getContext(), "fonts/TitilliumWeb-Bold.ttf"); | ||||
| textView.setSelected(true); | textView.setSelected(true); | ||||
| // textView.setTextColor(getContext().getResources().getColor(R.color.android_blue_dark)); | |||||
| checkBoxView.setVisibility(View.VISIBLE); | |||||
| checkBoxView.setChecked(true); | |||||
| } else { | } else { | ||||
| checkBoxView.setVisibility(View.INVISIBLE); | |||||
| checkBoxView.setChecked(false); | |||||
| } | } | ||||
| return spinnerItem; | return spinnerItem; |
| * | * | ||||
| * @param context {@link Context} | * @param context {@link Context} | ||||
| */ | */ | ||||
| public XSpinner(Context context) { | |||||
| public XSpinner(final Context context) { | |||||
| super(context); | super(context); | ||||
| } | } | ||||
| * @param context {@link Context} | * @param context {@link Context} | ||||
| * @param attrs {@link AttributeSet} | * @param attrs {@link AttributeSet} | ||||
| */ | */ | ||||
| public XSpinner(Context context, AttributeSet attrs) { | |||||
| public XSpinner(final Context context, final AttributeSet attrs) { | |||||
| super(context, attrs); | super(context, attrs); | ||||
| } | } | ||||
| * @param attrs {@link AttributeSet} | * @param attrs {@link AttributeSet} | ||||
| * @param defStyle int | * @param defStyle int | ||||
| */ | */ | ||||
| public XSpinner(Context context, AttributeSet attrs, int defStyle) { | |||||
| public XSpinner(final Context context, final AttributeSet attrs, final int defStyle) { | |||||
| super(context, attrs, defStyle); | super(context, attrs, defStyle); | ||||
| } | } | ||||
| * | * | ||||
| * @param value DOCUMENT ME! | * @param value DOCUMENT ME! | ||||
| */ | */ | ||||
| public void setSelectionByVal(String value) { | |||||
| public void setSelectionByVal(final String value) { | |||||
| int count = getAdapter().getCount(); | int count = getAdapter().getCount(); | ||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void onDetachedFromWindow() { | |||||
| super.onDetachedFromWindow(); | |||||
| } | |||||
| } | } |
| invalidate(); | invalidate(); | ||||
| } | } | ||||
| /** | |||||
| * @return the drawborder | |||||
| */ | |||||
| public boolean isDrawborder() { | |||||
| return this.drawborder; | |||||
| } | |||||
| /** | |||||
| * @param drawborder the drawborder to set | |||||
| */ | |||||
| public void setDrawborder(final boolean drawborder) { | |||||
| this.drawborder = drawborder; | |||||
| invalidate(); | |||||
| } | |||||
| /** | |||||
| * @return the drawborderWidth | |||||
| */ | |||||
| public int getDrawborderWidth() { | |||||
| return this.drawborderWidth; | |||||
| } | |||||
| /** | |||||
| * @param drawborderWidth the drawborderWidth to set | |||||
| */ | |||||
| public void setDrawborderWidth(final int drawborderWidth) { | |||||
| this.drawborderWidth = drawborderWidth; | |||||
| invalidate(); | |||||
| } | |||||
| /** | |||||
| * @return the drawborderColor | |||||
| */ | |||||
| public int getDrawborderColor() { | |||||
| return this.drawborderColor; | |||||
| } | |||||
| } | } |