Skip to content

Commit

Permalink
Add label with version and get rid of ssvep view (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
capitancambio authored Dec 3, 2017
1 parent e3f4546 commit d9d3b85
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 50 deletions.
37 changes: 18 additions & 19 deletions app/src/main/java/com/neurotechx/smartphonebci/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.neurotechx.smartphonebci;

import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
Expand Down Expand Up @@ -60,11 +59,11 @@ public void onClick(View v) {

}
});
classBoxes[0] = (TextView) findViewById(R.id.class_view);
classBoxes[1] = (TextView) findViewById(R.id.class_view1);
bar = (SeekBar) findViewById(R.id.seekBar);
bar.setIndeterminate(false);
bar.setMax(100);
// classBoxes[0] = (TextView) findViewById(R.id.class_view);
// classBoxes[1] = (TextView) findViewById(R.id.class_view1);
// bar = (SeekBar) findViewById(R.id.seekBar);
// bar.setIndeterminate(false);
// bar.setMax(100);

SectionsPagerAdapter adapter = new SectionsPagerAdapter(getSupportFragmentManager());
ViewPager pager = (ViewPager) findViewById(R.id.container);
Expand Down Expand Up @@ -107,19 +106,19 @@ public void onEvent(final Event e) {
@Override
public void run() {

double progress = e.getEpochProgress();
classBoxes[0].setText(String.format(FORMAT,e.getClassDistribution()[0]));
classBoxes[1].setText(String.format(FORMAT,e.getClassDistribution()[1]));
int ior=(int)(e.getEpochProgress()*100);
bar.setProgress((int)(e.getEpochProgress()*100));
//end of epoch mark the final selection
if (e.getEpochProgress()==1.){
int clazz = e.getSelectedClass();
classBoxes[0].setBackgroundColor(Color.TRANSPARENT);

classBoxes[1].setBackgroundColor(Color.TRANSPARENT);
classBoxes[clazz].setBackgroundColor(Color.GREEN);
}
// double progress = e.getEpochProgress();
// classBoxes[0].setText(String.format(FORMAT,e.getClassDistribution()[0]));
// classBoxes[1].setText(String.format(FORMAT,e.getClassDistribution()[1]));
// int ior=(int)(e.getEpochProgress()*100);
// bar.setProgress((int)(e.getEpochProgress()*100));
// //end of epoch mark the final selection
// if (e.getEpochProgress()==1.){
// int clazz = e.getSelectedClass();
// classBoxes[0].setBackgroundColor(Color.TRANSPARENT);
//
// classBoxes[1].setBackgroundColor(Color.TRANSPARENT);
// classBoxes[clazz].setBackgroundColor(Color.GREEN);
// }
}
});
}
Expand Down
36 changes: 6 additions & 30 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,6 @@
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

<TextView
android:layout_width="60dp"
android:layout_height="60dp"
android:text="0.00"
android:id="@+id/class_view"
android:focusableInTouchMode="false"
android:gravity="center_vertical|center"
android:layout_alignTop="@+id/carrier_button"
android:layout_toRightOf="@+id/carrier_button"
android:layout_toEndOf="@+id/carrier_button" />

<TextView
android:layout_width="60dp"
android:layout_height="60dp"
android:text="0.00"
android:id="@+id/class_view1"
android:layout_marginLeft="27dp"
android:layout_marginStart="27dp"
android:gravity="center_vertical|center"
android:layout_toRightOf="@+id/class_view"
android:layout_toEndOf="@+id/class_view" />


<!--<fragment-->
<!--android:layout_width="wrap_content"-->
Expand All @@ -63,17 +41,15 @@
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

<SeekBar
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/seekBar"
android:layout_alignRight="@+id/container"
android:layout_alignEnd="@+id/container"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/class_view1"
android:layout_toEndOf="@+id/class_view1"
android:max="100"
android:progress="80" />
android:text="@string/version"
tools:text="@string/version" />


</RelativeLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<string name="app_name">SmartphoneBCI</string>

<string name="version">alpha_0.0.6</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>

0 comments on commit d9d3b85

Please sign in to comment.