Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #87 from divacky/master
Browse files Browse the repository at this point in the history
added dashboard consumption,possibility to turn off the display of dashboards
  • Loading branch information
jilleb committed Feb 13, 2020
2 parents 2607c47 + 7b118e5 commit 8b84206
Show file tree
Hide file tree
Showing 10 changed files with 961 additions and 174 deletions.
311 changes: 233 additions & 78 deletions app/src/main/java/com/mqbcoding/stats/DashboardFragment.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ private void initializeTimerTask() {
@Override
public void run() {
Location lastLocation = null;
int lastAltitude = 0;
try {
lastLocation = mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
lastAltitude = (int) mLastDecodedLocation.getAltitude();
Log.d(TAG,"Received location: " + lastLocation);
Log.d(TAG,"Received Altitude: " + lastAltitude);
} catch (SecurityException ex) {
Log.e(TAG, "Security Exception while getting last known location?");
}
Expand All @@ -115,6 +118,7 @@ public void run() {
List<Address> addresses = geocoder.getFromLocation(
lastLocation.getLatitude(), lastLocation.getLongitude(), 1);
if (mListener != null && addresses != null && addresses.size() > 0) {
addresses.set(0,addresses.get(0)).setUrl(String.valueOf(lastAltitude)+" m");
mListener.onNewGeocodeResult(addresses.get(0));
mLastDecodedLocation.set(lastLocation);
Log.d(TAG, "Sended location to client: " + mLastDecodedLocation);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions app/src/main/res/layout/fragment_dashboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<include
android:id="@+id/include_consumption"
layout="@layout/layout_dashboard_consumption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="88dp"
android:background="#00000000"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textTitle"
android:layout_width="580dp"
Expand Down
Loading

0 comments on commit 8b84206

Please sign in to comment.