Bladeren bron

GUI Layouting (Main Options Menu)

master
gitsvn 12 jaren geleden
bovenliggende
commit
b3e82b66d5

+ 2
- 2
res/layout/rbs_archerysetup_item.xml Bestand weergeven

@@ -32,8 +32,8 @@
android:background="@color/qrt_translucent_white"
android:gravity="bottom|left"
android:lines="1"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:scrollHorizontally="true"
android:text="Hoyt / Avalon"
android:textAppearance="?android:attr/textAppearanceMediumInverse"

+ 8
- 4
res/layout/rbs_main.xml Bestand weergeven

@@ -910,7 +910,10 @@
android:paddingBottom="9dp"
android:paddingTop="9dp"
android:textSize="18sp"
app:txtFont="@string/TitilliumWeb_Regular" />
app:txtFont="@string/TitilliumWeb_Regular" >
<requestFocus />
</ch.spherIC.recurvebowsight.components.FontEditText>
</TableRow>
<TableRow
@@ -933,19 +936,20 @@
<ch.spherIC.recurvebowsight.components.FontTextView
android:id="@+id/scEvSValue"
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:background="@drawable/evs_ok_background"
android:gravity="left|center_vertical"
android:paddingLeft="9dp"
android:text="12.2"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
app:txtFont="@string/TitilliumWeb_Bold" />
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
</ViewFlipper>
</RelativeLayout>

+ 10
- 5
res/layout/rbs_spinner_item.xml Bestand weergeven

@@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res/ch.spherIC.recurvebowsight"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/list_item_background"
android:gravity="center"
android:orientation="horizontal"
android:padding="8dp" >
@@ -10,10 +11,11 @@
<ch.spherIC.recurvebowsight.components.FontTextView
android:id="@+id/spinner_item_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="bottom|left"
android:gravity="left|center_vertical"
android:lines="1"
android:paddingLeft="2dp"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
@@ -21,10 +23,13 @@
android:textSize="18sp"
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_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>

+ 0
- 59
res/layout/rbs_spinner_riser.xml Bestand weergeven

@@ -1,59 +0,0 @@
<?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>

+ 4
- 2
src/ch/spherIC/recurvebowsight/components/ArcerySetupArrayAdapter.java Bestand weergeven

@@ -50,14 +50,16 @@ public class ArcerySetupArrayAdapter extends ArrayAdapter<IArcherySetup> {
LayoutInflater inflater = getLayoutInflater();
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);
if (getItem(position).getId() != -999) {
textViewMain.setText(getItem(position).getName());
textViewSub.setText(getItem(position).getRiser().toString() + " ● " + getItem(position).getSight().toString());
} else {
textViewMain.setText("[ ]");
textViewMain.setText("-");
textViewMain.setDrawborder(false);
textViewMain.setBackgroundColor(getContext().getResources().getColor(R.color.translucent));
textViewSub.setText(getContext().getString(R.string.caption_NoSelection));
}

+ 8
- 10
src/ch/spherIC/recurvebowsight/components/FontArrayAdapter.java Bestand weergeven

@@ -10,8 +10,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.CheckBox;
import android.widget.TextView;
import ch.spherIC.recurvebowsight.R;
@@ -24,7 +23,7 @@ import java.util.List;
*/
public class FontArrayAdapter<O extends Object> extends ArrayAdapter<O> {
private Spinner parentSpinner;
private XSpinner parentSpinner;
/**
* @param context
@@ -32,7 +31,7 @@ public class FontArrayAdapter<O extends Object> extends ArrayAdapter<O> {
* @param objects
*/
public FontArrayAdapter(final Context context, final int textViewResourceId, final O[] objects,
final Spinner parent) {
final XSpinner parent) {
super(context, textViewResourceId, objects);
this.parentSpinner = parent;
}
@@ -43,7 +42,7 @@ public class FontArrayAdapter<O extends Object> extends ArrayAdapter<O> {
* @param objects
*/
public FontArrayAdapter(final Context context, final int textViewResourceId, final List<O> objects,
final Spinner parent) {
final XSpinner parent) {
super(context, textViewResourceId, objects);
this.parentSpinner = parent;
}
@@ -66,18 +65,17 @@ public class FontArrayAdapter<O extends Object> extends ArrayAdapter<O> {
LayoutInflater inflater = getLayoutInflater();
View spinnerItem = inflater.inflate(R.layout.rbs_spinner_item, parent, false);
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());
spinnerItem.setBackgroundResource(R.drawable.list_item_background);
// spinnerItem.setBackgroundResource(R.drawable.list_item_background);
if (this.parentSpinner.getSelectedItemPosition() == position) {
textView.setFont(getContext(), "fonts/TitilliumWeb-Bold.ttf");
textView.setSelected(true);
// textView.setTextColor(getContext().getResources().getColor(R.color.android_blue_dark));
checkBoxView.setVisibility(View.VISIBLE);
checkBoxView.setChecked(true);
} else {
checkBoxView.setVisibility(View.INVISIBLE);
checkBoxView.setChecked(false);
}
return spinnerItem;

+ 10
- 4
src/ch/spherIC/recurvebowsight/components/XSpinner.java Bestand weergeven

@@ -32,7 +32,7 @@ public class XSpinner extends Spinner {
*
* @param context {@link Context}
*/
public XSpinner(Context context) {
public XSpinner(final Context context) {
super(context);
}
@@ -42,7 +42,7 @@ public class XSpinner extends Spinner {
* @param context {@link Context}
* @param attrs {@link AttributeSet}
*/
public XSpinner(Context context, AttributeSet attrs) {
public XSpinner(final Context context, final AttributeSet attrs) {
super(context, attrs);
}
@@ -53,7 +53,7 @@ public class XSpinner extends Spinner {
* @param attrs {@link AttributeSet}
* @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);
}
@@ -63,7 +63,7 @@ public class XSpinner extends Spinner {
*
* @param value DOCUMENT ME!
*/
public void setSelectionByVal(String value) {
public void setSelectionByVal(final String value) {
int count = getAdapter().getCount();
@@ -75,4 +75,10 @@ public class XSpinner extends Spinner {
}
}
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
}
}

+ 37
- 0
src/ch/spherIC/recurvebowsight/components/XTextView.java Bestand weergeven

@@ -121,4 +121,41 @@ public class XTextView extends FontTextView {
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;
}
}

Laden…
Annuleren
Opslaan