Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-OS Engine support + moving of generic Java code to commons #110

Merged
merged 5 commits into from
Sep 14, 2021
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
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dependencies {
implementation 'androidx.multidex:multidex:2.0.1'

implementation 'com.jakewharton:butterknife:10.2.0'
implementation project(path: ':commons')
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'

implementation 'com.jakewharton.rxbinding2:rxbinding:2.2.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package hpsaturn.pollutionreporter;

import android.Manifest;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import androidx.annotation.NonNull;
Expand Down Expand Up @@ -36,14 +33,14 @@

import butterknife.BindView;
import butterknife.ButterKnife;
import hpsaturn.pollutionreporter.models.ResponseConfig;
import com.jetbrains.handson.commons.models.ResponseConfig;
hpsaturn marked this conversation as resolved.
Show resolved Hide resolved
import hpsaturn.pollutionreporter.service.RecordTrackService;
import hpsaturn.pollutionreporter.service.RecordTrackInterface;
import hpsaturn.pollutionreporter.service.RecordTrackManager;
import hpsaturn.pollutionreporter.service.RecordTrackScheduler;
import hpsaturn.pollutionreporter.common.Keys;
import hpsaturn.pollutionreporter.models.SensorData;
import hpsaturn.pollutionreporter.models.SensorTrackInfo;
import com.jetbrains.handson.commons.models.SensorData;
import com.jetbrains.handson.commons.models.SensorTrackInfo;
import hpsaturn.pollutionreporter.view.ChartFragment;
import hpsaturn.pollutionreporter.view.DisclosureFragment;
import hpsaturn.pollutionreporter.view.PickerFragmentAdapter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.hpsaturn.tools.Logger;
import com.jetbrains.handson.commons.api.AqicnDataResponse;
import com.jetbrains.handson.commons.api.AqicnInterface;

import hpsaturn.pollutionreporter.R;
import retrofit2.Call;
Expand Down
19 changes: 0 additions & 19 deletions app/src/main/java/hpsaturn/pollutionreporter/api/AqicnIaqi.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
Expand All @@ -11,8 +10,8 @@
import java.util.ArrayList;
import java.util.Iterator;

import hpsaturn.pollutionreporter.models.SensorData;
import hpsaturn.pollutionreporter.models.SensorTrack;
import com.jetbrains.handson.commons.models.SensorData;
import com.jetbrains.handson.commons.models.SensorTrack;

/**
* Created by Antonio Vanegas @hpsaturn on 7/4/18.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package hpsaturn.pollutionreporter.service;

import hpsaturn.pollutionreporter.models.ResponseConfig;
import hpsaturn.pollutionreporter.models.SensorConfig;
import hpsaturn.pollutionreporter.models.SensorData;
import com.jetbrains.handson.commons.models.ResponseConfig;
import com.jetbrains.handson.commons.models.SensorData;

/**
* Created by Antonio Vanegas @hpsaturn on 7/2/18.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
import com.google.gson.Gson;
import com.hpsaturn.tools.Logger;

import java.lang.reflect.Type;

import hpsaturn.pollutionreporter.models.ResponseConfig;
import hpsaturn.pollutionreporter.models.SensorConfig;
import hpsaturn.pollutionreporter.models.SensorData;
import com.jetbrains.handson.commons.models.ResponseConfig;
import com.jetbrains.handson.commons.models.SensorData;

/**
* Created by Antonio Vanegas @hpsaturn on 7/2/18.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
import hpsaturn.pollutionreporter.common.BLEHandler;
import hpsaturn.pollutionreporter.common.Keys;
import hpsaturn.pollutionreporter.common.Storage;
import hpsaturn.pollutionreporter.models.ResponseConfig;
import hpsaturn.pollutionreporter.models.SensorData;
import hpsaturn.pollutionreporter.models.SensorTrack;
import hpsaturn.pollutionreporter.models.TrackStatus;
import com.jetbrains.handson.commons.models.ResponseConfig;
import com.jetbrains.handson.commons.models.SensorData;
import com.jetbrains.handson.commons.models.SensorTrack;
import com.jetbrains.handson.commons.models.TrackStatus;
import io.nlopez.smartlocation.OnLocationUpdatedListener;
import io.nlopez.smartlocation.SmartLocation;
import io.nlopez.smartlocation.location.config.LocationParams;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.graphics.Paint;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
Expand All @@ -18,12 +17,8 @@
import com.github.mikephil.charting.charts.LineChart;
import com.github.mikephil.charting.components.Description;
import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.components.YAxis;
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
import com.github.mikephil.charting.listener.ChartTouchListener;
import com.github.mikephil.charting.listener.OnChartGestureListener;
import com.github.mikephil.charting.utils.MPPointD;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
Expand Down Expand Up @@ -51,9 +46,9 @@
import hpsaturn.pollutionreporter.MainActivity;
import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.common.Storage;
import hpsaturn.pollutionreporter.models.SensorData;
import hpsaturn.pollutionreporter.models.SensorTrack;
import hpsaturn.pollutionreporter.models.SensorTrackInfo;
import com.jetbrains.handson.commons.models.SensorData;
import com.jetbrains.handson.commons.models.SensorTrack;
import com.jetbrains.handson.commons.models.SensorTrackInfo;

/**
* Created by Antonio Vanegas @hpsaturn on 6/30/18.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.List;

import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.models.SensorData;
import com.jetbrains.handson.commons.models.SensorData;

/**
* Created by Antonio Vanegas @hpsaturn on 3/20/21.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import hpsaturn.pollutionreporter.MainActivity;
import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.api.AqicnApiManager;
import hpsaturn.pollutionreporter.api.AqicnDataResponse;
import hpsaturn.pollutionreporter.models.SensorData;
import hpsaturn.pollutionreporter.models.SensorTrackInfo;
import com.jetbrains.handson.commons.api.AqicnDataResponse;
import com.jetbrains.handson.commons.models.SensorData;
import com.jetbrains.handson.commons.models.SensorTrackInfo;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import hpsaturn.pollutionreporter.Config;
import hpsaturn.pollutionreporter.MainActivity;
import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.models.SensorTrackInfo;
import com.jetbrains.handson.commons.models.SensorTrackInfo;

/**
* Created by Antonio Vanegas @hpsaturn on 10/20/15.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import android.widget.TextView;

import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.models.SensorTrackInfo;
import com.jetbrains.handson.commons.models.SensorTrackInfo;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.List;

import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.models.SensorTrack;
import com.jetbrains.handson.commons.models.SensorTrack;

/**
* Created by Antonio Vanegas @hpsaturn on 10/20/15.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import hpsaturn.pollutionreporter.MainActivity;
import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.common.Storage;
import hpsaturn.pollutionreporter.models.SensorTrack;
import com.jetbrains.handson.commons.models.SensorTrack;

/**
* Created by Antonio Vanegas @hpsaturn on 10/20/15.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

import hpsaturn.pollutionreporter.MainActivity;
import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.models.ResponseConfig;
import hpsaturn.pollutionreporter.models.SensorConfig;
import hpsaturn.pollutionreporter.models.SensorData;
import com.jetbrains.handson.commons.models.ResponseConfig;
import com.jetbrains.handson.commons.models.SensorConfig;
import com.jetbrains.handson.commons.models.SensorData;
import hpsaturn.pollutionreporter.service.RecordTrackInterface;
import hpsaturn.pollutionreporter.service.RecordTrackManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.apache.commons.lang3.math.NumberUtils;

import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.models.ResponseConfig;
import com.jetbrains.handson.commons.models.ResponseConfig;

/**
* Created by Antonio Vanegas @hpsaturn on 4/8/21.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
import hpsaturn.pollutionreporter.Config;
import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.common.Keys;
import hpsaturn.pollutionreporter.models.CommandConfig;
import hpsaturn.pollutionreporter.models.GeoConfig;
import hpsaturn.pollutionreporter.models.InfluxdbConfig;
import hpsaturn.pollutionreporter.models.ResponseConfig;
import hpsaturn.pollutionreporter.models.SensorConfig;
import hpsaturn.pollutionreporter.models.WifiConfig;
import com.jetbrains.handson.commons.models.CommandConfig;
import com.jetbrains.handson.commons.models.GeoConfig;
import com.jetbrains.handson.commons.models.InfluxdbConfig;
import com.jetbrains.handson.commons.models.ResponseConfig;
import com.jetbrains.handson.commons.models.SensorConfig;
import com.jetbrains.handson.commons.models.WifiConfig;
import io.nlopez.smartlocation.SmartLocation;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import hpsaturn.pollutionreporter.AppData;
import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.common.Keys;
import hpsaturn.pollutionreporter.models.ResponseConfig;
import com.jetbrains.handson.commons.models.ResponseConfig;

/**
* Created by Antonio Vanegas @hpsaturn on 3/31/21.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import org.apache.commons.lang3.math.NumberUtils;

import hpsaturn.pollutionreporter.R;
import hpsaturn.pollutionreporter.models.AltitudeOffsetConfig;
import hpsaturn.pollutionreporter.models.CommandConfig;
import hpsaturn.pollutionreporter.models.TempOffsetConfig;
import hpsaturn.pollutionreporter.models.ResponseConfig;
import hpsaturn.pollutionreporter.models.SampleConfig;
import hpsaturn.pollutionreporter.models.SensorConfig;
import hpsaturn.pollutionreporter.models.SensorType;
import com.jetbrains.handson.commons.models.AltitudeOffsetConfig;
import com.jetbrains.handson.commons.models.CommandConfig;
import com.jetbrains.handson.commons.models.TempOffsetConfig;
import com.jetbrains.handson.commons.models.ResponseConfig;
import com.jetbrains.handson.commons.models.SampleConfig;
import com.jetbrains.handson.commons.models.SensorConfig;
import com.jetbrains.handson.commons.models.SensorType;

/**
* Created by Antonio Vanegas @hpsaturn on 3/31/21.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.runners.MockitoJUnitRunner;

import hpsaturn.pollutionreporter.api.AqicnApiManager;
import hpsaturn.pollutionreporter.api.AqicnDataResponse;
import com.jetbrains.handson.commons.api.AqicnDataResponse;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
Expand Down
1 change: 1 addition & 0 deletions commons/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
15 changes: 15 additions & 0 deletions commons/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
plugins {
id 'java-library'
}

java {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hpsaturn.pollutionreporter.api;
package com.jetbrains.handson.commons.api;

/**
* Created by Antonio Vanegas @hpsaturn on 12/28/19.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package hpsaturn.pollutionreporter.api;
package com.jetbrains.handson.commons.api;

import java.util.List;

/**
* Created by Antonio Vanegas @hpsaturn on 12/28/19.
*/
class AqicnCity {
public class AqicnCity {

public String name;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hpsaturn.pollutionreporter.api;
package com.jetbrains.handson.commons.api;

/**
* Created by Antonio Vanegas @hpsaturn on 12/28/19.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
package hpsaturn.pollutionreporter.api;
package com.jetbrains.handson.commons.api;

import com.jetbrains.handson.commons.api.AqicnAttributions;
import com.jetbrains.handson.commons.api.AqicnCity;
import com.jetbrains.handson.commons.api.AqicnDebug;
import com.jetbrains.handson.commons.api.AqicnIaqi;
import com.jetbrains.handson.commons.api.AqicnTime;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package hpsaturn.pollutionreporter.api;
package com.jetbrains.handson.commons.api;

import com.jetbrains.handson.commons.api.AqicnData;

/**
* Created by Antonio Vanegas @hpsaturn on 12/28/19.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hpsaturn.pollutionreporter.api;
package com.jetbrains.handson.commons.api;

/**
* Created by Antonio Vanegas @hpsaturn on 12/29/19.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hpsaturn.pollutionreporter.api;
package com.jetbrains.handson.commons.api;

/**
* Created by Antonio Vanegas @hpsaturn on 12/29/19.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hpsaturn.pollutionreporter.api;
package com.jetbrains.handson.commons.api;

/**
* Created by Antonio Vanegas @hpsaturn on 12/28/19.
Expand Down
Loading