ui refresh - part 1
This commit is contained in:
parent
2e4149c7ee
commit
ca887bdb21
28 changed files with 529 additions and 736 deletions
|
@ -17,6 +17,7 @@ android {
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
|
shrinkResources true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +28,7 @@ dependencies {
|
||||||
compile 'com.android.support:appcompat-v7:' + supportLibraryVersion
|
compile 'com.android.support:appcompat-v7:' + supportLibraryVersion
|
||||||
compile 'com.android.support:design:' + supportLibraryVersion
|
compile 'com.android.support:design:' + supportLibraryVersion
|
||||||
compile 'com.android.support:cardview-v7:' + supportLibraryVersion
|
compile 'com.android.support:cardview-v7:' + supportLibraryVersion
|
||||||
|
compile 'com.android.support.constraint:constraint-layout:' + constraintLayoutVersion
|
||||||
compile 'org.osmdroid:osmdroid-android:' + osmdroidVersion
|
compile 'org.osmdroid:osmdroid-android:' + osmdroidVersion
|
||||||
compile 'com.google.code.gson:gson:' + gsonVersion
|
compile 'com.google.code.gson:gson:' + gsonVersion
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/TrackbookAppTheme.NoActionBar"
|
android:theme="@style/TrackbookAppTheme"
|
||||||
android:resizeableActivity="true"
|
android:resizeableActivity="true"
|
||||||
android:launchMode="singleTop">
|
android:launchMode="singleTop">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
@ -34,24 +34,7 @@
|
||||||
<!-- TODO App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent filter. See issue explanation for more details. -->
|
<!-- TODO App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent filter. See issue explanation for more details. -->
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
<!-- TRACKER SERVICE -->
|
||||||
<!-- INFOSHEET ACTIVITY -->
|
|
||||||
<activity
|
|
||||||
android:name=".InfosheetActivity"
|
|
||||||
android:label="@string/title_activity_infosheet"
|
|
||||||
android:parentActivityName=".MainActivity"
|
|
||||||
android:resizeableActivity="true"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout">
|
|
||||||
|
|
||||||
|
|
||||||
<meta-data
|
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
|
||||||
android:value="org.y20k.trackbook.MainActivity" />
|
|
||||||
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- PLAYER SERVICE -->
|
|
||||||
<service
|
<service
|
||||||
android:name=".TrackerService"
|
android:name=".TrackerService"
|
||||||
android:exported="false">
|
android:exported="false">
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
/**
|
|
||||||
* InfosheetActivity.java
|
|
||||||
* Implements the app's infosheet activity
|
|
||||||
* The infosheet activity sets up infosheet screens for "About"
|
|
||||||
*
|
|
||||||
* This file is part of
|
|
||||||
* TRACKBOOK - Movement Recorder for Android
|
|
||||||
*
|
|
||||||
* Copyright (c) 2016-17 - Y20K.org
|
|
||||||
* Licensed under the MIT-License
|
|
||||||
* http://opensource.org/licenses/MIT
|
|
||||||
*
|
|
||||||
* Trackbook uses osmdroid - OpenStreetMap-Tools for Android
|
|
||||||
* https://github.com/osmdroid/osmdroid
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
package org.y20k.trackbook;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import org.y20k.trackbook.helpers.TrackbookKeys;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* InfosheetActivity class
|
|
||||||
*/
|
|
||||||
public final class InfosheetActivity extends AppCompatActivity implements TrackbookKeys {
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
// get activity title from intent
|
|
||||||
Intent intent = this.getIntent();
|
|
||||||
|
|
||||||
// set activity title
|
|
||||||
if (intent.hasExtra(EXTRA_INFOSHEET_TITLE)) {
|
|
||||||
this.setTitle(intent.getStringExtra(EXTRA_INFOSHEET_TITLE));
|
|
||||||
}
|
|
||||||
|
|
||||||
// set activity view
|
|
||||||
if (intent.hasExtra(EXTRA_INFOSHEET_CONTENT) && intent.getIntExtra(EXTRA_INFOSHEET_CONTENT, -1) == INFOSHEET_CONTENT_ABOUT) {
|
|
||||||
setContentView(R.layout.activity_infosheet_about);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* MainActivity.java
|
* MainActivity.java
|
||||||
* Implements the app's main activity
|
* Implements the app's main activity
|
||||||
* The main activity sets up the main view end inflates a menu bar menu
|
* The main activity sets up the main view
|
||||||
*
|
*
|
||||||
* This file is part of
|
* This file is part of
|
||||||
* TRACKBOOK - Movement Recorder for Android
|
* TRACKBOOK - Movement Recorder for Android
|
||||||
|
@ -31,33 +31,24 @@ import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.annotation.NonNull;
|
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.FloatingActionButton;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.design.widget.TabLayout;
|
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentManager;
|
|
||||||
import android.support.v4.app.FragmentPagerAdapter;
|
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v4.content.LocalBroadcastManager;
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.CardView;
|
||||||
import android.util.SparseArray;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.y20k.trackbook.helpers.DialogHelper;
|
import org.y20k.trackbook.helpers.DialogHelper;
|
||||||
import org.y20k.trackbook.helpers.LogHelper;
|
import org.y20k.trackbook.helpers.LogHelper;
|
||||||
import org.y20k.trackbook.helpers.TrackbookKeys;
|
import org.y20k.trackbook.helpers.TrackbookKeys;
|
||||||
import org.y20k.trackbook.layout.NonSwipeableViewPager;
|
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -74,15 +65,17 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
|
|
||||||
|
|
||||||
/* Main class variables */
|
/* Main class variables */
|
||||||
private SectionsPagerAdapter mSectionsPagerAdapter;
|
private BottomNavigationView mBottomNavigationView;
|
||||||
private NonSwipeableViewPager mViewPager;
|
|
||||||
private boolean mTrackerServiceRunning;
|
private boolean mTrackerServiceRunning;
|
||||||
private boolean mPermissionsGranted;
|
private boolean mPermissionsGranted;
|
||||||
private boolean mFloatingActionButtonSubMenuVisible;
|
private boolean mFloatingActionButtonSubMenuVisible;
|
||||||
private List<String> mMissingPermissions;
|
private List<String> mMissingPermissions;
|
||||||
private FloatingActionButton mFloatingActionButton;
|
private FloatingActionButton mFloatingActionButtonMain;
|
||||||
private LinearLayout mFloatingActionButtonSubMenu1;
|
private FloatingActionButton mFloatingActionButtonSubSave;
|
||||||
private LinearLayout mFloatingActionButtonSubMenu2;
|
private FloatingActionButton mFloatingActionButtonSubClear;
|
||||||
|
private FloatingActionButton mFloatingActionButtonLocation;
|
||||||
|
private CardView mFloatingActionButtonSubSaveLabel;
|
||||||
|
private CardView mFloatingActionButtonSubClearLabel;
|
||||||
private BroadcastReceiver mTrackingStoppedReceiver;
|
private BroadcastReceiver mTrackingStoppedReceiver;
|
||||||
private int mFloatingActionButtonState;
|
private int mFloatingActionButtonState;
|
||||||
private int mSelectedTab;
|
private int mSelectedTab;
|
||||||
|
@ -129,47 +122,6 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
// inflate action bar options menu
|
|
||||||
getMenuInflater().inflate(R.menu.menu_main, menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
|
|
||||||
// handle action bar options menu selection
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
|
|
||||||
// CASE ABOUT
|
|
||||||
case R.id.action_bar_about:
|
|
||||||
// get title
|
|
||||||
String aboutTitle = getString(R.string.header_about);
|
|
||||||
// put title and content into intent and start activity
|
|
||||||
Intent aboutIntent = new Intent(this, InfosheetActivity.class);
|
|
||||||
aboutIntent.putExtra(EXTRA_INFOSHEET_TITLE, aboutTitle);
|
|
||||||
aboutIntent.putExtra(EXTRA_INFOSHEET_CONTENT, INFOSHEET_CONTENT_ABOUT);
|
|
||||||
startActivity(aboutIntent);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// CASE MY LOCATION
|
|
||||||
case R.id.action_bar_my_location:
|
|
||||||
if (mSelectedTab != FRAGMENT_ID_MAP) {
|
|
||||||
// show map fragment
|
|
||||||
mSelectedTab = FRAGMENT_ID_MAP;
|
|
||||||
mViewPager.setCurrentItem(mSelectedTab);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// CASE DEFAULT
|
|
||||||
default:
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
@ -181,7 +133,7 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
handleIncomingIntent();
|
handleIncomingIntent();
|
||||||
|
|
||||||
// if not in onboarding mode: set state of FloatingActionButton
|
// if not in onboarding mode: set state of FloatingActionButton
|
||||||
if (mFloatingActionButton != null) {
|
if (mFloatingActionButtonMain != null) {
|
||||||
setFloatingActionButtonState();
|
setFloatingActionButtonState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -286,8 +238,7 @@ 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 handleStateAfterSave() {
|
private void handleStateAfterSave() {
|
||||||
// display and update track tab
|
// display and update track tab
|
||||||
mSelectedTab = FRAGMENT_ID_TRACK;
|
mSelectedTab = FRAGMENT_ID_TRACKS;
|
||||||
mViewPager.setCurrentItem(mSelectedTab);
|
|
||||||
|
|
||||||
// dismiss notification
|
// dismiss notification
|
||||||
Intent intent = new Intent(this, TrackerService.class);
|
Intent intent = new Intent(this, TrackerService.class);
|
||||||
|
@ -344,57 +295,17 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
// point to the main map layout
|
// point to the main map layout
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
// show action bar
|
// setup bottom navigation
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
mBottomNavigationView = findViewById(R.id.navigation);
|
||||||
setSupportActionBar(toolbar);
|
mBottomNavigationView.setOnNavigationItemSelectedListener(getOnNavigationItemSelectedListener());
|
||||||
|
|
||||||
// create adapter that returns fragments for the maim map and the last track display
|
|
||||||
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
|
|
||||||
|
|
||||||
// Set up the ViewPager with the sections adapter.
|
|
||||||
mViewPager = (NonSwipeableViewPager) findViewById(R.id.container);
|
|
||||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
|
||||||
mViewPager.setCurrentItem(mSelectedTab);
|
|
||||||
|
|
||||||
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
|
|
||||||
tabLayout.setupWithViewPager(mViewPager);
|
|
||||||
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
|
||||||
@Override
|
|
||||||
public void onTabSelected(TabLayout.Tab tab) {
|
|
||||||
switch (tab.getPosition()) {
|
|
||||||
case FRAGMENT_ID_MAP:
|
|
||||||
// show the Floating Action Button
|
|
||||||
mFloatingActionButton.show();
|
|
||||||
mSelectedTab = FRAGMENT_ID_MAP;
|
|
||||||
break;
|
|
||||||
case FRAGMENT_ID_TRACK:
|
|
||||||
// hide the Floating Action Button - and its sub menu
|
|
||||||
mFloatingActionButton.hide();
|
|
||||||
showFloatingActionButtonMenu(false);
|
|
||||||
mSelectedTab = FRAGMENT_ID_TRACK;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
// show the Floating Action Button
|
|
||||||
mFloatingActionButton.show();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabUnselected(TabLayout.Tab tab) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabReselected(TabLayout.Tab tab) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// get references to the record button and show/hide its sub menu
|
// get references to the record button and show/hide its sub menu
|
||||||
mFloatingActionButton = (FloatingActionButton) findViewById(R.id.fabMainButton);
|
mFloatingActionButtonMain = findViewById(R.id.fabMainButton);
|
||||||
mFloatingActionButtonSubMenu1 = (LinearLayout) findViewById(R.id.fabSubMenu1);
|
mFloatingActionButtonLocation = findViewById(R.id.fabLLcationButton);
|
||||||
mFloatingActionButtonSubMenu2 = (LinearLayout) findViewById(R.id.fabSubMenu2);
|
mFloatingActionButtonSubSave = findViewById(R.id.fabSubMenuButtonSave);
|
||||||
|
mFloatingActionButtonSubSaveLabel = findViewById(R.id.fabSubMenuLabelSave);
|
||||||
|
mFloatingActionButtonSubClear = findViewById(R.id.fabSubMenuButtonClear);
|
||||||
|
mFloatingActionButtonSubClearLabel = findViewById(R.id.fabSubMenuLabelClear);
|
||||||
if (mFloatingActionButtonSubMenuVisible) {
|
if (mFloatingActionButtonSubMenuVisible) {
|
||||||
showFloatingActionButtonMenu(true);
|
showFloatingActionButtonMenu(true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -402,42 +313,58 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
}
|
}
|
||||||
|
|
||||||
// add listeners to button and submenu
|
// add listeners to button and submenu
|
||||||
if (mFloatingActionButton != null) {
|
if (mFloatingActionButtonMain != null) {
|
||||||
mFloatingActionButton.setOnClickListener(new View.OnClickListener() {
|
mFloatingActionButtonMain.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
handleFloatingActionButtonClick(view);
|
handleFloatingActionButtonClick(view);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (mFloatingActionButtonSubMenu1 != null) {
|
if (mFloatingActionButtonSubSave != null) {
|
||||||
mFloatingActionButtonSubMenu1.setOnClickListener(new View.OnClickListener() {
|
mFloatingActionButtonSubSave.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
// todo check -> may produce NullPointerException
|
handleSaveButtonClick();
|
||||||
MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) mSectionsPagerAdapter.getFragment(FRAGMENT_ID_MAP);
|
|
||||||
mainActivityMapFragment.onActivityResult(RESULT_SAVE_DIALOG, Activity.RESULT_OK, getIntent());
|
|
||||||
handleStateAfterSave();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (mFloatingActionButtonSubMenu2 != null) {
|
if (mFloatingActionButtonSubSaveLabel != null) {
|
||||||
mFloatingActionButtonSubMenu2.setOnClickListener(new View.OnClickListener() {
|
mFloatingActionButtonSubSaveLabel.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
int dialogTitle = -1;
|
handleSaveButtonClick();
|
||||||
String dialogMessage = getString(R.string.dialog_clear_content);
|
}
|
||||||
int dialogPositiveButton = R.string.dialog_clear_action_clear;
|
});
|
||||||
int dialogNegativeButton = R.string.dialog_default_action_cancel;
|
}
|
||||||
|
if (mFloatingActionButtonSubClear != null) {
|
||||||
|
mFloatingActionButtonSubClear.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
handleClearButtonClick();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (mFloatingActionButtonSubClearLabel != null) {
|
||||||
|
mFloatingActionButtonSubClearLabel.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
handleClearButtonClick();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (mFloatingActionButtonLocation != null) {
|
||||||
|
mFloatingActionButtonLocation.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) getFragmentFromTag(FRAGMENT_TAG_MAP);
|
||||||
|
mainActivityMapFragment.handleShowMyLocation();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// show delete dialog - results are handles by onActivityResult
|
// show map fragment
|
||||||
MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) mSectionsPagerAdapter.getFragment(FRAGMENT_ID_MAP);
|
showFragment(FRAGMENT_ID_MAP);
|
||||||
DialogFragment dialogFragment = DialogHelper.newInstance(dialogTitle, dialogMessage, dialogPositiveButton, dialogNegativeButton);
|
|
||||||
dialogFragment.setTargetFragment(mainActivityMapFragment, RESULT_CLEAR_DIALOG);
|
|
||||||
dialogFragment.show(getSupportFragmentManager(), "ClearDialog");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// point to the on main onboarding layout
|
// point to the on main onboarding layout
|
||||||
|
@ -462,6 +389,30 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Handles tap on the button "save and clear" */
|
||||||
|
private void handleSaveButtonClick() {
|
||||||
|
// todo check -> may produce NullPointerException
|
||||||
|
MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) getFragmentFromTag(FRAGMENT_TAG_MAP);
|
||||||
|
mainActivityMapFragment.onActivityResult(RESULT_SAVE_DIALOG, Activity.RESULT_OK, getIntent());
|
||||||
|
handleStateAfterSave();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Handles tap on the button "clear" */
|
||||||
|
private void handleClearButtonClick() {
|
||||||
|
int dialogTitle = -1;
|
||||||
|
String dialogMessage = getString(R.string.dialog_clear_content);
|
||||||
|
int dialogPositiveButton = R.string.dialog_clear_action_clear;
|
||||||
|
int dialogNegativeButton = R.string.dialog_default_action_cancel;
|
||||||
|
|
||||||
|
// show delete dialog - results are handles by onActivityResult
|
||||||
|
MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) getFragmentFromTag(FRAGMENT_TAG_MAP);
|
||||||
|
DialogFragment dialogFragment = DialogHelper.newInstance(dialogTitle, dialogMessage, dialogPositiveButton, dialogNegativeButton);
|
||||||
|
dialogFragment.setTargetFragment(mainActivityMapFragment, RESULT_CLEAR_DIALOG);
|
||||||
|
dialogFragment.show(getSupportFragmentManager(), "ClearDialog");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Handles tap on the record button */
|
/* Handles tap on the record button */
|
||||||
private void handleFloatingActionButtonClick(View view) {
|
private void handleFloatingActionButtonClick(View view) {
|
||||||
|
|
||||||
|
@ -476,7 +427,7 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
setFloatingActionButtonState();
|
setFloatingActionButtonState();
|
||||||
|
|
||||||
// get last location from MainActivity Fragment // todo check -> may produce NullPointerException
|
// get last location from MainActivity Fragment // todo check -> may produce NullPointerException
|
||||||
MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) mSectionsPagerAdapter.getFragment(FRAGMENT_ID_MAP);
|
MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) getFragmentFromTag(FRAGMENT_TAG_MAP);
|
||||||
Location lastLocation = mainActivityMapFragment.getCurrentBestLocation();
|
Location lastLocation = mainActivityMapFragment.getCurrentBestLocation();
|
||||||
|
|
||||||
if (lastLocation != null) {
|
if (lastLocation != null) {
|
||||||
|
@ -484,7 +435,6 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
Intent intent = new Intent(this, TrackerService.class);
|
Intent intent = new Intent(this, TrackerService.class);
|
||||||
intent.setAction(ACTION_START);
|
intent.setAction(ACTION_START);
|
||||||
intent.putExtra(EXTRA_LAST_LOCATION, lastLocation);
|
intent.putExtra(EXTRA_LAST_LOCATION, lastLocation);
|
||||||
// startService(intent);
|
|
||||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.O) {
|
||||||
startForegroundService(intent);
|
startForegroundService(intent);
|
||||||
} else {
|
} else {
|
||||||
|
@ -527,11 +477,12 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
}
|
}
|
||||||
|
|
||||||
// update tracking state in MainActivityMapFragment // todo check -> may produce NullPointerException
|
// update tracking state in MainActivityMapFragment // todo check -> may produce NullPointerException
|
||||||
MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) mSectionsPagerAdapter.getFragment(FRAGMENT_ID_MAP);
|
MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) getFragmentFromTag(FRAGMENT_TAG_MAP);
|
||||||
mainActivityMapFragment.setTrackingState(mTrackerServiceRunning);
|
mainActivityMapFragment.setTrackingState(mTrackerServiceRunning);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// /* Handles tap on the save and clear button */
|
// /* Handles tap on the save and clear button */
|
||||||
// private void handleButtonSaveAndClearClick() {
|
// private void handleButtonSaveAndClearClick() {
|
||||||
// // clear map and save track
|
// // clear map and save track
|
||||||
|
@ -539,7 +490,7 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
// mainActivityMapFragment.clearMap(true);
|
// mainActivityMapFragment.clearMap(true);
|
||||||
//
|
//
|
||||||
// // display and update track tab
|
// // display and update track tab
|
||||||
// mSelectedTab = FRAGMENT_ID_TRACK;
|
// mSelectedTab = FRAGMENT_ID_TRACKS;
|
||||||
// mViewPager.setCurrentItem(mSelectedTab);
|
// mViewPager.setCurrentItem(mSelectedTab);
|
||||||
//
|
//
|
||||||
// // dismiss notification
|
// // dismiss notification
|
||||||
|
@ -579,16 +530,16 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
|
|
||||||
switch (mFloatingActionButtonState) {
|
switch (mFloatingActionButtonState) {
|
||||||
case FAB_STATE_DEFAULT:
|
case FAB_STATE_DEFAULT:
|
||||||
mFloatingActionButton.setImageResource(R.drawable.ic_fiber_manual_record_white_24dp);
|
mFloatingActionButtonMain.setImageResource(R.drawable.ic_fiber_manual_record_white_24dp);
|
||||||
break;
|
break;
|
||||||
case FAB_STATE_RECORDING:
|
case FAB_STATE_RECORDING:
|
||||||
mFloatingActionButton.setImageResource(R.drawable.ic_fiber_manual_record_red_24dp);
|
mFloatingActionButtonMain.setImageResource(R.drawable.ic_fiber_manual_record_red_24dp);
|
||||||
break;
|
break;
|
||||||
case FAB_STATE_SAVE:
|
case FAB_STATE_SAVE:
|
||||||
mFloatingActionButton.setImageResource(R.drawable.ic_save_white_24dp);
|
mFloatingActionButtonMain.setImageResource(R.drawable.ic_save_white_24dp);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mFloatingActionButton.setImageResource(R.drawable.ic_fiber_manual_record_white_24dp);
|
mFloatingActionButtonMain.setImageResource(R.drawable.ic_fiber_manual_record_white_24dp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -597,15 +548,103 @@ 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) {
|
||||||
mFloatingActionButtonSubMenu1.setVisibility(View.VISIBLE);
|
mFloatingActionButtonSubClear.setVisibility(View.VISIBLE);
|
||||||
mFloatingActionButtonSubMenu2.setVisibility(View.VISIBLE);
|
mFloatingActionButtonSubClearLabel.setVisibility(View.VISIBLE);
|
||||||
|
mFloatingActionButtonSubSave.setVisibility(View.VISIBLE);
|
||||||
|
mFloatingActionButtonSubSaveLabel.setVisibility(View.VISIBLE);
|
||||||
mFloatingActionButtonSubMenuVisible = true;
|
mFloatingActionButtonSubMenuVisible = true;
|
||||||
} else {
|
} else {
|
||||||
mFloatingActionButtonSubMenu1.setVisibility(View.INVISIBLE);
|
mFloatingActionButtonSubClear.setVisibility(View.INVISIBLE);
|
||||||
mFloatingActionButtonSubMenu2.setVisibility(View.INVISIBLE);
|
mFloatingActionButtonSubClearLabel.setVisibility(View.INVISIBLE);
|
||||||
|
mFloatingActionButtonSubSaveLabel.setVisibility(View.INVISIBLE);
|
||||||
|
mFloatingActionButtonSubSave.setVisibility(View.INVISIBLE);
|
||||||
mFloatingActionButtonSubMenuVisible = false;
|
mFloatingActionButtonSubMenuVisible = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Show fragment for given position */
|
||||||
|
private void showFragment(int pos) {
|
||||||
|
Fragment fragment = null;
|
||||||
|
String tag = null;
|
||||||
|
|
||||||
|
// define tag
|
||||||
|
if (pos == FRAGMENT_ID_TRACKS) {
|
||||||
|
tag = FRAGMENT_TAG_TRACKS;
|
||||||
|
} else {
|
||||||
|
tag = FRAGMENT_TAG_MAP;
|
||||||
|
}
|
||||||
|
// get fragment
|
||||||
|
fragment = getFragmentFromTag(tag);
|
||||||
|
|
||||||
|
// update selected tab
|
||||||
|
mSelectedTab = pos;
|
||||||
|
|
||||||
|
// place fragment in container
|
||||||
|
getSupportFragmentManager().beginTransaction()
|
||||||
|
.replace(R.id.container, fragment, tag )
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Returns a fragment for a given tag - creates a new instance if necessary */
|
||||||
|
private Fragment getFragmentFromTag(String tag) {
|
||||||
|
Fragment fragment = null;
|
||||||
|
fragment = getSupportFragmentManager().findFragmentByTag(tag);
|
||||||
|
|
||||||
|
if (fragment != null) {
|
||||||
|
return fragment;
|
||||||
|
} else {
|
||||||
|
if (tag.equals(FRAGMENT_TAG_TRACKS)) {
|
||||||
|
fragment = MainActivityTrackFragment.newInstance();
|
||||||
|
} else {
|
||||||
|
fragment = MainActivityMapFragment.newInstance();
|
||||||
|
}
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Handles taps on the bottom navigation */
|
||||||
|
private BottomNavigationView.OnNavigationItemSelectedListener getOnNavigationItemSelectedListener() {
|
||||||
|
return new BottomNavigationView.OnNavigationItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case R.id.navigation_map:
|
||||||
|
// show the Floating Action Button
|
||||||
|
mFloatingActionButtonMain.show();
|
||||||
|
|
||||||
|
// show the my location button
|
||||||
|
mFloatingActionButtonLocation.show();
|
||||||
|
|
||||||
|
// show map fragment
|
||||||
|
mSelectedTab = FRAGMENT_ID_MAP;
|
||||||
|
showFragment(FRAGMENT_ID_MAP);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case R.id.navigation_last_tracks:
|
||||||
|
// hide the Floating Action Button - and its sub menu
|
||||||
|
mFloatingActionButtonMain.hide();
|
||||||
|
showFloatingActionButtonMenu(false);
|
||||||
|
|
||||||
|
// hide the my location button
|
||||||
|
mFloatingActionButtonLocation.hide();
|
||||||
|
|
||||||
|
// show tracks fragment
|
||||||
|
mSelectedTab = FRAGMENT_ID_TRACKS;
|
||||||
|
showFragment(FRAGMENT_ID_TRACKS);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// show the Floating Action Button
|
||||||
|
mFloatingActionButtonMain.show();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -618,7 +657,7 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
case ACTION_SHOW_MAP:
|
case ACTION_SHOW_MAP:
|
||||||
// show map fragment
|
// show map fragment
|
||||||
mSelectedTab = FRAGMENT_ID_MAP;
|
mSelectedTab = FRAGMENT_ID_MAP;
|
||||||
mViewPager.setCurrentItem(mSelectedTab);
|
mBottomNavigationView.setSelectedItemId(FRAGMENT_ID_MAP);
|
||||||
|
|
||||||
// clear intent
|
// clear intent
|
||||||
intent.setAction(ACTION_DEFAULT);
|
intent.setAction(ACTION_DEFAULT);
|
||||||
|
@ -662,7 +701,7 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
setFloatingActionButtonState();
|
setFloatingActionButtonState();
|
||||||
|
|
||||||
// pass tracking state to MainActivityMapFragment // todo check -> may produce NullPointerException
|
// pass tracking state to MainActivityMapFragment // todo check -> may produce NullPointerException
|
||||||
MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) mSectionsPagerAdapter.getFragment(FRAGMENT_ID_MAP);
|
MainActivityMapFragment mainActivityMapFragment = (MainActivityMapFragment) getFragmentFromTag(FRAGMENT_TAG_MAP);
|
||||||
mainActivityMapFragment.setTrackingState(false);
|
mainActivityMapFragment.setTrackingState(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -685,76 +724,4 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Inner class: SectionsPagerAdapter that returns a fragment corresponding to one of the tabs.
|
|
||||||
* see also: https://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html
|
|
||||||
* and: http://www.truiton.com/2015/12/android-activity-fragment-communication/
|
|
||||||
*/
|
|
||||||
public class SectionsPagerAdapter extends FragmentPagerAdapter {
|
|
||||||
|
|
||||||
private final SparseArray<WeakReference<Fragment>> instantiatedFragments = new SparseArray<>();
|
|
||||||
|
|
||||||
public SectionsPagerAdapter(FragmentManager fm) {
|
|
||||||
super(fm);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Fragment getItem(int position) {
|
|
||||||
// getItem is called to instantiate the fragment for the given page.
|
|
||||||
switch (position) {
|
|
||||||
case FRAGMENT_ID_MAP:
|
|
||||||
return new MainActivityMapFragment();
|
|
||||||
case FRAGMENT_ID_TRACK:
|
|
||||||
return new MainActivityTrackFragment();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getCount() {
|
|
||||||
// Show 2 total pages.
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CharSequence getPageTitle(int position) {
|
|
||||||
switch (position) {
|
|
||||||
case FRAGMENT_ID_MAP:
|
|
||||||
return getString(R.string.tab_map);
|
|
||||||
case FRAGMENT_ID_TRACK:
|
|
||||||
return getString(R.string.tab_last_tracks);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object instantiateItem(final ViewGroup container, final int position) {
|
|
||||||
final Fragment fragment = (Fragment) super.instantiateItem(container, position);
|
|
||||||
instantiatedFragments.put(position, new WeakReference<>(fragment));
|
|
||||||
return fragment;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroyItem(final ViewGroup container, final int position, final Object object) {
|
|
||||||
instantiatedFragments.remove(position);
|
|
||||||
super.destroyItem(container, position, object);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
public Fragment getFragment(final int position) {
|
|
||||||
final WeakReference<Fragment> wr = instantiatedFragments.get(position);
|
|
||||||
if (wr != null) {
|
|
||||||
return wr.get();
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* End of inner class
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@ import android.support.design.widget.Snackbar;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.content.LocalBroadcastManager;
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
@ -93,6 +92,12 @@ public class MainActivityMapFragment extends Fragment implements TrackbookKeys {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Return a new Instance of MainActivityMapFragment */
|
||||||
|
public static MainActivityMapFragment newInstance() {
|
||||||
|
return new MainActivityMapFragment();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -100,9 +105,6 @@ public class MainActivityMapFragment extends Fragment implements TrackbookKeys {
|
||||||
// get activity
|
// get activity
|
||||||
mActivity = getActivity();
|
mActivity = getActivity();
|
||||||
|
|
||||||
// action bar has options menu
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
|
|
||||||
// restore first start state and tracking state
|
// restore first start state and tracking state
|
||||||
mFirstStart = true;
|
mFirstStart = true;
|
||||||
mTrackerServiceRunning = false;
|
mTrackerServiceRunning = false;
|
||||||
|
@ -291,63 +293,6 @@ public class MainActivityMapFragment extends Fragment implements TrackbookKeys {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
|
|
||||||
// handle action bar options menu selection
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
|
|
||||||
// CASE MY LOCATION
|
|
||||||
case R.id.action_bar_my_location:
|
|
||||||
|
|
||||||
// do nothing if location setting is off
|
|
||||||
if (toggleLocationOffBar()) {
|
|
||||||
stopPreliminaryTracking();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// get current position
|
|
||||||
GeoPoint position;
|
|
||||||
|
|
||||||
if (mTrackerServiceRunning && mTrack != null) {
|
|
||||||
// get current Location from tracker service
|
|
||||||
mCurrentBestLocation = mTrack.getWayPointLocation(mTrack.getSize() - 1);
|
|
||||||
} else if (mCurrentBestLocation == null) {
|
|
||||||
// app does not have any location fix
|
|
||||||
mCurrentBestLocation = LocationHelper.determineLastKnownLocation(mLocationManager);
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if really got a position
|
|
||||||
if (mCurrentBestLocation != null) {
|
|
||||||
position = convertToGeoPoint(mCurrentBestLocation);
|
|
||||||
|
|
||||||
// center map on current position
|
|
||||||
mController.setCenter(position);
|
|
||||||
|
|
||||||
// mark user's new location on map and remove last marker
|
|
||||||
updateMyLocationMarker();
|
|
||||||
|
|
||||||
// inform user about location quality
|
|
||||||
String locationInfo;
|
|
||||||
long locationAge = (SystemClock.elapsedRealtimeNanos() - mCurrentBestLocation.getElapsedRealtimeNanos()) / 1000000;
|
|
||||||
String locationAgeString = LocationHelper.convertToReadableTime(locationAge, false);
|
|
||||||
if (locationAgeString == null) {
|
|
||||||
locationAgeString = mActivity.getString(R.string.toast_message_last_location_age_one_hour);
|
|
||||||
}
|
|
||||||
locationInfo = " " + locationAgeString + " | " + mCurrentBestLocation.getProvider();
|
|
||||||
Toast.makeText(mActivity, mActivity.getString(R.string.toast_message_last_location) + locationInfo, Toast.LENGTH_LONG).show();
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
Toast.makeText(mActivity, mActivity.getString(R.string.toast_message_location_services_not_ready), Toast.LENGTH_LONG).show();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// CASE DEFAULT
|
|
||||||
default:
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
@ -548,6 +493,53 @@ public class MainActivityMapFragment extends Fragment implements TrackbookKeys {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Handles tap on the my location button */
|
||||||
|
public boolean handleShowMyLocation() {
|
||||||
|
|
||||||
|
// do nothing if location setting is off
|
||||||
|
if (toggleLocationOffBar()) {
|
||||||
|
stopPreliminaryTracking();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get current position
|
||||||
|
GeoPoint position;
|
||||||
|
|
||||||
|
if (mTrackerServiceRunning && mTrack != null) {
|
||||||
|
// get current Location from tracker service
|
||||||
|
mCurrentBestLocation = mTrack.getWayPointLocation(mTrack.getSize() - 1);
|
||||||
|
} else if (mCurrentBestLocation == null) {
|
||||||
|
// app does not have any location fix
|
||||||
|
mCurrentBestLocation = LocationHelper.determineLastKnownLocation(mLocationManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if really got a position
|
||||||
|
if (mCurrentBestLocation != null) {
|
||||||
|
position = convertToGeoPoint(mCurrentBestLocation);
|
||||||
|
|
||||||
|
// center map on current position
|
||||||
|
mController.setCenter(position);
|
||||||
|
|
||||||
|
// mark user's new location on map and remove last marker
|
||||||
|
updateMyLocationMarker();
|
||||||
|
|
||||||
|
// inform user about location quality
|
||||||
|
String locationInfo;
|
||||||
|
long locationAge = (SystemClock.elapsedRealtimeNanos() - mCurrentBestLocation.getElapsedRealtimeNanos()) / 1000000;
|
||||||
|
String locationAgeString = LocationHelper.convertToReadableTime(locationAge, false);
|
||||||
|
if (locationAgeString == null) {
|
||||||
|
locationAgeString = mActivity.getString(R.string.toast_message_last_location_age_one_hour);
|
||||||
|
}
|
||||||
|
locationInfo = " " + locationAgeString + " | " + mCurrentBestLocation.getProvider();
|
||||||
|
Toast.makeText(mActivity, mActivity.getString(R.string.toast_message_last_location) + locationInfo, Toast.LENGTH_LONG).show();
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
Toast.makeText(mActivity, mActivity.getString(R.string.toast_message_location_services_not_ready), Toast.LENGTH_LONG).show();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Creates receiver for new WayPoints */
|
/* Creates receiver for new WayPoints */
|
||||||
private BroadcastReceiver createTrackUpdatedReceiver() {
|
private BroadcastReceiver createTrackUpdatedReceiver() {
|
||||||
return new BroadcastReceiver() {
|
return new BroadcastReceiver() {
|
||||||
|
|
|
@ -96,6 +96,12 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O
|
||||||
private BroadcastReceiver mTrackSavedReceiver;
|
private BroadcastReceiver mTrackSavedReceiver;
|
||||||
|
|
||||||
|
|
||||||
|
/* Return a new Instance of MainActivityTrackFragment */
|
||||||
|
public static MainActivityTrackFragment newInstance() {
|
||||||
|
return new MainActivityTrackFragment();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
|
@ -68,7 +68,11 @@ public interface TrackbookKeys {
|
||||||
|
|
||||||
/* FRAGMENT IDS */
|
/* FRAGMENT IDS */
|
||||||
int FRAGMENT_ID_MAP = 0;
|
int FRAGMENT_ID_MAP = 0;
|
||||||
int FRAGMENT_ID_TRACK = 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;
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M21,3L3,10.53v0.98l6.84,2.65L12.48,21h0.98L21,3z"/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8.46,11.88l1.41,-1.41L12,12.59l2.12,-2.12 1.41,1.41L13.41,14l2.12,2.12 -1.41,1.41L12,15.41l-2.12,2.12 -1.41,-1.41L10.59,14l-2.13,-2.12zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z"
|
||||||
|
android:fillColor="@color/trackbook_grey" />
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/ic_file_download_grey_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_file_download_grey_24dp.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:pathData="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z"
|
||||||
|
android:fillColor="@color/trackbook_grey" />
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/ic_info_grey_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_info_grey_24dp.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/trackbook_grey"
|
||||||
|
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
|
||||||
|
</vector>
|
|
@ -4,6 +4,6 @@
|
||||||
android:viewportWidth="24.0"
|
android:viewportWidth="24.0"
|
||||||
android:viewportHeight="24.0">
|
android:viewportHeight="24.0">
|
||||||
<path
|
<path
|
||||||
android:fillColor="@color/trackbook_white"
|
android:fillColor="@color/trackbook_grey"
|
||||||
android:pathData="M12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM20.94,11c-0.46,-4.17 -3.77,-7.48 -7.94,-7.94L13,1h-2v2.06C6.83,3.52 3.52,6.83 3.06,11L1,11v2h2.06c0.46,4.17 3.77,7.48 7.94,7.94L11,23h2v-2.06c4.17,-0.46 7.48,-3.77 7.94,-7.94L23,13v-2h-2.06zM12,19c-3.87,0 -7,-3.13 -7,-7s3.13,-7 7,-7 7,3.13 7,7 -3.13,7 -7,7z"/>
|
android:pathData="M12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM20.94,11c-0.46,-4.17 -3.77,-7.48 -7.94,-7.94L13,1h-2v2.06C6.83,3.52 3.52,6.83 3.06,11L1,11v2h2.06c0.46,4.17 3.77,7.48 7.94,7.94L11,23h2v-2.06c4.17,-0.46 7.48,-3.77 7.94,-7.94L23,13v-2h-2.06zM12,19c-3.87,0 -7,-3.13 -7,-7s3.13,-7 7,-7 7,3.13 7,7 -3.13,7 -7,7z"/>
|
||||||
</vector>
|
</vector>
|
12
app/src/main/res/drawable/ic_notebook_black_24dp.xml
Normal file
12
app/src/main/res/drawable/ic_notebook_black_24dp.xml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:viewportHeight="96.0"
|
||||||
|
android:viewportWidth="96.0"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/trackbook_black"
|
||||||
|
android:pathData="M44,12.99L20.69,8.74L5.12,5.89C2.29,5.38 0,7.44 0,10.49v67.38c0,3.06 2.29,5.96 5.12,6.47l15.57,2.85l22.19,4.05L44,91.46V12.99z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/trackbook_black"
|
||||||
|
android:pathData="M90.88,5.89L75.31,8.74L53.12,12.79L52,12.99v78.46l23.31,-4.26l15.57,-2.85c2.83,-0.52 5.12,-3.41 5.12,-6.47V10.49C96,7.44 93.71,5.38 90.88,5.89z"/>
|
||||||
|
</vector>
|
5
app/src/main/res/drawable/selector_bottom_navigation.xml
Normal file
5
app/src/main/res/drawable/selector_bottom_navigation.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_checked="true" android:color="@color/trackbook_white" />
|
||||||
|
<item android:color="@color/trackbook_grey_lighter" />
|
||||||
|
</selector>
|
|
@ -1,144 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<ScrollView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
|
||||||
android:scrollbars="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_h1_about"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Large"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_h2_recorder"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_marginTop="4dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_h3_version"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_marginTop="8dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_p_bare"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:layout_marginTop="8dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_p_free"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:layout_marginTop="4dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_p_github"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:autoLink="web" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_p_license"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:autoLink="web" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_p_osmdroid"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:autoLink="web" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_h2_permissions"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_h3_internet"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_marginTop="4dp" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_p_internet"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:layout_marginTop="2dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_h3_network"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_marginTop="8dp" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_p_network"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:layout_marginTop="2dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_h3_location"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_marginTop="8dp" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_p_location"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:layout_marginTop="2dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_h3_external"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_marginTop="8dp" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/infosheet_about_p_external"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Small"
|
|
||||||
android:layout_marginTop="2dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
|
|
|
@ -3,57 +3,148 @@
|
||||||
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"
|
||||||
android:id="@+id/main_content"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
tools:context="org.y20k.trackbook.MainActivity">
|
tools:context="org.y20k.trackbook.MainActivity">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
<android.support.constraint.ConstraintLayout
|
||||||
android:id="@+id/appbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingTop="@dimen/appbar_padding_top"
|
|
||||||
android:theme="@style/TrackbookAppTheme.AppBarOverlay">
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
|
||||||
app:popupTheme="@style/TrackbookAppTheme.PopupOverlay">
|
|
||||||
|
|
||||||
</android.support.v7.widget.Toolbar>
|
|
||||||
|
|
||||||
<android.support.design.widget.TabLayout
|
|
||||||
android:id="@+id/tabs"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:tabMaxWidth="0dp"
|
|
||||||
app:tabGravity="fill"
|
|
||||||
app:tabMode="fixed" />
|
|
||||||
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<org.y20k.trackbook.layout.NonSwipeableViewPager
|
|
||||||
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">
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
|
||||||
<!-- MainActivityMapFragment and MainActivityTrackFragment are included at runtime -->
|
|
||||||
|
|
||||||
|
|
||||||
<include layout="@layout/floating_action_button" />
|
<!-- BUTTON MY LOCATION -->
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fabLLcationButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:clickable="true"
|
||||||
|
app:backgroundTint="@color/trackbook_white"
|
||||||
|
app:fabSize="mini"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/fabMainButton"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/fabMainButton"
|
||||||
|
app:srcCompat="@drawable/ic_my_location_grey_24dp" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BUTTON SAVE AND CLEAR -->
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fabSubMenuButtonSave"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:contentDescription="@string/descr_fab_sub_menu_button_1"
|
||||||
|
app:backgroundTint="@color/trackbook_green"
|
||||||
|
app:fabSize="mini"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/fabSubMenuButtonClear"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/fabSubMenuButtonClear"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/fabSubMenuButtonClear"
|
||||||
|
app:srcCompat="@drawable/ic_save_white_24dp" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/fabSubMenuLabelSave"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:contentDescription="@string/descr_fab_sub_menu_button_1"
|
||||||
|
app:cardBackgroundColor="@color/trackbook_white"
|
||||||
|
app:cardCornerRadius="4dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:cardUseCompatPadding="true"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/fabSubMenuButtonSave"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/fabSubMenuButtonSave"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/fabSubMenuButtonSave">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:text="@string/fab_sub_menu_save_and_clear"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:layout_editor_absoluteX="110dp"
|
||||||
|
tools:layout_editor_absoluteY="239dp" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BUTTON CLEAR -->
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fabSubMenuButtonClear"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:contentDescription="@string/descr_fab_sub_menu_button_2"
|
||||||
|
app:backgroundTint="@color/trackbook_blue"
|
||||||
|
app:fabSize="mini"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/fabMainButton"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/fabMainButton"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/fabMainButton"
|
||||||
|
app:srcCompat="@drawable/ic_clear_white_24dp" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/fabSubMenuLabelClear"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:contentDescription="@string/descr_fab_sub_menu_label_2"
|
||||||
|
app:cardBackgroundColor="@color/trackbook_white"
|
||||||
|
app:cardCornerRadius="4dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:cardUseCompatPadding="true"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/fabSubMenuButtonClear"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/fabSubMenuButtonClear"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/fabSubMenuButtonClear">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:text="@string/fab_sub_menu_clear"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:layout_editor_absoluteX="124dp"
|
||||||
|
tools:layout_editor_absoluteY="447dp" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- MAIN BUTTON -->
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fabMainButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:contentDescription="@string/descr_fab_main"
|
||||||
|
app:backgroundTint="@color/trackbook_blue"
|
||||||
|
app:fabSize="normal"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/navigation"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:srcCompat="@drawable/ic_fiber_manual_record_white_24dp" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BOTTOM NAVIGATION -->
|
||||||
|
<android.support.design.widget.BottomNavigationView
|
||||||
|
android:id="@+id/navigation"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/trackbook_red"
|
||||||
|
app:itemIconTint="@drawable/selector_bottom_navigation"
|
||||||
|
app:itemTextColor="@drawable/selector_bottom_navigation"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:menu="@menu/menu_main" />
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|
||||||
<!-- <android.support.design.widget.FloatingActionButton
|
|
||||||
android:id="@+id/fab"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:layout_margin="@dimen/fab_margin"
|
|
||||||
app:srcCompat="@drawable/ic_fiber_manual_record_white_24dp"
|
|
||||||
app:fabSize="auto"/> -->
|
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
|
|
@ -7,6 +7,6 @@
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
android:paddingStart="@dimen/activity_horizontal_margin"
|
android:paddingStart="@dimen/activity_horizontal_margin"
|
||||||
android:paddingEnd="@dimen/activity_horizontal_margin"
|
android:paddingEnd="@dimen/activity_horizontal_margin"
|
||||||
android:textColor="@color/trackbook_white"
|
android:textColor="@color/trackbook_grey"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:maxLines="1" />
|
android:singleLine="true" />
|
|
@ -7,7 +7,7 @@
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
android:paddingStart="@dimen/activity_horizontal_margin"
|
android:paddingStart="@dimen/activity_horizontal_margin"
|
||||||
android:paddingEnd="@dimen/activity_horizontal_margin"
|
android:paddingEnd="@dimen/activity_horizontal_margin"
|
||||||
android:textColor="@color/trackbook_white"
|
android:textColor="@color/trackbook_grey"
|
||||||
android:background="@color/trackbook_blue"
|
android:background="@color/trackbook_white"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:maxLines="1" />
|
android:singleLine="true" />
|
|
@ -1,132 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/fabFrameLayout"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="bottom"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:layout_margin="@dimen/fab_margin"
|
|
||||||
app:layout_behavior="org.y20k.trackbook.layout.DodgeAbleLayoutBehavior">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/fabSubMenu1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_marginBottom="@dimen/fab_margin"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:visibility="visible">
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:contentDescription="@string/descr_fab_sub_menu_button_1"
|
|
||||||
app:cardBackgroundColor="@color/trackbook_white"
|
|
||||||
app:cardCornerRadius="4dp"
|
|
||||||
app:cardElevation="4dp"
|
|
||||||
app:cardUseCompatPadding="true" >
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/fabSubMenuLabel1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
|
||||||
android:text="@string/fab_sub_menu_save_and_clear"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingRight="6dp"
|
|
||||||
android:paddingLeft="6dp"
|
|
||||||
android:paddingBottom="2dp"
|
|
||||||
android:paddingTop="2dp" />
|
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
|
||||||
android:id="@+id/fabSubMenuButton1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:contentDescription="@string/descr_fab_sub_menu_button_1"
|
|
||||||
app:srcCompat="@drawable/ic_save_white_24dp"
|
|
||||||
app:backgroundTint="@color/trackbook_green"
|
|
||||||
app:fabSize="mini" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/fabSubMenu2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_marginBottom="@dimen/fab_margin"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:visibility="visible">
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:contentDescription="@string/descr_fab_sub_menu_label_2"
|
|
||||||
app:cardBackgroundColor="@color/trackbook_white"
|
|
||||||
app:cardCornerRadius="4dp"
|
|
||||||
app:cardElevation="4dp"
|
|
||||||
app:cardUseCompatPadding="true">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/fabSubMenuLabel2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
|
||||||
android:text="@string/fab_sub_menu_clear"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingRight="6dp"
|
|
||||||
android:paddingLeft="6dp"
|
|
||||||
android:paddingBottom="2dp"
|
|
||||||
android:paddingTop="2dp" />
|
|
||||||
|
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
|
||||||
android:id="@+id/fabSubMenuButton2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:contentDescription="@string/descr_fab_sub_menu_button_2"
|
|
||||||
app:srcCompat="@drawable/ic_clear_white_24dp"
|
|
||||||
app:backgroundTint="@color/trackbook_blue"
|
|
||||||
app:fabSize="mini" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/fabMain"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
|
||||||
android:id="@+id/fabMainButton"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:contentDescription="@string/descr_fab_main"
|
|
||||||
app:srcCompat="@drawable/ic_fiber_manual_record_white_24dp"
|
|
||||||
app:backgroundTint="@color/trackbook_blue"
|
|
||||||
app:fabSize="normal" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- <android.support.design.widget.FloatingActionButton
|
|
||||||
android:id="@+id/fab"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:layout_margin="@dimen/fab_margin"
|
|
||||||
app:srcCompat="@drawable/ic_fiber_manual_record_white_24dp"
|
|
||||||
app:fabSize="auto"/> -->
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
|
@ -29,7 +29,7 @@
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:background="@color/trackbook_blue_85percent">
|
android:background="@color/trackbook_white_85percent">
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/track_selector"
|
android:id="@+id/track_selector"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
android:layout_gravity="end|center"
|
android:layout_gravity="end|center"
|
||||||
android:paddingStart="@dimen/activity_horizontal_margin"
|
android:paddingStart="@dimen/activity_horizontal_margin"
|
||||||
android:paddingEnd="@dimen/activity_horizontal_margin"
|
android:paddingEnd="@dimen/activity_horizontal_margin"
|
||||||
android:src="@drawable/ic_file_download_white_24dp"
|
android:src="@drawable/ic_file_download_grey_24dp"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
android:paddingEnd="@dimen/activity_horizontal_margin"
|
android:paddingEnd="@dimen/activity_horizontal_margin"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:src="@drawable/ic_delete_forever_white_24dp"
|
android:src="@drawable/ic_delete_forever_grey_24dp"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:contentDescription="@string/descr_delete_button" />
|
android:contentDescription="@string/descr_delete_button" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
android:layout_width="@dimen/bottom_sheet_width"
|
android:layout_width="@dimen/bottom_sheet_width"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:background="@color/trackbook_blue_85percent"
|
android:background="@color/trackbook_white_85percent"
|
||||||
app:behavior_hideable="true"
|
app:behavior_hideable="true"
|
||||||
app:behavior_peekHeight="112dp"
|
app:behavior_peekHeight="112dp"
|
||||||
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
|
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
android:id="@+id/statistics_headline"
|
android:id="@+id/statistics_headline"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Medium"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="start|center"
|
android:gravity="start|center"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="end|center"
|
android:gravity="end|center"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_icon"
|
android:contentDescription="@string/descr_statistics_sheet_icon"
|
||||||
app:srcCompat="@drawable/ic_info_white_24dp" />
|
app:srcCompat="@drawable/ic_info_grey_24dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -130,14 +130,14 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:text="@string/statistics_sheet_p_distance"
|
android:text="@string/statistics_sheet_p_distance"
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Small"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_distance" />
|
android:contentDescription="@string/descr_statistics_sheet_p_distance" />
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/statistics_data_distance"
|
android:id="@+id/statistics_data_distance"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Medium"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_distance_value" />
|
android:contentDescription="@string/descr_statistics_sheet_p_distance_value" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -153,14 +153,14 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:text="@string/statistics_sheet_p_steps"
|
android:text="@string/statistics_sheet_p_steps"
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Small"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_steps" />
|
android:contentDescription="@string/descr_statistics_sheet_p_steps" />
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/statistics_data_steps"
|
android:id="@+id/statistics_data_steps"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Medium"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_steps_value" />
|
android:contentDescription="@string/descr_statistics_sheet_p_steps_value" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -176,14 +176,14 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:text="@string/statistics_sheet_p_waypoints"
|
android:text="@string/statistics_sheet_p_waypoints"
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Small"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_waypoints" />
|
android:contentDescription="@string/descr_statistics_sheet_p_waypoints" />
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/statistics_data_waypoints"
|
android:id="@+id/statistics_data_waypoints"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Medium"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_waypoints_value" />
|
android:contentDescription="@string/descr_statistics_sheet_p_waypoints_value" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -199,14 +199,14 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:text="@string/statistics_sheet_p_duration"
|
android:text="@string/statistics_sheet_p_duration"
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Small"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_duration" />
|
android:contentDescription="@string/descr_statistics_sheet_p_duration" />
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/statistics_data_duration"
|
android:id="@+id/statistics_data_duration"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Medium"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_duration_value" />
|
android:contentDescription="@string/descr_statistics_sheet_p_duration_value" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -222,14 +222,14 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:text="@string/statistics_sheet_p_recording_start"
|
android:text="@string/statistics_sheet_p_recording_start"
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Small"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_recording_start" />
|
android:contentDescription="@string/descr_statistics_sheet_p_recording_start" />
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/statistics_data_recording_start"
|
android:id="@+id/statistics_data_recording_start"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Medium"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_recording_start_value" />
|
android:contentDescription="@string/descr_statistics_sheet_p_recording_start_value" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -246,14 +246,14 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:text="@string/statistics_sheet_p_recording_stop"
|
android:text="@string/statistics_sheet_p_recording_stop"
|
||||||
android:textAppearance="@android:style/TextAppearance.Small.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Small"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_recording_end" />
|
android:contentDescription="@string/descr_statistics_sheet_p_recording_end" />
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/statistics_data_recording_stop"
|
android:id="@+id/statistics_data_recording_stop"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/statistics_sheet_p_default_data"
|
android:text="@string/statistics_sheet_p_default_data"
|
||||||
android:textAppearance="@android:style/TextAppearance.Medium.Inverse"
|
android:textAppearance="@android:style/TextAppearance.Medium"
|
||||||
android:contentDescription="@string/descr_statistics_sheet_p_recording_end_value" />
|
android:contentDescription="@string/descr_statistics_sheet_p_recording_end_value" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
tools:context="org.y20k.trackbook.MainActivity">
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_bar_my_location"
|
android:id="@+id/navigation_map"
|
||||||
android:icon="@drawable/ic_my_location_white_24dp"
|
android:icon="@drawable/ic_compass_needle_black_24dp"
|
||||||
android:title="@string/menu_my_location"
|
android:title="@string/tab_map" />
|
||||||
android:visible="true"
|
|
||||||
app:showAsAction="ifRoom" />
|
|
||||||
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_bar_about"
|
android:id="@+id/navigation_last_tracks"
|
||||||
android:orderInCategory="100"
|
android:icon="@drawable/ic_notebook_black_24dp"
|
||||||
android:title="@string/menu_about"
|
android:title="@string/tab_last_tracks" />
|
||||||
app:showAsAction="never" />
|
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
<string name="header_about">Über Trackbook</string>
|
<string name="header_about">Über Trackbook</string>
|
||||||
|
|
||||||
<!-- tabs -->
|
<!-- tabs -->
|
||||||
<string name="tab_map">KARTE</string>
|
<string name="tab_map">Karte</string>
|
||||||
<string name="tab_last_track">LETZTE AUFZEICHNUNG</string>
|
<string name="tab_last_track">Letzte Aufzeichnung</string>
|
||||||
<string name="tab_last_tracks">LETZTE AUFZEICHNUNGEN</string>
|
<string name="tab_last_tracks">Letzte Aufzeichnungen</string>
|
||||||
|
|
||||||
<!-- notification -->
|
<!-- notification -->
|
||||||
<string name="notification_title_trackbook_not_running">Trackbook ist inaktiv</string>
|
<string name="notification_title_trackbook_not_running">Trackbook ist inaktiv</string>
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
<resources>
|
|
||||||
|
|
||||||
<style name="TrackbookAppTheme.NoActionBar">
|
|
||||||
<item name="windowActionBar">false</item>
|
|
||||||
<item name="windowNoTitle">true</item>
|
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
|
||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
29
app/src/main/res/values-v23/styles.xml
Normal file
29
app/src/main/res/values-v23/styles.xml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<!-- Base application theme. -->
|
||||||
|
<style name="TrackbookAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
|
|
||||||
|
<!-- Set AppCompat’s colors -->
|
||||||
|
<item name="colorPrimary">@color/trackbook_red</item>
|
||||||
|
<item name="colorPrimaryDark">@color/trackbook_white</item>
|
||||||
|
<item name="colorAccent">@color/trackbook_blue</item>
|
||||||
|
|
||||||
|
<!-- Show white status bar -->
|
||||||
|
<item name="android:windowLightStatusBar">true</item>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<!--<style name="TrackbookAppTheme.NoActionBar">-->
|
||||||
|
<!--<item name="windowActionBar">false</item>-->
|
||||||
|
<!--<item name="windowNoTitle">true</item>-->
|
||||||
|
<!--</style>-->
|
||||||
|
|
||||||
|
<!--<style name="TrackbookAppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />-->
|
||||||
|
|
||||||
|
<!-- Drop down theme -->
|
||||||
|
<style name="TrackbookAppTheme.PopupOverlay" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
|
<item name="android:colorControlNormal">@color/trackbook_grey</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</resources>
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
<color name="trackbook_red">#FFE53935</color>
|
<color name="trackbook_red">#FFE53935</color>
|
||||||
<color name="trackbook_red_dark">#FFB71C1C</color>
|
<color name="trackbook_red_dark">#FFB71C1C</color>
|
||||||
|
<color name="trackbook_red_85percent">#D9E53935</color>
|
||||||
|
|
||||||
<color name="trackbook_gold">#FFE6BA64</color>
|
<color name="trackbook_gold">#FFE6BA64</color>
|
||||||
|
|
||||||
|
@ -13,7 +14,10 @@
|
||||||
<color name="trackbook_green">#FF4CAF50</color>
|
<color name="trackbook_green">#FF4CAF50</color>
|
||||||
|
|
||||||
<color name="trackbook_white">#FFFFFFFF</color>
|
<color name="trackbook_white">#FFFFFFFF</color>
|
||||||
|
<color name="trackbook_white_85percent">#D9FFFFFF</color>
|
||||||
|
<color name="trackbook_black">#FF000000</color>
|
||||||
|
|
||||||
|
<color name="trackbook_grey_lighter">#FFECEFF1</color>
|
||||||
<color name="trackbook_grey_light">#FF607d8b</color>
|
<color name="trackbook_grey_light">#FF607d8b</color>
|
||||||
<color name="trackbook_grey">#FF455a64</color>
|
<color name="trackbook_grey">#FF455a64</color>
|
||||||
<color name="trackbook_grey_85percent">#D9455a64</color>
|
<color name="trackbook_grey_85percent">#D9455a64</color>
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
<string name="header_about">About Trackbook</string>
|
<string name="header_about">About Trackbook</string>
|
||||||
|
|
||||||
<!-- tabs -->
|
<!-- tabs -->
|
||||||
<string name="tab_map">MAP</string>
|
<string name="tab_map">Map</string>
|
||||||
<string name="tab_last_track">LAST TRACK</string>
|
<string name="tab_last_track">Last Track</string>
|
||||||
<string name="tab_last_tracks">LAST TRACKS</string>
|
<string name="tab_last_tracks">Last Tracks</string>
|
||||||
|
|
||||||
<!-- notification -->
|
<!-- notification -->
|
||||||
<string name="notification_title_trackbook_running">Trackbook running</string>
|
<string name="notification_title_trackbook_running">Trackbook running</string>
|
||||||
|
|
|
@ -1,22 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="TrackbookAppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
<style name="TrackbookAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
|
||||||
|
<!-- Set AppCompat’s colors -->
|
||||||
<item name="colorPrimary">@color/trackbook_red</item>
|
<item name="colorPrimary">@color/trackbook_red</item>
|
||||||
<item name="colorPrimaryDark">@color/trackbook_red_dark</item>
|
<item name="colorPrimaryDark">@color/trackbook_black</item>
|
||||||
<item name="colorAccent">@color/trackbook_blue</item>
|
<item name="colorAccent">@color/trackbook_blue</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TrackbookAppTheme.NoActionBar">
|
<!--<style name="TrackbookAppTheme.NoActionBar">-->
|
||||||
<item name="windowActionBar">false</item>
|
<!--<item name="windowActionBar">false</item>-->
|
||||||
<item name="windowNoTitle">true</item>
|
<!--<item name="windowNoTitle">true</item>-->
|
||||||
</style>
|
<!--</style>-->
|
||||||
|
|
||||||
<style name="TrackbookAppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
<!--<style name="TrackbookAppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />-->
|
||||||
|
|
||||||
<style name="TrackbookAppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">
|
<!-- Drop down theme -->
|
||||||
<item name="android:colorControlNormal">@color/trackbook_white</item>
|
<style name="TrackbookAppTheme.PopupOverlay" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
|
<item name="android:colorControlNormal">@color/trackbook_grey</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -5,7 +5,7 @@ buildscript {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.0.0'
|
classpath 'com.android.tools.build:gradle:3.0.1'
|
||||||
|
|
||||||
// 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
|
||||||
|
@ -21,13 +21,14 @@ allprojects {
|
||||||
}
|
}
|
||||||
project.ext {
|
project.ext {
|
||||||
applicationId = 'org.y20k.trackbook'
|
applicationId = 'org.y20k.trackbook'
|
||||||
versionCode = 15
|
versionCode = 16
|
||||||
versionName = '1.0.8'
|
versionName = '1.1.0'
|
||||||
minSdkVersion = 22
|
minSdkVersion = 22
|
||||||
compileSdkVersion = 26
|
compileSdkVersion = 26
|
||||||
targetSdkVersion = 26
|
targetSdkVersion = 26
|
||||||
buildToolsVersion = '26.0.2'
|
buildToolsVersion = '26.0.2'
|
||||||
supportLibraryVersion = '26.1.0'
|
supportLibraryVersion = '26.1.0'
|
||||||
|
constraintLayoutVersion = '1.1.0-beta3'
|
||||||
|
|
||||||
osmdroidVersion = '5.6.5'
|
osmdroidVersion = '5.6.5'
|
||||||
gsonVersion = '2.8.2'
|
gsonVersion = '2.8.2'
|
||||||
|
|
Loading…
Reference in a new issue