Skip to content

Commit

Permalink
Merge pull request #1486 from fossasia/development
Browse files Browse the repository at this point in the history
chore: merge dev into master branch
  • Loading branch information
CloudyPadmal authored Dec 16, 2018
2 parents 446a3e5 + 71b79dc commit 36d2d0c
Show file tree
Hide file tree
Showing 52 changed files with 1,899 additions and 1,021 deletions.
70 changes: 59 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ Please join us on the following channels:
<td><img src="/docs/images/view_lux_meter.png"></td>
</tr>
</table>
<table>
<tr>
<td><img src="/docs/images/view_log_map_location.png"></td>
<td><img src="/docs/images/view_barometer.png"></td>
<td><img src="/docs/images/view_data_logger.png"></td>
</tr>
</table>

## Video Demo
- [PSLab Android App Overview](https://www.youtube.com/watch?v=JJfsF0b8M8k)
Expand All @@ -60,14 +67,14 @@ Please join us on the following channels:
## Features
| **Feature** | **Description** | **Status** |
|------------------|-------------------------------------------------------|-----------------|
| Home Screen | Show status and version of PSLab device | Established |
| Instruments | Exposes PSLab instruments like Oscilloscope, etc | Established |
| Oscilloscope | Shows variation of analog signals | Established |
| Multimeter | Measures voltage, current, resistance and capacitance | Established |
| Logical Analyzer | Captures and displays signals from digital system | In Progress |
| Wave Generator | Generates arbitrary analog and digital waveforms | In Progress |
| Power Source | Generates programmable voltage and currents | Established |
| Lux Meter | Measures the ambient light intensity | Established |
| Home Screen | Show status and version of PSLab device | |
| Instruments | Exposes PSLab instruments like Oscilloscope, etc | |
| Oscilloscope | Shows variation of analog signals | |
| Multimeter | Measures voltage, current, resistance and capacitance | |
| Logical Analyzer | Captures and displays signals from digital system | |
| Wave Generator | Generates arbitrary analog and digital waveforms | |
| Power Source | Generates programmable voltage and currents | |
| Lux Meter | Measures the ambient light intensity | |


## How to set up the Android app in your development environment
Expand Down Expand Up @@ -122,6 +129,39 @@ Please help us follow the best practice to make it easy for the reviewer as well
* The pull request will not get merged until and unless the commits are squashed. In case there are multiple commits on the PR, the commit author needs to squash them and not the maintainers cherrypicking and merging squashes.
* If the PR is related to any front end change, please attach relevant screenshots in the pull request description.

#### How to `git squash`?

As a tip for new developers those who struggle with squashing commits into one, multiple commits may appear in your pull request mostly due to following reasons.

* Intentionally adding multiple commit messages after each change without just `git add`ing.
* Updating the current branch with the remote so a merge commit takes place.

Despite any reason, follow the steps given below to squash all commits into one adhering to our best practices.

* Setup remote to upstream branch if not set before;

`$ git remote add upstream https://github.com/fossasia/pslab-android.git`

* Check into the branch related to the pull request

`$ git checkout <branch-name>`

* Perform a soft reset to retain the changes while removing all the commit details

`$ git reset --soft upstream/development`

* Add files to the staging area

`$ git add <file paths or "." to add everything>`

* Create a new commit with a proper message following commit message guidelines

`$ git commit -m "tag: commit message"`

* If you have already made a pull request,

`$ git push -f origin <branch-name>`

### Branch Policy

We have the following branches
Expand Down Expand Up @@ -152,11 +192,19 @@ This project is currently licensed under the Apache License 2.0. A copy of [LICE

## Maintainers
The project is maintained by
- Praveen Patil ([@wavicles](https://github.com/wavicles))
- Padmal ([@CloudyPadmal](https://github.com/CloudyPadmal))
- Mario Behling ([@mariobehling](http://github.com/mariobehling))
- Lorenz Gerber ([@lorenzgerber](https://github.com/lorenzgerber))
- Wei Tat ([@cweitat](https://github.com/cweitat))
- Wai Gie ([@woshikie](https://github.com/woshikie))

## Alumni
- Praveen Patil ([@wavicles](https://github.com/wavicles))
- Jithin ([@jithinbp](https://github.com/jithinbp))
- Akarshan Gandotra ([@akarshan96](https://github.com/akarshan96)), Asitava Sarkar ([@asitava1998](https://github.com/asitava1998)), Padmal ([@CloudyPadmal](https://github.com/CloudyPadmal)), Vivek Singh Bhadauria ([@viveksb007](https://github.com/viveksb007))
- Avjeet ([@Avjeet](https://github.com/Avjeet)), Abhinav ([@abhinavraj23](https://github.com/abhinavraj23)), Harsh ([@harsh-2711](https://github.com/harsh-2711)), Yatri ([@yatri1609](https://github.com/yatri1609))
- Akarshan Gandotra ([@akarshan96](https://github.com/akarshan96))
- Asitava Sarkar ([@asitava1998](https://github.com/asitava1998))
- Vivek Singh Bhadauria ([@viveksb007](https://github.com/viveksb007))
- Avjeet ([@Avjeet](https://github.com/Avjeet))
- Abhinav ([@abhinavraj23](https://github.com/abhinavraj23))
- Harsh ([@harsh-2711](https://github.com/harsh-2711))
- Yatri ([@yatri1609](https://github.com/yatri1609))
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 7
versionName "2.0.6"
versionCode 8
versionName "2.0.7"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand Down
21 changes: 14 additions & 7 deletions app/src/main/java/io/pslab/activity/AccelerometerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetBehavior;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
Expand Down Expand Up @@ -100,6 +102,8 @@ public void onClick(View v) {
}
});
setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);

adapter = new AccelerometerAdapter(new String[]{"X axis", "Y axis", "Z axis"}, getApplicationContext());
RecyclerView recyclerView = this.findViewById(R.id.accelerometer_recycler_view);
Expand Down Expand Up @@ -131,7 +135,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
item.setIcon(R.drawable.ic_record_white);
adapter.setRecordingStatus(false);
recordData = false;
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_paused), null, null);
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_paused), null, null, Snackbar.LENGTH_LONG);
} else {
isDataRecorded = true;
item.setIcon(R.drawable.pause_icon);
Expand All @@ -146,14 +150,14 @@ public boolean onOptionsItemSelected(MenuItem item) {
gpsLogger = new GPSLogger(this, (LocationManager) getSystemService(Context.LOCATION_SERVICE));
if (gpsLogger.isGPSEnabled()) {
recordData = true;
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_start) + "\n" + getString(R.string.location_enabled), null, null);
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_start) + "\n" + getString(R.string.location_enabled), null, null, Snackbar.LENGTH_LONG);
} else {
checkGpsOnResume = true;
}
gpsLogger.startCaptureLocation();
} else {
recordData = true;
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_start) + "\n" + getString(R.string.location_disabled), null, null);
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_start) + "\n" + getString(R.string.location_disabled), null, null, Snackbar.LENGTH_LONG);
}
}
break;
Expand Down Expand Up @@ -200,12 +204,12 @@ public void onClick(DialogInterface dialogInterface, int i) {
.create()
.show();
}
});
}, Snackbar.LENGTH_LONG);
adapter.setRecordingStatus(false);
isRecordingStarted = false;
recordData = false;
} else {
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.nothing_to_export), null, null);
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.nothing_to_export), null, null, Snackbar.LENGTH_LONG);
}
break;
case R.id.delete_csv_data:
Expand All @@ -217,9 +221,9 @@ public void onClick(DialogInterface dialogInterface, int i) {
isRecordingStarted = false;
isDataRecorded = false;
accLogger.deleteFile();
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_deleted), null, null);
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_deleted), null, null, Snackbar.LENGTH_LONG);
} else
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.nothing_to_delete), null, null);
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.nothing_to_delete), null, null, Snackbar.LENGTH_LONG);
break;
case R.id.show_map:
if (ContextCompat.checkSelfPermission(this,
Expand All @@ -237,6 +241,9 @@ public void onClick(DialogInterface dialogInterface, int i) {
settingIntent.putExtra("title", getResources().getString(R.string.accelerometer_configurations));
startActivity(settingIntent);
break;
case android.R.id.home:
this.finish();
break;
default:
break;
}
Expand Down
Loading

0 comments on commit 36d2d0c

Please sign in to comment.