Skip to content

Commit 281b294

Browse files
authored
Merge pull request #1963 from fossasia/development
chore: merge dev into master
2 parents 3b9e7ea + 008d09a commit 281b294

File tree

102 files changed

+2683
-3499
lines changed

Some content is hidden

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

102 files changed

+2683
-3499
lines changed

.github/release-drafter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name-template: 'PSLab Version $NEXT_PATCH_VERSION'
22
tag-template: 'v$NEXT_PATCH_VERSION'
3-
change-template: '- $TITLE (#$NUMBER) - @$AUTHOR'
43
categories:
54
- title: ':rocket: Features and Enhancements'
65
labels:
@@ -12,6 +11,7 @@ categories:
1211
label: 'Chore'
1312
- title: ':page_facing_up: Documentation'
1413
label: 'Documentation'
14+
change-template: '- $TITLE (#$NUMBER) - @$AUTHOR'
1515
template: |-
1616
## Changes
1717
$CHANGES

README.md

+27-26
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
# PSLab Android App
22

3-
<a href="https://play.google.com/store/apps/details?id=io.pslab"><img alt="Get it on Google Play" height="80" src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png"></a>
4-
<a href="https://f-droid.org/app/io.pslab"><img alt="Get it on F-Droid" height="80" src="https://f-droid.org/badge/get-it-on.png"></a>
3+
Repository for the PSLab Android App for performing experiments with the [Pocket Science Lab](https://pslab.io) open-hardware platform.
54

65
[![Build Status](https://travis-ci.org/fossasia/pslab-android.svg?branch=development)](https://travis-ci.org/fossasia/pslab-android)
7-
[![Gitter](https://badges.gitter.im/fossasia/pslab.svg)](https://gitter.im/fossasia/pslab?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
86
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/dd728d91bb5743ff916c16c1251f8dd5)](https://www.codacy.com/app/praveenkumar103/pslab-android?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=fossasia/pslab-android&amp;utm_campaign=Badge_Grade)
97
[![Mailing List](https://img.shields.io/badge/Mailing%20List-FOSSASIA-blue.svg)](https://groups.google.com/forum/#!forum/pslab-fossasia)
10-
[![Twitter Follow](https://img.shields.io/twitter/follow/pslabio.svg?style=social&label=Follow&maxAge=2592000?style=flat-square)](https://twitter.com/pslabio)
11-
128
![Minimum API Level](https://img.shields.io/badge/Min%20API%20Level-23-green)
139
![Maximum API Level](https://img.shields.io/badge/Max%20API%20Level-28-orange)
1410
![GitHub repo size](https://img.shields.io/github/repo-size/fossasia/pslab-android)
11+
[![Gitter](https://badges.gitter.im/fossasia/pslab.svg)](https://gitter.im/fossasia/pslab?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
12+
[![Twitter Follow](https://img.shields.io/twitter/follow/pslabio.svg?style=social&label=Follow&maxAge=2592000?style=flat-square)](https://twitter.com/pslabio)
1513

1614
This repository holds the Android App for performing experiments with [PSLab](https://pslab.io/). PSLab is a tiny pocket science lab that provides an array of equipment for doing science and engineering experiments. It can function like an oscilloscope, waveform generator, frequency counter, programmable voltage and current source and also as a data logger. Our website is at https://pslab.io
1715

16+
<a href="https://play.google.com/store/apps/details?id=io.pslab"><img alt="Get it on Google Play" height="80" src="/docs/images/playstore_badge.png"></a>
17+
<a href="https://f-droid.org/app/io.pslab"><img alt="Get it on F-Droid" height="80" src="/docs/images/fdroid_badge.png"></a>
18+
19+
## Buy
20+
21+
* You can get a Pocket Science Lab device from the [FOSSASIA Shop](https://fossasia.com).
22+
* More resellers are listed on the [PSLab website](https://pslab.io/shop/).
23+
1824
## Communication
1925

20-
Please join us on the following channels:
21-
* [Pocket Science Channel](https://gitter.im/fossasia/pslab)
22-
* [Mailing List](https://groups.google.com/forum/#!forum/pslab-fossasia)
26+
* The PSLab [chat channel is on Gitter](https://gitter.im/fossasia/pslab).
27+
* Please also join us on the [PSLab Mailing List](https://groups.google.com/forum/#!forum/pslab-fossasia).
2328

2429
## Roadmap
2530
- [x] First we need to get communication between Android App and PSLab working.
@@ -31,9 +36,9 @@ Please join us on the following channels:
3136
<table>
3237
<tr>
3338
<td><img src="/docs/images/view_device_not_found.png"></td>
34-
<td><img src="/docs/images/view_initialization.png"></td>
3539
<td><img src="/docs/images/view_home_screen.png"></td>
3640
<td><img src="/docs/images/view_instrument_panel.png"></td>
41+
<td><img src="/docs/images/view_about_us.png"></td>
3742
</tr>
3843
</table>
3944
<table>
@@ -44,36 +49,32 @@ Please join us on the following channels:
4449
</table>
4550
<table>
4651
<tr>
47-
<td><img src="/docs/images/view_about_us.png"></td>
48-
<td><img src="/docs/images/view_not_connected_nav_menu.png" width = "500"></td>
4952
<td><img src="/docs/images/view_pin_layout_front.png"></td>
5053
<td><img src="/docs/images/view_pin_layout_back.png"></td>
54+
<td><img src="/docs/images/view_side_navigation_drawer.png"></td>
55+
<td><img src="/docs/images/instrument_luxmeter_guide.png"></td>
5156
</tr>
5257
</table>
5358
<table>
5459
<tr>
55-
<td><img src="/docs/images/instrument_oscilloscope_channelparam.png"></td>
56-
<td><img src="/docs/images/instrument_oscilloscope_audiojack.png"></td>
60+
<td><img src="/docs/images/instrument_oscilloscope_channel_view.png"></td>
61+
<td><img src="/docs/images/instrument_oscilloscope_audiojack_view.png"></td>
5762
</tr>
5863
</table>
5964
<table>
6065
<tr>
6166
<td><img src="/docs/images/instrument_wave_generator_analog.png"></td>
6267
<td><img src="/docs/images/instrument_wave_generator_digital.png"></td>
63-
</tr>
64-
</table>
65-
<table>
66-
<tr>
6768
<td><img src="/docs/images/instrument_power_source_view.png"></td>
68-
<td><img src="/docs/images/instrument_luxmeter_guide.png"></td>
69-
<td><img src="/docs/images/instrument_multimeter_view.png"></td>
69+
<td><img src="/docs/images/instrument_multi_meter_view.png"></td>
7070
</tr>
7171
</table>
7272
<table>
7373
<tr>
7474
<td><img src="/docs/images/instrument_barometer_view.png"></td>
7575
<td><img src="/docs/images/view_log_map_location.png"></td>
7676
<td><img src="/docs/images/view_data_logger.png"></td>
77+
<td><img src="/docs/images/view_create_config_file.png"></td>
7778
</tr>
7879
</table>
7980
<table>
@@ -86,8 +87,8 @@ Please join us on the following channels:
8687
</table>
8788
<table>
8889
<tr>
89-
<td><img src="/docs/images/instrument_robotic_arm_view.png" width = "1000"/></td>
90-
<td><img src="/docs/images/instrument_logic_analyzer_view.png"/></td>
90+
<td><img src="/docs/images/instrument_robotic_arm_controller_view.png" width = "500"/></td>
91+
<td><img src="/docs/images/instrument_logical_analyzer_view.png" width = "500"/></td>
9192
</tr>
9293
</table>
9394

@@ -107,10 +108,10 @@ Please join us on the following channels:
107108
| Logical Analyzer | Captures and displays signals from digital system | :heavy_check_mark: |
108109
| Wave Generator | Generates arbitrary analog and digital waveforms | :heavy_check_mark: |
109110
| Power Source | Generates programmable voltage and currents | :heavy_check_mark: |
110-
| Lux Meter | Measures the ambient light intensity | :heavy_check_mark: |
111-
| Baro Meter | Measures the Pressure | :heavy_check_mark: |
112-
| AcceleroMeter | Measures the acceleration of the device | :heavy_check_mark: |
113-
| Gyro Meter | Measures the rate of rotation | :heavy_check_mark: |
111+
| Luxmeter | Measures the ambient light intensity | :heavy_check_mark: |
112+
| Barometer | Measures the Pressure | :heavy_check_mark: |
113+
| Accelerometer | Measures the acceleration of the device | :heavy_check_mark: |
114+
| Gyrometer | Measures the rate of rotation | :heavy_check_mark: |
114115
| Compass | Measures the absolute rotation relative to earth magnetic poles | :heavy_check_mark: |
115116
| Thermometer | Measures the ambient temperature | :heavy_check_mark: |
116117
| Gas Sensor | Detects gases, including NH3, NOx, alcohol, benzene, smoke and CO2| :heavy_check_mark: |
@@ -249,7 +250,7 @@ The project is maintained by
249250
- Lorenz Gerber ([@lorenzgerber](https://github.com/lorenzgerber))
250251
- Wei Tat ([@cweitat](https://github.com/cweitat))
251252
- Wai Gie ([@woshikie](https://github.com/woshikie))
252-
253+
- Neel Trivedi ([@neel1998](https://github.com/neel1998))
253254
## Alumni
254255
- Praveen Patil ([@wavicles](https://github.com/wavicles))
255256
- Jithin ([@jithinbp](https://github.com/jithinbp))

app/build.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ android {
1313
applicationId "io.pslab"
1414
minSdkVersion rootProject.ext.minSdkVersion
1515
targetSdkVersion rootProject.ext.targetSdkVersion
16-
versionCode 19
17-
versionName "2.0.18"
16+
versionCode 20
17+
versionName "2.0.19"
1818
multiDexEnabled true
1919
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2020
}
@@ -63,9 +63,11 @@ android {
6363
flavorDimensions 'default'
6464
productFlavors {
6565
fdroid {
66+
resValue "string", "flavor", "Fdroid version"
6667
dimension = 'default'
6768
}
6869
playstore {
70+
resValue "string", "flavor", "Play Store version"
6971
dimension = 'default'
7072
}
7173
}

app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
android:screenOrientation="portrait" />
8585
<activity
8686
android:name=".activity.WaveGeneratorActivity"
87-
android:screenOrientation="userLandscape" />
87+
android:screenOrientation="portrait" />
8888
<activity
8989
android:name=".activity.AccelerometerActivity"
9090
android:screenOrientation="portrait" />

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

+19-9
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
import android.support.design.widget.Snackbar;
66
import android.support.v7.app.AppCompatActivity;
77
import android.support.v7.widget.Toolbar;
8-
import android.util.SparseBooleanArray;
8+
import android.view.Gravity;
99
import android.view.MenuItem;
1010
import android.view.View;
1111
import android.widget.AdapterView;
1212
import android.widget.ArrayAdapter;
1313
import android.widget.Button;
14+
import android.widget.CheckBox;
1415
import android.widget.EditText;
15-
import android.widget.ListView;
16+
import android.widget.LinearLayout;
1617
import android.widget.Spinner;
1718
import android.widget.Toast;
1819

@@ -30,20 +31,20 @@ public class CreateConfigActivity extends AppCompatActivity {
3031
private ArrayList<String> instrumentsList;
3132
private ArrayList<String[]> instrumentParamsList;
3233
private ArrayList<String[]> instrumentParamsListTitles;
33-
private ListView paramsListView;
3434
private int selectedItem = 0;
3535
private String intervalUnit = "sec";
3636
private EditText intervalEditText;
3737
private String interval;
3838
private View rootView;
39+
private LinearLayout paramsListContainer;
3940

4041
@Override
4142
protected void onCreate(Bundle savedInstanceState) {
4243
super.onCreate(savedInstanceState);
4344
setContentView(R.layout.activity_create_config);
4445
Toolbar toolbar = findViewById(R.id.toolbar);
4546
rootView = findViewById(R.id.create_config_root_view);
46-
paramsListView = findViewById(R.id.params_list);
47+
paramsListContainer = findViewById(R.id.params_list_container);
4748
Spinner selectInstrumentSpinner = findViewById(R.id.select_instrument_spinner);
4849
Spinner intervalUnitSpinner = findViewById(R.id.interval_unit_spinner);
4950
intervalEditText = findViewById(R.id.interval_edit_text);
@@ -95,10 +96,10 @@ public void onClick(View v) {
9596
if (interval.length() == 0) {
9697
Toast.makeText(CreateConfigActivity.this, getResources().getString(R.string.no_interval_message), Toast.LENGTH_SHORT).show();
9798
} else {
98-
SparseBooleanArray selectedParams = paramsListView.getCheckedItemPositions();
9999
ArrayList<String> selectedParamsList = new ArrayList<>();
100-
for (int i = 0; i < paramsListView.getCount(); i++) {
101-
if (selectedParams.get(i)) {
100+
for (int i = 0; i < paramsListContainer.getChildCount(); i ++) {
101+
CheckBox checkBox = (CheckBox) paramsListContainer.getChildAt(i);
102+
if (checkBox.isChecked()) {
102103
selectedParamsList.add(instrumentParamsList.get(selectedItem)[i]);
103104
}
104105
}
@@ -133,8 +134,17 @@ private void createArrayLists() {
133134
}
134135

135136
private void createCheckboxList() {
136-
paramsListView.setAdapter(new ArrayAdapter<String>(CreateConfigActivity.this, android.R.layout.simple_list_item_multiple_choice, instrumentParamsListTitles.get(selectedItem)));
137-
paramsListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
137+
paramsListContainer.removeAllViews();
138+
String[] params = instrumentParamsListTitles.get(selectedItem);
139+
for (int i = 0; i < params.length; i++){
140+
CheckBox checkBox = new CheckBox(CreateConfigActivity.this);
141+
checkBox.setText(params[i]);
142+
LinearLayout.LayoutParams checkBoxParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
143+
checkBoxParams.gravity = Gravity.CENTER_HORIZONTAL;
144+
checkBoxParams.setMargins(0,(int)getResources().getDimension(R.dimen.create_config_margin1),0,0);
145+
checkBox.setLayoutParams(checkBoxParams);
146+
paramsListContainer.addView(checkBox, i);
147+
}
138148
}
139149

140150
@Override

0 commit comments

Comments
 (0)