Skip to content

Commit 36d2d0c

Browse files
authored
Merge pull request #1486 from fossasia/development
chore: merge dev into master branch
2 parents 446a3e5 + 71b79dc commit 36d2d0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1899
-1021
lines changed

README.md

+59-11
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ Please join us on the following channels:
5050
<td><img src="/docs/images/view_lux_meter.png"></td>
5151
</tr>
5252
</table>
53+
<table>
54+
<tr>
55+
<td><img src="/docs/images/view_log_map_location.png"></td>
56+
<td><img src="/docs/images/view_barometer.png"></td>
57+
<td><img src="/docs/images/view_data_logger.png"></td>
58+
</tr>
59+
</table>
5360

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

7279

7380
## How to set up the Android app in your development environment
@@ -122,6 +129,39 @@ Please help us follow the best practice to make it easy for the reviewer as well
122129
* 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.
123130
* If the PR is related to any front end change, please attach relevant screenshots in the pull request description.
124131

132+
#### How to `git squash`?
133+
134+
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.
135+
136+
* Intentionally adding multiple commit messages after each change without just `git add`ing.
137+
* Updating the current branch with the remote so a merge commit takes place.
138+
139+
Despite any reason, follow the steps given below to squash all commits into one adhering to our best practices.
140+
141+
* Setup remote to upstream branch if not set before;
142+
143+
`$ git remote add upstream https://github.com/fossasia/pslab-android.git`
144+
145+
* Check into the branch related to the pull request
146+
147+
`$ git checkout <branch-name>`
148+
149+
* Perform a soft reset to retain the changes while removing all the commit details
150+
151+
`$ git reset --soft upstream/development`
152+
153+
* Add files to the staging area
154+
155+
`$ git add <file paths or "." to add everything>`
156+
157+
* Create a new commit with a proper message following commit message guidelines
158+
159+
`$ git commit -m "tag: commit message"`
160+
161+
* If you have already made a pull request,
162+
163+
`$ git push -f origin <branch-name>`
164+
125165
### Branch Policy
126166

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

