Skip to content

Commit

Permalink
Merge pull request #1425 from fossasia/development
Browse files Browse the repository at this point in the history
chore: merge dev into master
  • Loading branch information
CloudyPadmal authored Oct 24, 2018
2 parents 5d99ff7 + 58e1aba commit f3529fb
Show file tree
Hide file tree
Showing 20 changed files with 507 additions and 787 deletions.
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

0 comments on commit f3529fb

Please sign in to comment.