rollback to code base of "versionCode = 26" because "versionCode = 27" caused problems - see #44

This commit is contained in:
y20k 2018-11-04 09:36:52 +01:00
parent ff7ba947e2
commit 9985e9f7a4
35 changed files with 149 additions and 315 deletions

View file

@ -1,9 +1,8 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion project.ext.compileSdkVersion compileSdkVersion project.ext.compileSdkVersion
// buildToolsVersion is optional because the plugin uses a recommended version by default buildToolsVersion project.ext.buildToolsVersion
defaultConfig { defaultConfig {
applicationId project.ext.applicationId applicationId project.ext.applicationId
@ -15,29 +14,26 @@ android {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
resConfigs "en", "de", "id", "it", "ja", "nb-rNO", "nl" resConfigs "en", "de", "id", "it", "ja", "nb-rNO", "nl"
} }
buildTypes { buildTypes {
release { release {
minifyEnabled true minifyEnabled true
shrinkResources true shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
debug {
// minifyEnabled true
// shrinkResources true
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
} }
} }
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:' + supportLibraryVersion
implementation "androidx.appcompat:appcompat:$appcompatVersion" implementation 'com.android.support:design:' + supportLibraryVersion
implementation "androidx.constraintlayout:constraintlayout:$constraintlayoutVersion" implementation 'com.android.support:cardview-v7:' + supportLibraryVersion
implementation "androidx.cardview:cardview:$cardviewVersion" implementation 'com.android.support.constraint:constraint-layout:' + constraintLayoutVersion
implementation 'org.osmdroid:osmdroid-android:' + osmdroidVersion
implementation "com.google.android.material:material:$materialVersion" implementation 'com.google.code.gson:gson:' + gsonVersion
implementation "org.osmdroid:osmdroid-android:$osmdroidVersion"
implementation "com.google.code.gson:gson:$gsonVersion"
} }

View file

@ -15,4 +15,3 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *; # public *;
#} #}
-dontshrink

View file

@ -34,6 +34,19 @@ import android.os.Environment;
import android.os.IBinder; import android.os.IBinder;
import android.os.Vibrator; import android.os.Vibrator;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomNavigationView;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.content.ContextCompat;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.CardView;
import android.util.SparseArray; import android.util.SparseArray;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
@ -41,10 +54,6 @@ import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.Toast; import android.widget.Toast;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import org.osmdroid.config.Configuration; import org.osmdroid.config.Configuration;
import org.y20k.trackbook.helpers.DialogHelper; import org.y20k.trackbook.helpers.DialogHelper;
import org.y20k.trackbook.helpers.ExportHelper; import org.y20k.trackbook.helpers.ExportHelper;
@ -59,17 +68,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
/** /**
* MainActivity class * MainActivity class
@ -266,20 +264,9 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
// user chose CLEAR // user chose CLEAR
handleStateAfterClear(); handleStateAfterClear();
LogHelper.v(LOG_TAG, "Clear map dialog result: CLEAR"); LogHelper.v(LOG_TAG, "Save dialog result: CLEAR");
} else if (resultCode == Activity.RESULT_CANCELED){ } else if (resultCode == Activity.RESULT_CANCELED){
LogHelper.v(LOG_TAG, "Clear map dialog result: User chose CANCEL."); LogHelper.v(LOG_TAG, "Clear map: User chose CANCEL.");
}
break;
case RESULT_EMPTY_RECORDING_DIALOG:
if (resultCode == Activity.RESULT_OK) {
// User chose RESUME RECORDING
handleResumeButtonClick((View)mFloatingActionButtonMain);
LogHelper.v(LOG_TAG, "Empty recording dialog result: RESUME");
} else if (resultCode == Activity.RESULT_CANCELED){
// User chose CANCEL - do nothing just hide the sub menu
showFloatingActionButtonMenu(false);
LogHelper.v(LOG_TAG, "Empty recording dialog result: CANCEL");
} }
break; break;
} }
@ -352,6 +339,9 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
/* Handles the visual state after a save action */ /* Handles the visual state after a save action */
private void handleStateAfterClear() { private void handleStateAfterClear() {
// notify user
Toast.makeText(this, getString(R.string.toast_message_track_clear), Toast.LENGTH_LONG).show();
// dismiss notification // dismiss notification
dismissNotification(); dismissNotification();
@ -594,24 +584,16 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
switch (mFloatingActionButtonState) { switch (mFloatingActionButtonState) {
case FAB_STATE_DEFAULT: case FAB_STATE_DEFAULT:
mFloatingActionButtonMain.hide(); // workaround todo remove asap
mFloatingActionButtonMain.setImageResource(R.drawable.ic_fiber_manual_record_white_24dp); mFloatingActionButtonMain.setImageResource(R.drawable.ic_fiber_manual_record_white_24dp);
if (mSelectedTab == FRAGMENT_ID_MAP) mFloatingActionButtonMain.show(); // workaround todo remove asap
break; break;
case FAB_STATE_RECORDING: case FAB_STATE_RECORDING:
mFloatingActionButtonMain.hide(); // workaround todo remove asap
mFloatingActionButtonMain.setImageResource(R.drawable.ic_fiber_manual_record_red_24dp); mFloatingActionButtonMain.setImageResource(R.drawable.ic_fiber_manual_record_red_24dp);
if (mSelectedTab == FRAGMENT_ID_MAP) mFloatingActionButtonMain.show(); // workaround todo remove asap
break; break;
case FAB_STATE_SAVE: case FAB_STATE_SAVE:
mFloatingActionButtonMain.hide(); // workaround todo remove asap
mFloatingActionButtonMain.setImageResource(R.drawable.ic_save_white_24dp); mFloatingActionButtonMain.setImageResource(R.drawable.ic_save_white_24dp);
if (mSelectedTab == FRAGMENT_ID_MAP) mFloatingActionButtonMain.show(); // workaround todo remove asap
break; break;
default: default:
mFloatingActionButtonMain.hide(); // workaround todo remove asap
mFloatingActionButtonMain.setImageResource(R.drawable.ic_fiber_manual_record_white_24dp); mFloatingActionButtonMain.setImageResource(R.drawable.ic_fiber_manual_record_white_24dp);
if (mSelectedTab == FRAGMENT_ID_MAP) mFloatingActionButtonMain.show(); // workaround todo remove asap
break; break;
} }
} }
@ -620,20 +602,20 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
/* Shows (and hides) the sub menu of the floating action button */ /* Shows (and hides) the sub menu of the floating action button */
private void showFloatingActionButtonMenu(boolean visible) { private void showFloatingActionButtonMenu(boolean visible) {
if (visible) { if (visible) {
mFloatingActionButtonSubResume.show(); mFloatingActionButtonSubResume.setVisibility(View.VISIBLE);
mFloatingActionButtonSubResumeLabel.setVisibility(View.VISIBLE); mFloatingActionButtonSubResumeLabel.setVisibility(View.VISIBLE);
mFloatingActionButtonSubClear.show(); mFloatingActionButtonSubClear.setVisibility(View.VISIBLE);
mFloatingActionButtonSubClearLabel.setVisibility(View.VISIBLE); mFloatingActionButtonSubClearLabel.setVisibility(View.VISIBLE);
mFloatingActionButtonSubSave.show(); mFloatingActionButtonSubSave.setVisibility(View.VISIBLE);
mFloatingActionButtonSubSaveLabel.setVisibility(View.VISIBLE); mFloatingActionButtonSubSaveLabel.setVisibility(View.VISIBLE);
mFloatingActionButtonSubMenuVisible = true; mFloatingActionButtonSubMenuVisible = true;
} else { } else {
mFloatingActionButtonSubResume.hide(); mFloatingActionButtonSubResume.setVisibility(View.INVISIBLE);
mFloatingActionButtonSubResumeLabel.setVisibility(View.INVISIBLE); mFloatingActionButtonSubResumeLabel.setVisibility(View.INVISIBLE);
mFloatingActionButtonSubClear.hide(); mFloatingActionButtonSubClear.setVisibility(View.INVISIBLE);
mFloatingActionButtonSubClearLabel.setVisibility(View.INVISIBLE); mFloatingActionButtonSubClearLabel.setVisibility(View.INVISIBLE);
mFloatingActionButtonSubSave.hide();
mFloatingActionButtonSubSaveLabel.setVisibility(View.INVISIBLE); mFloatingActionButtonSubSaveLabel.setVisibility(View.INVISIBLE);
mFloatingActionButtonSubSave.setVisibility(View.INVISIBLE);
mFloatingActionButtonSubMenuVisible = false; mFloatingActionButtonSubMenuVisible = false;
} }
} }

