|
|
|
@@ -19,6 +19,7 @@ import android.widget.ScrollView; |
|
|
|
import android.widget.ViewFlipper;
|
|
|
|
|
|
|
|
import ch.spherIC.recurvebowsight.R;
|
|
|
|
import ch.spherIC.recurvebowsight.components.XSpinner;
|
|
|
|
import ch.spherIC.recurvebowsight.components.XTextView;
|
|
|
|
import ch.spherIC.recurvebowsight.database.RBSDatabaseHelper;
|
|
|
|
|
|
|
|
@@ -33,6 +34,10 @@ public class RBSMainActivity extends Activity { |
|
|
|
private float lastX;
|
|
|
|
private ListView listView1;
|
|
|
|
private XTextView txtViewParams;
|
|
|
|
private XTextView txtViewResults;
|
|
|
|
private XTextView txtViewSight;
|
|
|
|
private XSpinner calcTimeIntervalCboBox;
|
|
|
|
private XSpinner calcAccuracyCboBox;
|
|
|
|
|
|
|
|
private Activity riserSightConfigActivity;
|
|
|
|
|
|
|
|
@@ -48,8 +53,13 @@ public class RBSMainActivity extends Activity { |
|
|
|
helper.getWritableDatabase();
|
|
|
|
|
|
|
|
this.viewFlipper = (ViewFlipper) findViewById(R.id.viewFlipper);
|
|
|
|
|
|
|
|
this.scrollView = (ScrollView) findViewById(R.id.scrollView1);
|
|
|
|
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.calcAccuracyCboBox = (XSpinner) findViewById(R.id.calcPrecisionCboBox);
|
|
|
|
|
|
|
|
this.scrollView.setOnTouchListener(new OnTouchListener() {
|
|
|
|
|
|
|
|
static final int MIN_DISTANCE = 50;
|
|
|
|
@@ -82,7 +92,9 @@ public class RBSMainActivity extends Activity { |
|
|
|
|
|
|
|
// Show The Next Screen
|
|
|
|
RBSMainActivity.this.viewFlipper.showNext();
|
|
|
|
// return true;
|
|
|
|
deactivateXTextView(RBSMainActivity.this.txtViewParams);
|
|
|
|
xTextViewUp(RBSMainActivity.this.txtViewResults);
|
|
|
|
deactivateXTextView(RBSMainActivity.this.txtViewSight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -92,37 +104,54 @@ public class RBSMainActivity extends Activity { |
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
OnTouchListener tabListener = new OnTouchListener() {
|
|
|
|
|
|
|
|
this.txtViewParams = (XTextView) findViewById(R.id.viewParams);
|
|
|
|
this.txtViewParams.setOnTouchListener(new OnTouchListener() {
|
|
|
|
@Override
|
|
|
|
public boolean onTouch(final View v, final MotionEvent event) {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onTouch(final View v, final MotionEvent event) {
|
|
|
|
switch (event.getAction()) {
|
|
|
|
|
|
|
|
switch (event.getAction()) {
|
|
|
|
case MotionEvent.ACTION_DOWN: {
|
|
|
|
deactivateXTextView(RBSMainActivity.this.txtViewParams);
|
|
|
|
deactivateXTextView(RBSMainActivity.this.txtViewResults);
|
|
|
|
deactivateXTextView(RBSMainActivity.this.txtViewSight);
|
|
|
|
xTextViewDown((XTextView) v);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
case MotionEvent.ACTION_DOWN: {
|
|
|
|
RBSMainActivity.this.txtViewParams.setDrawborderColor(getResources().getColor(R.color.android_blue_dark));
|
|
|
|
RBSMainActivity.this.txtViewParams.setTextColor(getResources().getColor(R.color.android_blue_dark));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
case MotionEvent.ACTION_UP: {
|
|
|
|
|
|
|
|
case MotionEvent.ACTION_UP: {
|
|
|
|
if (v == RBSMainActivity.this.txtViewParams) {
|
|
|
|
if (RBSMainActivity.this.viewFlipper.getDisplayedChild() != 0) {
|
|
|
|
RBSMainActivity.this.viewFlipper.setDisplayedChild(0);
|
|
|
|
}
|
|
|
|
RBSMainActivity.this.txtViewParams.setDrawborderColor(getResources().getColor(R.color.android_blue));
|
|
|
|
RBSMainActivity.this.txtViewParams.setTextColor(getResources().getColor(R.color.android_blue));
|
|
|
|
return true;
|
|
|
|
} else if (v == RBSMainActivity.this.txtViewResults) {
|
|
|
|
if (RBSMainActivity.this.viewFlipper.getDisplayedChild() != 1) {
|
|
|
|
RBSMainActivity.this.viewFlipper.setDisplayedChild(1);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (RBSMainActivity.this.viewFlipper.getDisplayedChild() != 2) {
|
|
|
|
RBSMainActivity.this.viewFlipper.setDisplayedChild(2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
xTextViewUp((XTextView) v);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
this.txtViewParams.setOnTouchListener(tabListener);
|
|
|
|
this.txtViewResults.setOnTouchListener(tabListener);
|
|
|
|
this.txtViewSight.setOnTouchListener(tabListener);
|
|
|
|
|
|
|
|
|
|
|
|
// ** TEST WEISE AB HIER*******
|
|
|
|
|
|
|
|
this.listView1 = (ListView) findViewById(R.id.listView1);
|
|
|
|
|
|
|
|
String[] values = new String[] { "Riser", "Sight", "General Config" };
|
|
|
|
@@ -194,10 +223,46 @@ public class RBSMainActivity extends Activity { |
|
|
|
this.viewFlipper.showPrevious();
|
|
|
|
}
|
|
|
|
|
|
|
|
deactivateXTextView(RBSMainActivity.this.txtViewParams);
|
|
|
|
deactivateXTextView(RBSMainActivity.this.txtViewResults);
|
|
|
|
deactivateXTextView(RBSMainActivity.this.txtViewSight);
|
|
|
|
|
|
|
|
switch (this.viewFlipper.getDisplayedChild()) {
|
|
|
|
case 0:
|
|
|
|
xTextViewUp(this.txtViewParams);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
xTextViewUp(this.txtViewResults);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
xTextViewUp(this.txtViewSight);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void xTextViewDown(final XTextView view) {
|
|
|
|
view.setDrawborderColor(getResources().getColor(R.color.android_blue_dark));
|
|
|
|
view.setTextColor(getResources().getColor(R.color.android_blue_dark));
|
|
|
|
}
|
|
|
|
|
|
|
|
private void xTextViewUp(final XTextView view) {
|
|
|
|
view.setDrawborderColor(getResources().getColor(R.color.android_blue));
|
|
|
|
view.setTextColor(getResources().getColor(R.color.android_blue));
|
|
|
|
}
|
|
|
|
|
|
|
|
private void deactivateXTextView(final XTextView view) {
|
|
|
|
view.setDrawborderColor(getResources().getColor(R.color.white));
|
|
|
|
view.setTextColor(getResources().getColor(R.color.white));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|