Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "io.pslab"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 5
versionName "2.0.4"
versionCode 6
versionName "2.0.5"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand Down
21 changes: 9 additions & 12 deletions app/src/main/java/io/pslab/activity/AccelerometerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,11 @@ public class AccelerometerActivity extends AppCompatActivity {

public boolean recordData = false;
public boolean locationPref;
private boolean checkGpsOnResume = false;
private boolean isRecordingStarted = false;
private boolean isDataRecorded = false;
public GPSLogger gpsLogger;
public CSVLogger accLogger;

private Menu menu;
AccelerometerAdapter adapter;

BottomSheetBehavior bottomSheetBehavior;
GestureDetector gestureDetector;

@BindView(R.id.accel_toolbar)
Toolbar mToolbar;
@BindView(R.id.accel_coordinator_layout)
Expand All @@ -85,6 +78,10 @@ public class AccelerometerActivity extends AppCompatActivity {
ImageView bottomSheetSchematic;
@BindView(R.id.custom_dialog_desc)
TextView bottomSheetDesc;
private boolean checkGpsOnResume = false;
private boolean isRecordingStarted = false;
private boolean isDataRecorded = false;
private Menu menu;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -97,7 +94,7 @@ protected void onCreate(Bundle savedInstanceState) {
tvShadow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(bottomSheetBehavior.getState()==BottomSheetBehavior.STATE_EXPANDED)
if (bottomSheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED)
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
tvShadow.setVisibility(View.GONE);
}
Expand Down Expand Up @@ -131,7 +128,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
return true;
}
if (recordData) {
item.setIcon(R.drawable.record_icon);
item.setIcon(R.drawable.ic_record_white);
adapter.setRecordingStatus(false);
recordData = false;
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_paused), null, null);
Expand Down Expand Up @@ -163,7 +160,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.record_csv_data:
if (isDataRecorded) {
MenuItem item1 = menu.findItem(R.id.record_pause_data);
item1.setIcon(R.drawable.record_icon);
item1.setIcon(R.drawable.ic_record_white);

// Export Data
ArrayList<Entry> dataX = adapter.getEntries(0);
Expand Down Expand Up @@ -214,7 +211,7 @@ public void onClick(DialogInterface dialogInterface, int i) {
case R.id.delete_csv_data:
if (isDataRecorded) {
MenuItem item1 = menu.findItem(R.id.record_pause_data);
item1.setIcon(R.drawable.record_icon);
item1.setIcon(R.drawable.ic_record_white);
adapter.setRecordingStatus(false);
recordData = false;
isRecordingStarted = false;
Expand Down Expand Up @@ -247,7 +244,7 @@ public void onClick(DialogInterface dialogInterface, int i) {
@Override
protected void onDestroy() {
super.onDestroy();
if(isRecordingStarted) {
if (isRecordingStarted) {
accLogger.deleteFile();
isRecordingStarted = false;
}
Expand Down
Loading