153193
## Maintainers
154194
The project is maintained by
155-
- Praveen Patil ([@wavicles](https://github.com/wavicles))
195+
- Padmal ([@CloudyPadmal](https://github.com/CloudyPadmal))
156196
- Mario Behling ([@mariobehling](http://github.com/mariobehling))
157197
- Lorenz Gerber ([@lorenzgerber](https://github.com/lorenzgerber))
158198
- Wei Tat ([@cweitat](https://github.com/cweitat))
159199
- Wai Gie ([@woshikie](https://github.com/woshikie))
200+
201+
## Alumni
202+
- Praveen Patil ([@wavicles](https://github.com/wavicles))
160203
- Jithin ([@jithinbp](https://github.com/jithinbp))
161-
- 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))
162-
- 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))
204+
- Akarshan Gandotra ([@akarshan96](https://github.com/akarshan96))
205+
- Asitava Sarkar ([@asitava1998](https://github.com/asitava1998))
206+
- Vivek Singh Bhadauria ([@viveksb007](https://github.com/viveksb007))
207+
- Avjeet ([@Avjeet](https://github.com/Avjeet))
208+
- Abhinav ([@abhinavraj23](https://github.com/abhinavraj23))
209+
- Harsh ([@harsh-2711](https://github.com/harsh-2711))
210+
- Yatri ([@yatri1609](https://github.com/yatri1609))

app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
applicationId "io.pslab"
99
minSdkVersion rootProject.ext.minSdkVersion
1010
targetSdkVersion rootProject.ext.targetSdkVersion
11-
versionCode 7
12-
versionName "2.0.6"
11+
versionCode 8
12+
versionName "2.0.7"
1313
multiDexEnabled true
1414
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1515
}

app/src/main/java/io/pslab/activity/AccelerometerActivity.java

+14-7
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
import android.support.annotation.NonNull;
1616
import android.support.design.widget.BottomSheetBehavior;
1717
import android.support.design.widget.CoordinatorLayout;
18+
import android.support.design.widget.Snackbar;
1819
import android.support.v4.app.ActivityCompat;
1920
import android.support.v4.content.ContextCompat;
21+
import android.support.v7.app.ActionBar;
2022
import android.support.v7.app.AppCompatActivity;
2123
import android.support.v7.widget.LinearLayoutManager;
2224
import android.support.v7.widget.RecyclerView;
@@ -100,6 +102,8 @@ public void onClick(View v) {
100102
}
101103
});
102104
setSupportActionBar(mToolbar);
105+
ActionBar actionBar = getSupportActionBar();
106+
actionBar.setDisplayHomeAsUpEnabled(true);
103107

104108
adapter = new AccelerometerAdapter(new String[]{"X axis", "Y axis", "Z axis"}, getApplicationContext());
105109
RecyclerView recyclerView = this.findViewById(R.id.accelerometer_recycler_view);
@@ -131,7 +135,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
131135
item.setIcon(R.drawable.ic_record_white);
132136
adapter.setRecordingStatus(false);
133137
recordData = false;
134-
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_paused), null, null);
138+
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_paused), null, null, Snackbar.LENGTH_LONG);
135139
} else {
136140
isDataRecorded = true;
137141
item.setIcon(R.drawable.pause_icon);
@@ -146,14 +150,14 @@ public boolean onOptionsItemSelected(MenuItem item) {
146150
gpsLogger = new GPSLogger(this, (LocationManager) getSystemService(Context.LOCATION_SERVICE));
147151
if (gpsLogger.isGPSEnabled()) {
148152
recordData = true;
149-
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_start) + "\n" + getString(R.string.location_enabled), null, null);
153+
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_start) + "\n" + getString(R.string.location_enabled), null, null, Snackbar.LENGTH_LONG);
150154
} else {
151155
checkGpsOnResume = true;
152156
}
153157
gpsLogger.startCaptureLocation();
154158
} else {
155159
recordData = true;
156-
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_start) + "\n" + getString(R.string.location_disabled), null, null);
160+
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_recording_start) + "\n" + getString(R.string.location_disabled), null, null, Snackbar.LENGTH_LONG);
157161
}
158162
}
159163
break;
@@ -200,12 +204,12 @@ public void onClick(DialogInterface dialogInterface, int i) {
200204
.create()
201205
.show();
202206
}
203-
});
207+
}, Snackbar.LENGTH_LONG);
204208
adapter.setRecordingStatus(false);
205209
isRecordingStarted = false;
206210
recordData = false;
207211
} else {
208-
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.nothing_to_export), null, null);
212+
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.nothing_to_export), null, null, Snackbar.LENGTH_LONG);
209213
}
210214
break;
211215
case R.id.delete_csv_data:
@@ -217,9 +221,9 @@ public void onClick(DialogInterface dialogInterface, int i) {
217221
isRecordingStarted = false;
218222
isDataRecorded = false;
219223
accLogger.deleteFile();
220-
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_deleted), null, null);
224+
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.data_deleted), null, null, Snackbar.LENGTH_LONG);
221225
} else
222-
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.nothing_to_delete), null, null);
226+
CustomSnackBar.showSnackBar(coordinatorLayout, getString(R.string.nothing_to_delete), null, null, Snackbar.LENGTH_LONG);
223227
break;
224228
case R.id.show_map:
225229
if (ContextCompat.checkSelfPermission(this,
@@ -237,6 +241,9 @@ public void onClick(DialogInterface dialogInterface, int i) {
237241
settingIntent.putExtra("title", getResources().getString(R.string.accelerometer_configurations));
238242
startActivity(settingIntent);
239243
break;
244+
case android.R.id.home:
245+
this.finish();
246+
break;
240247
default:
241248
break;
242249
}

0 commit comments

Comments
 (0)