View file

@ -31,13 +31,15 @@ import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.SystemClock; import android.os.SystemClock;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.content.LocalBroadcastManager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Toast; import android.widget.Toast;
import com.google.android.material.snackbar.Snackbar;
import org.osmdroid.api.IMapController; import org.osmdroid.api.IMapController;
import org.osmdroid.tileprovider.tilesource.TileSourceFactory; import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.util.GeoPoint; import org.osmdroid.util.GeoPoint;
@ -46,7 +48,6 @@ import org.osmdroid.views.overlay.ItemizedIconOverlay;
import org.osmdroid.views.overlay.compass.CompassOverlay; import org.osmdroid.views.overlay.compass.CompassOverlay;
import org.osmdroid.views.overlay.compass.InternalCompassOrientationProvider; import org.osmdroid.views.overlay.compass.InternalCompassOrientationProvider;
import org.y20k.trackbook.core.Track; import org.y20k.trackbook.core.Track;
import org.y20k.trackbook.helpers.DialogHelper;
import org.y20k.trackbook.helpers.LocationHelper; import org.y20k.trackbook.helpers.LocationHelper;
import org.y20k.trackbook.helpers.LogHelper; import org.y20k.trackbook.helpers.LogHelper;
import org.y20k.trackbook.helpers.MapHelper; import org.y20k.trackbook.helpers.MapHelper;
@ -55,12 +56,6 @@ import org.y20k.trackbook.helpers.TrackbookKeys;
import java.util.List; import java.util.List;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
/** /**
* MainActivityMapFragment class * MainActivityMapFragment class
@ -129,7 +124,7 @@ public class MainActivityMapFragment extends Fragment implements TrackbookKeys {
if (savedInstanceState != null) { if (savedInstanceState != null) {
Location savedLocation = savedInstanceState.getParcelable(INSTANCE_CURRENT_LOCATION); Location savedLocation = savedInstanceState.getParcelable(INSTANCE_CURRENT_LOCATION);
// check if saved location is still current // check if saved location is still current
if (LocationHelper.isCurrent(savedLocation)) { if (LocationHelper.isNewLocation(savedLocation)) {
mCurrentBestLocation = savedLocation; mCurrentBestLocation = savedLocation;
} else { } else {
mCurrentBestLocation = null; mCurrentBestLocation = null;
@ -212,7 +207,7 @@ public class MainActivityMapFragment extends Fragment implements TrackbookKeys {
// mark user's location on map // mark user's location on map
if (mCurrentBestLocation != null && !mTrackerServiceRunning) { if (mCurrentBestLocation != null && !mTrackerServiceRunning) {
mMyLocationOverlay = MapHelper.createMyLocationOverlay(mActivity, mCurrentBestLocation, LocationHelper.isCurrent(mCurrentBestLocation), false); mMyLocationOverlay = MapHelper.createMyLocationOverlay(mActivity, mCurrentBestLocation, LocationHelper.isNewLocation(mCurrentBestLocation));
mMapView.getOverlays().add(mMyLocationOverlay); mMapView.getOverlays().add(mMyLocationOverlay);
} }
@ -312,29 +307,18 @@ public class MainActivityMapFragment extends Fragment implements TrackbookKeys {
switch(requestCode) { switch(requestCode) {
case RESULT_SAVE_DIALOG: case RESULT_SAVE_DIALOG:
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
// user chose SAVE // user chose SAVE - clear map AND save track
if (mTrack.getSize() > 0) {
// Track is not empty - clear map AND save track
clearMap(true); clearMap(true);
// FloatingActionButton state is already being handled in MainActivity // FloatingActionButton state is already being handled in MainActivity
((MainActivity)mActivity).onFloatingActionButtonResult(requestCode, resultCode); ((MainActivity)mActivity).onFloatingActionButtonResult(requestCode, resultCode);
LogHelper.v(LOG_TAG, "Save dialog result: SAVE"); LogHelper.v(LOG_TAG, "Save dialog result: SAVE");
} else {
// track is empty
handleEmptyRecordingSaveRequest();
}
} else if (resultCode == Activity.RESULT_CANCELED){ } else if (resultCode == Activity.RESULT_CANCELED){
LogHelper.v(LOG_TAG, "Save dialog result: CANCEL"); LogHelper.v(LOG_TAG, "Save dialog result: CANCEL");
} }
break; break;
case RESULT_CLEAR_DIALOG: case RESULT_CLEAR_DIALOG:
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
// User chose CLEAR // User chose CLEAR - clear map, DO NOT save track
if (mTrack.getSize() > 0) {
// Track is not empty - notify user
Toast.makeText(mActivity, getString(R.string.toast_message_track_clear), Toast.LENGTH_LONG).show();
}
// clear map, DO NOT save track
clearMap(false); clearMap(false);
// handle FloatingActionButton state in MainActivity // handle FloatingActionButton state in MainActivity
((MainActivity)mActivity).onFloatingActionButtonResult(requestCode, resultCode); ((MainActivity)mActivity).onFloatingActionButtonResult(requestCode, resultCode);
@ -342,10 +326,6 @@ public class MainActivityMapFragment extends Fragment implements TrackbookKeys {
LogHelper.v(LOG_TAG, "Clear dialog result: CANCEL"); LogHelper.v(LOG_TAG, "Clear dialog result: CANCEL");
} }
break; break;
case RESULT_EMPTY_RECORDING_DIALOG:
// handle FloatingActionButton state and possible Resume-Action in MainActivity
((MainActivity)mActivity).onFloatingActionButtonResult(requestCode, resultCode);
break;
} }
} }
@ -464,21 +444,6 @@ public class MainActivityMapFragment extends Fragment implements TrackbookKeys {
} }
/* Handles case when user chose to save recording with zero waypoints */ // todo implement
private void handleEmptyRecordingSaveRequest() {
// prepare empty recording dialog ("Unable to save")
int dialogTitle = R.string.dialog_error_empty_recording_title;
String dialogMessage = getString(R.string.dialog_error_empty_recording_content);
int dialogPositiveButton = R.string.dialog_error_empty_recording_action_resume;
int dialogNegativeButton = R.string.dialog_default_action_cancel;
// show empty recording dialog
DialogFragment dialogFragment = DialogHelper.newInstance(dialogTitle, dialogMessage, dialogPositiveButton, dialogNegativeButton);
dialogFragment.setTargetFragment(this, RESULT_EMPTY_RECORDING_DIALOG);
dialogFragment.show(((AppCompatActivity)mActivity).getSupportFragmentManager(), "EmptyRecordingDialog");
// results of dialog are handled by onActivityResult
}
/* Start preliminary tracking for map */ /* Start preliminary tracking for map */
private void startPreliminaryTracking() { private void startPreliminaryTracking() {
if (mLocationSystemSetting && !mLocalTrackerRunning) { if (mLocationSystemSetting && !mLocalTrackerRunning) {
@ -543,7 +508,7 @@ public class MainActivityMapFragment extends Fragment implements TrackbookKeys {
mMapView.getOverlays().remove(mMyLocationOverlay); mMapView.getOverlays().remove(mMyLocationOverlay);
// only update while not tracking // only update while not tracking
if (!mTrackerServiceRunning) { if (!mTrackerServiceRunning) {
mMyLocationOverlay = MapHelper.createMyLocationOverlay(mActivity, mCurrentBestLocation, LocationHelper.isCurrent(mCurrentBestLocation), false); mMyLocationOverlay = MapHelper.createMyLocationOverlay(mActivity, mCurrentBestLocation, LocationHelper.isNewLocation(mCurrentBestLocation));
mMapView.getOverlays().add(mMyLocationOverlay); mMapView.getOverlays().add(mMyLocationOverlay);
} }
} }
@ -553,16 +518,11 @@ public class MainActivityMapFragment extends Fragment implements TrackbookKeys {
private void drawTrackOverlay(Track track) { private void drawTrackOverlay(Track track) {
mMapView.getOverlays().remove(mTrackOverlay); mMapView.getOverlays().remove(mTrackOverlay);
mTrackOverlay = null; mTrackOverlay = null;
if (track == null || track.getSize() == 0) { if (track != null) {
LogHelper.i(LOG_TAG, "Waiting for a track. Showing preliminary location.");
mTrackOverlay = MapHelper.createMyLocationOverlay(mActivity, mCurrentBestLocation, false, mTrackerServiceRunning);
Toast.makeText(mActivity, mActivity.getString(R.string.toast_message_acquiring_location), Toast.LENGTH_LONG).show();
} else {
LogHelper.v(LOG_TAG, "Drawing track overlay."); LogHelper.v(LOG_TAG, "Drawing track overlay.");
mTrackOverlay = MapHelper.createTrackOverlay(mActivity, track, mTrackerServiceRunning); mTrackOverlay = MapHelper.createTrackOverlay(mActivity, track, mTrackerServiceRunning);
}
mMapView.getOverlays().add(mTrackOverlay); mMapView.getOverlays().add(mTrackOverlay);
}
} }

View file

@ -24,6 +24,16 @@ import android.content.IntentFilter;
import android.location.Location; import android.location.Location;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.constraint.ConstraintLayout;
import android.support.constraint.Group;
import android.support.design.widget.BottomSheetBehavior;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.content.ContextCompat;
import android.support.v4.content.LocalBroadcastManager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
@ -35,8 +45,6 @@ import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import org.osmdroid.api.IMapController; import org.osmdroid.api.IMapController;
import org.osmdroid.tileprovider.tilesource.TileSourceFactory; import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.util.GeoPoint; import org.osmdroid.util.GeoPoint;
@ -59,16 +67,6 @@ import java.io.File;
import java.text.DateFormat; import java.text.DateFormat;
import java.util.Locale; import java.util.Locale;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
/** /**
* MainActivityTrackFragment class * MainActivityTrackFragment class

View file

@ -18,12 +18,11 @@ package org.y20k.trackbook;
import android.app.Application; import android.app.Application;
import android.os.Build; import android.os.Build;
import android.support.v7.app.AppCompatDelegate;
import org.y20k.trackbook.helpers.LogHelper; import org.y20k.trackbook.helpers.LogHelper;
import org.y20k.trackbook.helpers.NightModeHelper; import org.y20k.trackbook.helpers.NightModeHelper;
import androidx.appcompat.app.AppCompatDelegate;
/** /**
* Trackbook.class * Trackbook.class

View file

@ -37,6 +37,8 @@ import android.os.CountDownTimer;
import android.os.Handler; import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.LocalBroadcastManager;
import android.widget.Toast; import android.widget.Toast;
import org.y20k.trackbook.core.Track; import org.y20k.trackbook.core.Track;
@ -48,9 +50,6 @@ import org.y20k.trackbook.helpers.TrackbookKeys;
import java.util.List; import java.util.List;
import androidx.core.app.NotificationCompat;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import static android.hardware.Sensor.TYPE_STEP_COUNTER; import static android.hardware.Sensor.TYPE_STEP_COUNTER;
@ -234,7 +233,7 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven
// load temp track file // load temp track file
mTrack = storageHelper.loadTrack(FILE_TEMP_TRACK); mTrack = storageHelper.loadTrack(FILE_TEMP_TRACK);
// try to mark last waypoint as stopover // try to mark last waypoint as stopover
int lastWayPoint = mTrack.getSize() - 1; int lastWayPoint = mTrack.getWayPoints().size() - 1;
if (lastWayPoint >= 0) { if (lastWayPoint >= 0) {
mTrack.getWayPoints().get(lastWayPoint).setIsStopOver(true); mTrack.getWayPoints().get(lastWayPoint).setIsStopOver(true);
} }
@ -395,17 +394,12 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven
boolean success = false; boolean success = false;
Location previousLocation = null; Location previousLocation = null;
int trackSize = mTrack.getSize(); int trackSize = mTrack.getWayPoints().size();
if (trackSize == 0) { if (trackSize == 0) {
// if accurate AND current
if (LocationHelper.isAccurate(mCurrentBestLocation) && LocationHelper.isCurrent(mCurrentBestLocation)) {
// add first location to track // add first location to track
success = mTrack.addWayPoint(previousLocation, mCurrentBestLocation); success = mTrack.addWayPoint(previousLocation, mCurrentBestLocation);
} else {
// just send a broadcast indicating that current location fix not not suited
broadcastTrackUpdate();
}
} else { } else {
// get location of previous WayPoint // get location of previous WayPoint
previousLocation = mTrack.getWayPointLocation(trackSize - 1); previousLocation = mTrack.getWayPointLocation(trackSize - 1);
@ -421,20 +415,17 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven
averageSpeed = distance / ((float) timeDifference / ONE_SECOND_IN_NANOSECOND); averageSpeed = distance / ((float) timeDifference / ONE_SECOND_IN_NANOSECOND);
} }
// if accurate AND new if (LocationHelper.isNewWayPoint(previousLocation, mCurrentBestLocation, averageSpeed)) {
if (LocationHelper.isAccurate(mCurrentBestLocation) && LocationHelper.isNewWayPoint(previousLocation, mCurrentBestLocation, averageSpeed)) { // if new, add current best location to track
// add current best location to track
success = mTrack.addWayPoint(previousLocation, mCurrentBestLocation); success = mTrack.addWayPoint(previousLocation, mCurrentBestLocation);
} }
} }
if (success) { if (success) {
if (mResumedFlag) { if (mResumedFlag) {
int lastWayPoint = mTrack.getSize() - 2;
if (lastWayPoint >= 0) {
// mark last location as stop over // mark last location as stop over
int lastWayPoint = mTrack.getWayPoints().size() - 2;
mTrack.getWayPoints().get(lastWayPoint).setIsStopOver(true); mTrack.getWayPoints().get(lastWayPoint).setIsStopOver(true);
}
mResumedFlag = false; mResumedFlag = false;
} else { } else {
// update distance, if not resumed // update distance, if not resumed

View file

@ -19,6 +19,7 @@ package org.y20k.trackbook.core;
import android.location.Location; import android.location.Location;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.support.annotation.Nullable;
import org.y20k.trackbook.helpers.LocationHelper; import org.y20k.trackbook.helpers.LocationHelper;
import org.y20k.trackbook.helpers.TrackbookKeys; import org.y20k.trackbook.helpers.TrackbookKeys;
@ -28,8 +29,6 @@ import java.util.Date;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
import java.util.List; import java.util.List;
import androidx.annotation.Nullable;
/** /**
* Track class * Track class
@ -276,12 +275,7 @@ public class Track implements TrackbookKeys, Parcelable {
/* Getter recorded distance */ /* Getter recorded distance */
public Double getTrackDistance() { public Double getTrackDistance() {
int size = mWayPoints.size(); return (double) mWayPoints.get(mWayPoints.size()-1).getDistanceToStartingPoint();
if (size > 0) {
return (double)mWayPoints.get(size - 1).getDistanceToStartingPoint();
} else {
return (double)0f;
}
} }

View file

@ -21,9 +21,8 @@ import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull; import android.support.v4.app.DialogFragment;
import androidx.fragment.app.DialogFragment;
/** /**

View file

@ -20,6 +20,8 @@ package org.y20k.trackbook.helpers;
import android.app.Activity; import android.app.Activity;
import android.content.res.Resources; import android.content.res.Resources;
import android.database.DataSetObserver; import android.database.DataSetObserver;
import android.support.annotation.Nullable;
import android.support.v7.widget.ThemedSpinnerAdapter;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -33,9 +35,6 @@ import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.ThemedSpinnerAdapter;
/** /**
* DropdownHelper class * DropdownHelper class
@ -176,10 +175,8 @@ public class DropdownAdapter extends BaseAdapter implements ThemedSpinnerAdapter
// fill list with track bundles // fill list with track bundles
mTrackBundleList = new ArrayList<>(); mTrackBundleList = new ArrayList<>();
for (File file : files) { for (File file : files) {
if (file.getName().endsWith(FILE_TYPE_TRACKBOOK_EXTENSION)) {
mTrackBundleList.add(new TrackBundle(file)); mTrackBundleList.add(new TrackBundle(file));
} }
}
} }

View file

@ -20,6 +20,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.location.Location; import android.location.Location;
import android.os.Environment; import android.os.Environment;
import android.support.v4.content.FileProvider;
import android.widget.Toast; import android.widget.Toast;
import org.y20k.trackbook.R; import org.y20k.trackbook.R;
@ -36,8 +37,6 @@ import java.util.Date;
import java.util.Locale; import java.util.Locale;
import java.util.TimeZone; import java.util.TimeZone;
import androidx.core.content.FileProvider;
/** /**
* ExportHelper class * ExportHelper class
*/ */

View file

@ -22,13 +22,12 @@ import android.location.LocationListener;
import android.location.LocationManager; import android.location.LocationManager;
import android.os.SystemClock; import android.os.SystemClock;
import android.provider.Settings; import android.provider.Settings;
import android.support.annotation.Nullable;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import androidx.annotation.Nullable;
/** /**
* LocationHelper class * LocationHelper class
@ -94,8 +93,8 @@ public final class LocationHelper implements TrackbookKeys {
// check whether the new location fix is newer or older // check whether the new location fix is newer or older
long timeDelta = location.getElapsedRealtimeNanos() - currentBestLocation.getElapsedRealtimeNanos(); long timeDelta = location.getElapsedRealtimeNanos() - currentBestLocation.getElapsedRealtimeNanos();
boolean isSignificantlyNewer = timeDelta > ONE_MINUTE_IN_NANOSECONDS; boolean isSignificantlyNewer = timeDelta > TWO_MINUTES_IN_NANOSECONDS;
boolean isSignificantlyOlder = timeDelta < -ONE_MINUTE_IN_NANOSECONDS; boolean isSignificantlyOlder = timeDelta < -TWO_MINUTES_IN_NANOSECONDS;
boolean isNewer = timeDelta > 0; boolean isNewer = timeDelta > 0;
// if it's been more than two minutes since the current location, use the new location because the user has likely moved // if it's been more than two minutes since the current location, use the new location because the user has likely moved
@ -126,19 +125,13 @@ public final class LocationHelper implements TrackbookKeys {
} }
/* Checks accuracy of given location */
public static boolean isAccurate(Location location) {
return location.getAccuracy() < FIFTY_METER_RADIUS;
}
/* Checks if given location is newer than two minutes */ /* Checks if given location is newer than two minutes */
public static boolean isCurrent(Location location) { public static boolean isNewLocation(Location location) {
if (location == null) { if (location == null) {
return false; return false;
} else { } else {
long locationAge = SystemClock.elapsedRealtimeNanos() - location.getElapsedRealtimeNanos(); long locationAge = SystemClock.elapsedRealtimeNanos() - location.getElapsedRealtimeNanos();
return locationAge < ONE_MINUTE_IN_NANOSECONDS; return locationAge < TWO_MINUTES_IN_NANOSECONDS;
} }
} }

View file

@ -19,6 +19,7 @@ package org.y20k.trackbook.helpers;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.location.Location; import android.location.Location;
import android.support.v4.content.ContextCompat;
import android.widget.Toast; import android.widget.Toast;
import org.osmdroid.util.GeoPoint; import org.osmdroid.util.GeoPoint;
@ -33,8 +34,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import androidx.core.content.ContextCompat;
/** /**
* MapHelper class * MapHelper class
*/ */
@ -45,20 +44,17 @@ public final class MapHelper {
/* Creates icon overlay for current position (used in MainActivity Fragment) */ /* Creates icon overlay for current position (used in MainActivity Fragment) */
public static ItemizedIconOverlay createMyLocationOverlay(final Context context, Location currentBestLocation, boolean locationIsNew, boolean trackingActive) { public static ItemizedIconOverlay createMyLocationOverlay(final Context context, Location currentBestLocation, boolean locationIsNew) {
final ArrayList<OverlayItem> overlayItems = new ArrayList<>(); final ArrayList<OverlayItem> overlayItems = new ArrayList<>();
// create marker // create marker
Drawable newMarker; Drawable newMarker;
if (locationIsNew && !trackingActive) { if (locationIsNew) {
newMarker = ContextCompat.getDrawable(context, R.drawable.ic_my_location_dot_blue_24dp); newMarker = ContextCompat.getDrawable(context, R.drawable.ic_my_location_dot_blue_24dp);
} else if (!locationIsNew && trackingActive) {
newMarker = ContextCompat.getDrawable(context, R.drawable.ic_my_location_dot_red_grey_24dp);
} else { } else {
newMarker = ContextCompat.getDrawable(context, R.drawable.ic_my_location_dot_blue_grey_24dp); newMarker = ContextCompat.getDrawable(context, R.drawable.ic_my_location_dot_grey_24dp);
} }
OverlayItem overlayItem = createOverlayItem(context, currentBestLocation); OverlayItem overlayItem = createOverlayItem(context, currentBestLocation);
overlayItem.setMarker(newMarker); overlayItem.setMarker(newMarker);
@ -87,14 +83,13 @@ public final class MapHelper {
/* Creates icon overlay for track */ /* Creates icon overlay for track */
public static ItemizedIconOverlay createTrackOverlay(final Context context, Track track, boolean trackingActive){ public static ItemizedIconOverlay createTrackOverlay(final Context context, Track track, boolean trackingActive){
final ArrayList<OverlayItem> overlayItems = new ArrayList<>(); WayPoint wayPoint;
boolean currentPosition; boolean currentPosition;
final int trackSize = track.getSize(); final int trackSize = track.getSize();
final List<WayPoint> wayPoints = track.getWayPoints(); final List<WayPoint> wayPoints = track.getWayPoints();
WayPoint wayPoint; final ArrayList<OverlayItem> overlayItems = new ArrayList<>();
for (int i = 0; i < track.getSize(); i++) {
for (int i = 0 ; i < track.getSize() ; i++) {
// get WayPoint and check if it is current position // get WayPoint and check if it is current position
wayPoint = wayPoints.get(i); wayPoint = wayPoints.get(i);
currentPosition = i == trackSize - 1; currentPosition = i == trackSize - 1;
@ -117,7 +112,7 @@ public final class MapHelper {
else if (trackingActive && currentPosition) { else if (trackingActive && currentPosition) {
if (wayPoint.getIsStopOver()) { if (wayPoint.getIsStopOver()) {
// stop over marker // stop over marker
newMarker = ContextCompat.getDrawable(context, R.drawable.ic_my_location_dot_blue_grey_24dp); newMarker = ContextCompat.getDrawable(context, R.drawable.ic_my_location_dot_grey_24dp);
} else { } else {
// default marker for this case // default marker for this case
newMarker = ContextCompat.getDrawable(context, R.drawable.ic_my_location_dot_red_24dp); newMarker = ContextCompat.getDrawable(context, R.drawable.ic_my_location_dot_red_24dp);

View file

@ -22,10 +22,9 @@ import android.content.SharedPreferences;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.os.Build; import android.os.Build;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatDelegate;
import android.view.View; import android.view.View;
import androidx.appcompat.app.AppCompatDelegate;
/** /**
* NightModeHelper class * NightModeHelper class

View file

@ -26,16 +26,15 @@ import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.os.Build; import android.os.Build;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.TaskStackBuilder;
import org.y20k.trackbook.MainActivity; import org.y20k.trackbook.MainActivity;
import org.y20k.trackbook.R; import org.y20k.trackbook.R;
import org.y20k.trackbook.TrackerService; import org.y20k.trackbook.TrackerService;
import org.y20k.trackbook.core.Track; import org.y20k.trackbook.core.Track;
import androidx.core.app.NotificationCompat;
import androidx.core.app.TaskStackBuilder;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
/** /**
* NotificationHelper class * NotificationHelper class

View file

@ -18,6 +18,8 @@ package org.y20k.trackbook.helpers;
import android.content.Context; import android.content.Context;
import android.os.Environment; import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v4.os.EnvironmentCompat;
import android.widget.Toast; import android.widget.Toast;
import com.google.gson.Gson; import com.google.gson.Gson;
@ -40,9 +42,6 @@ import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
import androidx.annotation.Nullable;
import androidx.core.os.EnvironmentCompat;
/** /**
* StorageHelper class * StorageHelper class

View file

@ -75,21 +75,23 @@ public interface TrackbookKeys {
int FRAGMENT_ID_MAP = 0; int FRAGMENT_ID_MAP = 0;
int FRAGMENT_ID_TRACKS = 1; int FRAGMENT_ID_TRACKS = 1;
String FRAGMENT_TAG_MAP = "fragmentTagMap";
String FRAGMENT_TAG_TRACKS = "fragmentTagTracks";
/* RESULTS */ /* RESULTS */
int RESULT_SAVE_DIALOG = 1; int RESULT_SAVE_DIALOG = 1;
int RESULT_CLEAR_DIALOG = 2; int RESULT_CLEAR_DIALOG = 2;
int RESULT_DELETE_DIALOG = 3; int RESULT_DELETE_DIALOG = 3;
int RESULT_EXPORT_DIALOG = 4; int RESULT_EXPORT_DIALOG = 4;
int RESULT_EMPTY_RECORDING_DIALOG = 5;
/* CONSTANTS */ /* CONSTANTS */
long ONE_SECOND_IN_NANOSECOND = 1000000000L; long ONE_SECOND_IN_NANOSECOND = 1000000000L;
long EIGHT_HOURS_IN_MILLISECONDS = 43200000; // maximum tracking duration long EIGHT_HOURS_IN_MILLISECONDS = 43200000; // maximum tracking duration
long FIFTEEN_SECONDS_IN_MILLISECONDS = 15000; // timer interval for tracking long FIFTEEN_SECONDS_IN_MILLISECONDS = 15000; // timer interval for tracking
long FIVE_MINUTES_IN_NANOSECONDS = 5L * 60000000000L; // determines a stop over long FIVE_MINUTES_IN_NANOSECONDS = 5L * 60000000000L; // determines a stop over
long ONE_MINUTE_IN_NANOSECONDS = 1L * 60000000000L; // defines an old location long TWO_MINUTES_IN_NANOSECONDS = 2L * 60000000000L; // defines an old location
int MAXIMUM_TRACK_FILES = 25; int MAXIMUM_TRACK_FILES = 25;
int FIFTY_METER_RADIUS = 50;
/* FILE */ /* FILE */
String FILE_TYPE_GPX_EXTENSION = ".gpx"; String FILE_TYPE_GPX_EXTENSION = ".gpx";

View file

@ -18,13 +18,11 @@
package org.y20k.trackbook.layout; package org.y20k.trackbook.layout;
import android.content.Context; import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View; import android.view.View;
import com.google.android.material.snackbar.Snackbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
/** /**
* DodgeAbleLayoutBehavior class * DodgeAbleLayoutBehavior class

View file

@ -22,6 +22,7 @@ package org.y20k.trackbook.layout;
*/ */
import android.content.Context; import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.animation.DecelerateInterpolator; import android.view.animation.DecelerateInterpolator;
@ -31,8 +32,6 @@ import org.y20k.trackbook.helpers.LogHelper;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import androidx.viewpager.widget.ViewPager;
public class NonSwipeableViewPager extends ViewPager { public class NonSwipeableViewPager extends ViewPager {

View file

@ -1,13 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:viewportHeight="96.0"
android:viewportWidth="96.0"
android:width="24dp">
<path
android:fillAlpha="0.33"
android:fillColor="@color/trackbook_blue"
android:pathData="M48,48m-48,0a48,48 0,1 1,96 0a48,48 0,1 1,-96 0"/>
<path
android:fillColor="@color/trackbook_grey_light"
android:pathData="M48,48m-24,0a24,24 0,1 1,48 0a24,24 0,1 1,-48 0"/>
</vector>

View file

@ -1,13 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:viewportHeight="96.0"
android:viewportWidth="96.0"
android:width="24dp">
<path
android:fillAlpha="0.33"
android:fillColor="@color/trackbook_red"
android:pathData="M48,48m-48,0a48,48 0,1 1,96 0a48,48 0,1 1,-96 0"/>
<path
android:fillColor="@color/trackbook_grey_light"
android:pathData="M48,48m-24,0a24,24 0,1 1,48 0a24,24 0,1 1,-48 0"/>
</vector>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -8,14 +8,14 @@
tools:context="org.y20k.trackbook.MainActivity"> tools:context="org.y20k.trackbook.MainActivity">
<androidx.constraintlayout.widget.ConstraintLayout <android.support.constraint.ConstraintLayout
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<!-- BUTTON MY LOCATION --> <!-- BUTTON MY LOCATION -->
<com.google.android.material.floatingactionbutton.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/fabLocationButton" android:id="@+id/fabLocationButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -32,7 +32,7 @@
<!-- SAVE RESUME --> <!-- SAVE RESUME -->
<com.google.android.material.floatingactionbutton.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/fabSubMenuButtonSave" android:id="@+id/fabSubMenuButtonSave"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -47,7 +47,7 @@
app:layout_constraintStart_toStartOf="@+id/fabSubMenuButtonClear" app:layout_constraintStart_toStartOf="@+id/fabSubMenuButtonClear"
app:srcCompat="@drawable/ic_save_white_24dp" /> app:srcCompat="@drawable/ic_save_white_24dp" />
<androidx.cardview.widget.CardView <android.support.v7.widget.CardView
android:id="@+id/fabSubMenuLabelSave" android:id="@+id/fabSubMenuLabelSave"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -75,11 +75,11 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@color/fab_button_card_text" android:textColor="@color/fab_button_card_text"
android:textStyle="bold" /> android:textStyle="bold" />
</androidx.cardview.widget.CardView> </android.support.v7.widget.CardView>
<!-- BUTTON CLEAR --> <!-- BUTTON CLEAR -->
<com.google.android.material.floatingactionbutton.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/fabSubMenuButtonClear" android:id="@+id/fabSubMenuButtonClear"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -94,7 +94,7 @@
app:layout_constraintStart_toStartOf="@+id/fabSubMenuButtonResume" app:layout_constraintStart_toStartOf="@+id/fabSubMenuButtonResume"
app:srcCompat="@drawable/ic_clear_white_24dp" /> app:srcCompat="@drawable/ic_clear_white_24dp" />
<androidx.cardview.widget.CardView <android.support.v7.widget.CardView
android:id="@+id/fabSubMenuLabelClear" android:id="@+id/fabSubMenuLabelClear"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -122,11 +122,11 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@color/fab_button_card_text" android:textColor="@color/fab_button_card_text"
android:textStyle="bold" /> android:textStyle="bold" />
</androidx.cardview.widget.CardView> </android.support.v7.widget.CardView>
<!-- BUTTON RESUME --> <!-- BUTTON RESUME -->
<com.google.android.material.floatingactionbutton.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/fabSubMenuButtonResume" android:id="@+id/fabSubMenuButtonResume"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -141,7 +141,7 @@
app:layout_constraintStart_toStartOf="@+id/fabMainButton" app:layout_constraintStart_toStartOf="@+id/fabMainButton"
app:srcCompat="@drawable/ic_fiber_manual_record_white_24dp" /> app:srcCompat="@drawable/ic_fiber_manual_record_white_24dp" />
<androidx.cardview.widget.CardView <android.support.v7.widget.CardView
android:id="@+id/fabSubMenuLabelResume" android:id="@+id/fabSubMenuLabelResume"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -168,11 +168,11 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@color/fab_button_card_text" android:textColor="@color/fab_button_card_text"
android:textStyle="bold" /> android:textStyle="bold" />
</androidx.cardview.widget.CardView> </android.support.v7.widget.CardView>
<!-- MAIN BUTTON --> <!-- MAIN BUTTON -->
<com.google.android.material.floatingactionbutton.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/fabMainButton" android:id="@+id/fabMainButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -189,7 +189,7 @@
<!-- BOTTOM NAVIGATION --> <!-- BOTTOM NAVIGATION -->
<com.google.android.material.bottomnavigation.BottomNavigationView <android.support.design.widget.BottomNavigationView
android:id="@+id/navigation" android:id="@+id/navigation"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -214,9 +214,9 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout <android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
@ -29,7 +29,7 @@
</RelativeLayout> </RelativeLayout>
<!-- BOTTOM SHEET --> <!-- BOTTOM SHEET -->
<androidx.core.widget.NestedScrollView <android.support.v4.widget.NestedScrollView
android:id="@+id/statistics_sheet" android:id="@+id/statistics_sheet"
android:layout_width="@dimen/bottom_sheet_width" android:layout_width="@dimen/bottom_sheet_width"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -37,7 +37,7 @@
android:background="@color/statistic_sheet_background_collapsed" android:background="@color/statistic_sheet_background_collapsed"
app:behavior_hideable="false" app:behavior_hideable="false"
app:behavior_peekHeight="54dp" app:behavior_peekHeight="54dp"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -48,6 +48,6 @@
</ScrollView> </ScrollView>
</androidx.core.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/track_management_layout" android:id="@+id/track_management_layout"
android:layout_width="@dimen/bottom_sheet_width" android:layout_width="@dimen/bottom_sheet_width"
@ -27,7 +27,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:backgroundTint="@color/trackbook_transparent" android:backgroundTint="@color/trackbook_transparent"
android:contentDescription="@string/descr_share_button_gpx"
app:layout_constraintBottom_toBottomOf="@+id/track_selector" app:layout_constraintBottom_toBottomOf="@+id/track_selector"
app:layout_constraintEnd_toStartOf="@+id/export_button" app:layout_constraintEnd_toStartOf="@+id/export_button"
app:layout_constraintTop_toTopOf="@+id/track_selector" app:layout_constraintTop_toTopOf="@+id/track_selector"
@ -58,4 +57,4 @@
app:srcCompat="@drawable/ic_delete_forever_24dp" /> app:srcCompat="@drawable/ic_delete_forever_24dp" />
</androidx.constraintlayout.widget.ConstraintLayout> </android.support.constraint.ConstraintLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/statistics_view" android:id="@+id/statistics_view"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -7,13 +7,13 @@
android:clickable="true" android:clickable="true"
android:focusable="true"> android:focusable="true">
<androidx.constraintlayout.widget.Group <android.support.constraint.Group
android:id="@+id/elevation_data" android:id="@+id/elevation_data"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:constraint_referenced_ids="statistics_p_positive_elevation, statistics_data_positive_elevation, statistics_p_negative_elevation, statistics_data_negative_elevation, statistics_p_max_altitude, statistics_data_max_altitude, statistics_p_min_altitude, statistics_data_min_altitude" /> app:constraint_referenced_ids="statistics_p_positive_elevation, statistics_data_positive_elevation, statistics_p_negative_elevation, statistics_data_negative_elevation, statistics_p_max_altitude, statistics_data_max_altitude, statistics_p_min_altitude, statistics_data_min_altitude" />
<androidx.constraintlayout.widget.Group <android.support.constraint.Group
android:id="@+id/statistics_header" android:id="@+id/statistics_header"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -294,4 +294,4 @@
app:layout_constraintStart_toEndOf="@+id/statistics_p_min_altitude" app:layout_constraintStart_toEndOf="@+id/statistics_p_min_altitude"
app:layout_constraintTop_toTopOf="@+id/statistics_p_min_altitude" /> app:layout_constraintTop_toTopOf="@+id/statistics_p_min_altitude" />
</androidx.constraintlayout.widget.ConstraintLayout> </android.support.constraint.ConstraintLayout>

View file

@ -45,9 +45,6 @@
<string name="dialog_export_content_overwrite">Datei existiert bereits. Exportieren und überschreiben Sie diese Aufzeichnung als GPX-Strecke.</string> <string name="dialog_export_content_overwrite">Datei existiert bereits. Exportieren und überschreiben Sie diese Aufzeichnung als GPX-Strecke.</string>
<string name="dialog_export_action_overwrite">Exportieren und überschreiben</string> <string name="dialog_export_action_overwrite">Exportieren und überschreiben</string>
<string name="dialog_share_gpx">GPX-Datei öffnen mit</string> <string name="dialog_share_gpx">GPX-Datei öffnen mit</string>
<string name="dialog_error_empty_recording_title">Speichern nicht möglich</string>
<string name="dialog_error_empty_recording_content">Trackbook hat noch keine Wegpunkte aufgezeichnet.</string>
<string name="dialog_error_empty_recording_action_resume">Aufzeichnung fortsetzen</string>
<!-- toast messages --> <!-- toast messages -->
<string name="toast_message_permissions_granted">Berechtigungen erteilt.</string> <string name="toast_message_permissions_granted">Berechtigungen erteilt.</string>
@ -134,6 +131,5 @@
<string name="descr_track_selector">Auswahl-Menü für weitere Aufzeichnungen</string> <string name="descr_track_selector">Auswahl-Menü für weitere Aufzeichnungen</string>
<string name="descr_export_button">Schaltfläche „Aufzeichnung exportieren”</string> <string name="descr_export_button">Schaltfläche „Aufzeichnung exportieren”</string>
<string name="descr_delete_button">Schaltfläche „Aufzeichnung löschen”</string> <string name="descr_delete_button">Schaltfläche „Aufzeichnung löschen”</string>
<string name="descr_share_button_gpx">Share button that offers to export as GPX</string>
</resources> </resources>

View file

@ -45,9 +45,6 @@
<string name="dialog_export_content_overwrite">File already exists. Export and overwrite this recording as GPX track.</string> <string name="dialog_export_content_overwrite">File already exists. Export and overwrite this recording as GPX track.</string>
<string name="dialog_export_action_overwrite">Export and Overwrite</string> <string name="dialog_export_action_overwrite">Export and Overwrite</string>
<string name="dialog_share_gpx">Share GPX file with</string> <string name="dialog_share_gpx">Share GPX file with</string>
<string name="dialog_error_empty_recording_title">Unable to save</string>
<string name="dialog_error_empty_recording_content">Trackbook did not record any waypoints so far.</string>
<string name="dialog_error_empty_recording_action_resume">Resume Recording</string>
<!-- toast messages --> <!-- toast messages -->
<string name="toast_message_permissions_granted">Permissions granted.</string> <string name="toast_message_permissions_granted">Permissions granted.</string>
@ -134,6 +131,5 @@
<string name="descr_track_selector">Dropdown menu for further tracks</string> <string name="descr_track_selector">Dropdown menu for further tracks</string>
<string name="descr_export_button">Track export button</string> <string name="descr_export_button">Track export button</string>
<string name="descr_delete_button">Track delete button</string> <string name="descr_delete_button">Track delete button</string>
<string name="descr_share_button_gpx">Share button that offers to export as GPX</string>
</resources> </resources>

View file

@ -45,9 +45,6 @@
<string name="dialog_export_content_overwrite">Il file esiste già. Esportare e sovrascrivere questa registrazione come traccia GPX.</string> <string name="dialog_export_content_overwrite">Il file esiste già. Esportare e sovrascrivere questa registrazione come traccia GPX.</string>
<string name="dialog_export_action_overwrite">Esporta e sovrascrivi</string> <string name="dialog_export_action_overwrite">Esporta e sovrascrivi</string>
<string name="dialog_share_gpx">Share GPX file with</string> <string name="dialog_share_gpx">Share GPX file with</string>
<string name="dialog_error_empty_recording_title">Unable to save</string>
<string name="dialog_error_empty_recording_content">Trackbook did not record any waypoints so far.</string>
<string name="dialog_error_empty_recording_action_resume">Resume Recording</string>
<!-- toast messages --> <!-- toast messages -->
<string name="toast_message_permissions_granted">Permessi acquisiti.</string> <string name="toast_message_permissions_granted">Permessi acquisiti.</string>
@ -134,6 +131,5 @@
<string name="descr_track_selector">Elenco registrazioni</string> <string name="descr_track_selector">Elenco registrazioni</string>
<string name="descr_export_button">Pulsante di esportazione della traccia</string> <string name="descr_export_button">Pulsante di esportazione della traccia</string>
<string name="descr_delete_button">Pulsante di eliminazione della traccia</string> <string name="descr_delete_button">Pulsante di eliminazione della traccia</string>
<string name="descr_share_button_gpx">Share button that offers to export as GPX</string>
</resources> </resources>

View file

@ -45,9 +45,6 @@
<string name="dialog_export_content_overwrite">ファイルは既に存在します。エクスポートし、GPX トラックとしてこの記録を上書きします。</string> <string name="dialog_export_content_overwrite">ファイルは既に存在します。エクスポートし、GPX トラックとしてこの記録を上書きします。</string>
<string name="dialog_export_action_overwrite">エクスポートして上書き</string> <string name="dialog_export_action_overwrite">エクスポートして上書き</string>
<string name="dialog_share_gpx">Share GPX file with</string> <string name="dialog_share_gpx">Share GPX file with</string>
<string name="dialog_error_empty_recording_title">Unable to save</string>
<string name="dialog_error_empty_recording_content">Trackbook did not record any waypoints so far.</string>
<string name="dialog_error_empty_recording_action_resume">Resume Recording</string>
<!-- toast messages --> <!-- toast messages -->
<string name="toast_message_permissions_granted">アクセス許可を付与しました。</string> <string name="toast_message_permissions_granted">アクセス許可を付与しました。</string>
@ -134,6 +131,5 @@
<string name="descr_track_selector">ドロップダウン メニューでさらにトレース</string> <string name="descr_track_selector">ドロップダウン メニューでさらにトレース</string>
<string name="descr_export_button">トラックのエクスポート ボタン</string> <string name="descr_export_button">トラックのエクスポート ボタン</string>
<string name="descr_delete_button">トレース削除ボタン</string> <string name="descr_delete_button">トレース削除ボタン</string>
<string name="descr_share_button_gpx">Share button that offers to export as GPX</string>
</resources> </resources>

View file

@ -45,9 +45,6 @@
<string name="dialog_export_content_overwrite">Fila finnes allerede. Eksporter og overskriv dette opptaket som en GPX-tur.</string> <string name="dialog_export_content_overwrite">Fila finnes allerede. Eksporter og overskriv dette opptaket som en GPX-tur.</string>
<string name="dialog_export_action_overwrite">Eksporter og overskriv</string> <string name="dialog_export_action_overwrite">Eksporter og overskriv</string>
<string name="dialog_share_gpx">Share GPX file with</string> <string name="dialog_share_gpx">Share GPX file with</string>
<string name="dialog_error_empty_recording_title">Unable to save</string>
<string name="dialog_error_empty_recording_content">Trackbook did not record any waypoints so far.</string>
<string name="dialog_error_empty_recording_action_resume">Resume Recording</string>
<!-- toast messages --> <!-- toast messages -->
<string name="toast_message_permissions_granted">Tilgang gitt.</string> <string name="toast_message_permissions_granted">Tilgang gitt.</string>
@ -134,6 +131,5 @@
<string name="descr_track_selector">Nedtrekksmeny for ytterligere turer</string> <string name="descr_track_selector">Nedtrekksmeny for ytterligere turer</string>
<string name="descr_export_button">Tureksportknapp</string> <string name="descr_export_button">Tureksportknapp</string>
<string name="descr_delete_button">Turslettingsknapp</string> <string name="descr_delete_button">Turslettingsknapp</string>
<string name="descr_share_button_gpx">Share button that offers to export as GPX</string>
</resources> </resources>

View file

@ -45,9 +45,6 @@
<string name="dialog_export_content_overwrite">File already exists. Export and overwrite this recording as GPX track.</string> <string name="dialog_export_content_overwrite">File already exists. Export and overwrite this recording as GPX track.</string>
<string name="dialog_export_action_overwrite">Export and Overwrite</string> <string name="dialog_export_action_overwrite">Export and Overwrite</string>
<string name="dialog_share_gpx">Share GPX file with</string> <string name="dialog_share_gpx">Share GPX file with</string>
<string name="dialog_error_empty_recording_title">Unable to save</string>
<string name="dialog_error_empty_recording_content">Trackbook did not record any waypoints so far.</string>
<string name="dialog_error_empty_recording_action_resume">Resume Recording</string>
<!-- toast messages --> <!-- toast messages -->
<string name="toast_message_permissions_granted">Rechten verleend.</string> <string name="toast_message_permissions_granted">Rechten verleend.</string>
@ -134,6 +131,5 @@
<string name="descr_track_selector">Uitrolmenu voor verdere banen</string> <string name="descr_track_selector">Uitrolmenu voor verdere banen</string>
<string name="descr_export_button">Track export button</string> <string name="descr_export_button">Track export button</string>
<string name="descr_delete_button">Baan - verwijderknop</string> <string name="descr_delete_button">Baan - verwijderknop</string>
<string name="descr_share_button_gpx">Share button that offers to export as GPX</string>
</resources> </resources>

View file

@ -45,9 +45,6 @@
<string name="dialog_export_content_overwrite">File already exists. Export and overwrite this recording as GPX track.</string> <string name="dialog_export_content_overwrite">File already exists. Export and overwrite this recording as GPX track.</string>
<string name="dialog_export_action_overwrite">Export and Overwrite</string> <string name="dialog_export_action_overwrite">Export and Overwrite</string>
<string name="dialog_share_gpx">Share GPX file with</string> <string name="dialog_share_gpx">Share GPX file with</string>
<string name="dialog_error_empty_recording_title">Unable to save</string>
<string name="dialog_error_empty_recording_content">Trackbook did not record any waypoints so far.</string>
<string name="dialog_error_empty_recording_action_resume">Resume Recording</string>
<!-- toast messages --> <!-- toast messages -->
<string name="toast_message_permissions_granted">Permissions granted.</string> <string name="toast_message_permissions_granted">Permissions granted.</string>
@ -134,6 +131,5 @@
<string name="descr_track_selector">Dropdown menu for further tracks</string> <string name="descr_track_selector">Dropdown menu for further tracks</string>
<string name="descr_export_button">Track export button</string> <string name="descr_export_button">Track export button</string>
<string name="descr_delete_button">Track delete button</string> <string name="descr_delete_button">Track delete button</string>
<string name="descr_share_button_gpx">Share button that offers to export as GPX</string>
</resources> </resources>

View file

@ -1,42 +1,35 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
repositories { repositories {
jcenter() jcenter()
google() google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }
} }
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter() jcenter()
} }
project.ext { project.ext {
applicationId = 'org.y20k.trackbook' applicationId = 'org.y20k.trackbook'
versionCode = 27 versionCode = 28
versionName = '1.1.11' versionName = '1.1.12'
compileSdkVersion = 28
targetSdkVersion = 27
minSdkVersion = 22 minSdkVersion = 22
compileSdkVersion = 27
targetSdkVersion = 27
buildToolsVersion = '27.0.3'
supportLibraryVersion = '27.1.1'
constraintLayoutVersion = '1.1.0-beta6'
constraintlayoutVersion = '1.1.3' osmdroidVersion = '6.0.1'
materialVersion = "1.0.0"
appcompatVersion = '1.0.0'
cardviewVersion = '1.0.0'
osmdroidVersion = '6.0.2'
gsonVersion = '2.8.5' gsonVersion = '2.8.5'
} }
} }

View file

@ -16,5 +16,3 @@
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true # org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true

View file

@ -1,6 +1,6 @@
#Thu Oct 04 08:52:03 CEST 2018 #Wed Apr 04 15:52:45 CEST 2018
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip