diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 35853c6..d278be3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,9 +2,13 @@ + + + + diff --git a/app/src/main/java/org/y20k/trackbook/MainActivity.java b/app/src/main/java/org/y20k/trackbook/MainActivity.java index 3eecb80..abbcf9d 100644 --- a/app/src/main/java/org/y20k/trackbook/MainActivity.java +++ b/app/src/main/java/org/y20k/trackbook/MainActivity.java @@ -29,6 +29,7 @@ import android.location.Location; import android.os.Build; import android.os.Bundle; import android.os.Environment; +import android.os.Vibrator; import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -42,6 +43,7 @@ import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.content.ContextCompat; import android.support.v4.content.LocalBroadcastManager; import android.support.v7.app.AppCompatActivity; +import android.support.v7.app.AppCompatDelegate; import android.support.v7.widget.CardView; import android.util.SparseArray; import android.view.MenuItem; @@ -53,6 +55,7 @@ import android.widget.Toast; import org.osmdroid.config.Configuration; import org.y20k.trackbook.helpers.DialogHelper; import org.y20k.trackbook.helpers.LogHelper; +import org.y20k.trackbook.helpers.NightModeHelper; import org.y20k.trackbook.helpers.TrackbookKeys; import org.y20k.trackbook.layout.NonSwipeableViewPager; @@ -91,6 +94,12 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys { private int mSelectedTab; + /* Sets day / night mode */ + static { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM); + } + + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -447,6 +456,14 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys { mainActivityMapFragment.handleShowMyLocation(); } }); + mFloatingActionButtonLocation.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + longPressFeedback(R.string.toastmessage_long_press_night_mode_switch); + NightModeHelper.switchToOpposite(MainActivity.this); + return true; + } + }); } @@ -608,6 +625,18 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys { } + /* Inform user and give haptic feedback (vibration) */ + private void longPressFeedback(int stringResource) { + // inform user + Toast.makeText(this, stringResource, Toast.LENGTH_LONG).show(); + // vibrate 50 milliseconds + Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); + v.vibrate(50); +// v.vibrate(VibrationEffect.createOneShot(50, DEFAULT_AMPLITUDE)); // todo check if there is a support library vibrator + } + + + /* Check which permissions have been granted */ private List checkPermissions() { List permissions = new ArrayList<>(); diff --git a/app/src/main/java/org/y20k/trackbook/MainActivityTrackFragment.java b/app/src/main/java/org/y20k/trackbook/MainActivityTrackFragment.java index 64d56ca..47ff56e 100644 --- a/app/src/main/java/org/y20k/trackbook/MainActivityTrackFragment.java +++ b/app/src/main/java/org/y20k/trackbook/MainActivityTrackFragment.java @@ -467,12 +467,12 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O case BottomSheetBehavior.STATE_EXPANDED: // statistics sheet expanded mTrackManagementLayout.setVisibility(View.INVISIBLE); - mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.trackbook_white_85percent)); + mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.statistic_sheet_background_expanded)); break; case BottomSheetBehavior.STATE_COLLAPSED: // statistics sheet collapsed mTrackManagementLayout.setVisibility(View.VISIBLE); - mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.trackbook_white)); + mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.statistic_sheet_background_collapsed)); mStatisticsSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); break; case BottomSheetBehavior.STATE_HIDDEN: @@ -492,9 +492,9 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O mTrackManagementLayout.setVisibility(View.INVISIBLE); } if (slideOffset < 0.125f) { - mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.trackbook_white)); + mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.statistic_sheet_background_collapsed)); } else { - mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.trackbook_white_85percent)); + mStatisticsSheet.setBackgroundColor(ContextCompat.getColor(mActivity, R.color.statistic_sheet_background_expanded)); } } }; diff --git a/app/src/main/java/org/y20k/trackbook/helpers/NightModeHelper.java b/app/src/main/java/org/y20k/trackbook/helpers/NightModeHelper.java new file mode 100644 index 0000000..2e6c462 --- /dev/null +++ b/app/src/main/java/org/y20k/trackbook/helpers/NightModeHelper.java @@ -0,0 +1,127 @@ +/** + * NightModeHelper.java + * Implements the NightModeHelper class + * A NightModeHelper can toggle and restore the state of the theme's Night Mode + * + * This file is part of + * TRACKBOOK - Movement Recorder for Android + * + * Copyright (c) 2016-18 - 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.helpers; + +import android.app.Activity; +import android.content.Context; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.os.Build; +import android.preference.PreferenceManager; +import android.support.v7.app.AppCompatDelegate; +import android.view.View; + + +/** + * NightModeHelper class + */ +public final class NightModeHelper implements TrackbookKeys { + + + /* Define log tag */ + private static final String LOG_TAG = NightModeHelper.class.getSimpleName(); + + + /* Switches to opposite theme */ + public static void switchToOpposite(Activity activity) { + switch (getCurrentNightModeState(activity)) { + case Configuration.UI_MODE_NIGHT_NO: + // night mode is currently not active - turn on night mode + activateNightMode(activity); + break; + case Configuration.UI_MODE_NIGHT_YES: + // night mode is currently active - turn off night mode + deactivateNightMode(activity); + break; + case Configuration.UI_MODE_NIGHT_UNDEFINED: + // don't know what mode is active - turn off night mode + deactivateNightMode(activity); + break; + } + activity.recreate(); // todo check if necessary + } + + + /* Sets night mode / dark theme */ + public static void restoreSavedState(Activity activity) { + int savedNightModeState = loadNightModeState(activity); + int currentNightModeState = getCurrentNightModeState(activity); + LogHelper.i(LOG_TAG, "Saved state of Night Mode = " + savedNightModeState + " || current state of Night Mode = " + currentNightModeState + " || NO=16 & YES=32"); // todo remove + if (savedNightModeState != -1 && savedNightModeState != currentNightModeState) { +// switch (savedNightModeState) { +// case Configuration.UI_MODE_NIGHT_NO: +// // turn off night mode +// deactivateNightMode(activity); +// break; +// case Configuration.UI_MODE_NIGHT_YES: +// // turn on night mode +// activateNightMode(activity); +// break; +// case Configuration.UI_MODE_NIGHT_UNDEFINED: +// // turn off night mode +// deactivateNightMode(activity); +// break; +// } +// activity.recreate(); // todo check if necessary + } + } + + + /* Returns state of night mode */ + private static int getCurrentNightModeState(Context context) { + return context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; + } + + + /* Activates Night Mode */ + private static void activateNightMode(Activity activity) { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + View decorView = activity.getWindow().getDecorView(); + decorView.setSystemUiVisibility(0); + saveNightModeState(activity, Configuration.UI_MODE_NIGHT_NO); + } + + + /* Deactivates Night Mode */ + private static void deactivateNightMode(Activity activity) { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); + View decorView = activity.getWindow().getDecorView(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } else { + decorView.setSystemUiVisibility(0); + } + saveNightModeState(activity, Configuration.UI_MODE_NIGHT_YES); + } + + + /* Save state of night mode */ + private static void saveNightModeState(Context context, int currentState) { + SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); + SharedPreferences.Editor editor = settings.edit(); + editor.putInt(PREF_NIGHT_MODE_STATE, currentState); + editor.apply(); + } + + + /* Load state of Night Mode */ + private static int loadNightModeState(Context context) { + return PreferenceManager.getDefaultSharedPreferences(context).getInt(PREF_NIGHT_MODE_STATE, -1); + } + +} + diff --git a/app/src/main/java/org/y20k/trackbook/helpers/TrackbookKeys.java b/app/src/main/java/org/y20k/trackbook/helpers/TrackbookKeys.java index c2e694a..81663cc 100644 --- a/app/src/main/java/org/y20k/trackbook/helpers/TrackbookKeys.java +++ b/app/src/main/java/org/y20k/trackbook/helpers/TrackbookKeys.java @@ -51,6 +51,7 @@ public interface TrackbookKeys { String PREFS_FAB_STATE = "fabStatePrefs"; String PREFS_TRACKER_SERVICE_RUNNING = "trackerServiceRunning"; String PREFS_CURRENT_TRACK_DURATION = "currentTrackDuration"; + String PREF_NIGHT_MODE_STATE = "prefNightModeState"; /* INSTANCE STATE */ String INSTANCE_FIRST_START = "firstStart"; diff --git a/app/src/main/res/drawable/ic_delete_forever_grey_24dp.xml b/app/src/main/res/drawable/ic_delete_forever_24dp.xml similarity index 88% rename from app/src/main/res/drawable/ic_delete_forever_grey_24dp.xml rename to app/src/main/res/drawable/ic_delete_forever_24dp.xml index 57b27aa..d61792d 100644 --- a/app/src/main/res/drawable/ic_delete_forever_grey_24dp.xml +++ b/app/src/main/res/drawable/ic_delete_forever_24dp.xml @@ -5,5 +5,5 @@ android:viewportHeight="24.0"> + android:fillColor="@color/track_management_icons" /> diff --git a/app/src/main/res/drawable/ic_delete_forever_white_24dp.xml b/app/src/main/res/drawable/ic_delete_forever_white_24dp.xml deleted file mode 100644 index e96a47c..0000000 --- a/app/src/main/res/drawable/ic_delete_forever_white_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_export_white_24dp.xml b/app/src/main/res/drawable/ic_export_white_24dp.xml deleted file mode 100644 index f82a153..0000000 --- a/app/src/main/res/drawable/ic_export_white_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_file_download_white_24dp.xml b/app/src/main/res/drawable/ic_file_download_24dp.xml similarity index 82% rename from app/src/main/res/drawable/ic_file_download_white_24dp.xml rename to app/src/main/res/drawable/ic_file_download_24dp.xml index 3e6cb05..2ac4629 100644 --- a/app/src/main/res/drawable/ic_file_download_white_24dp.xml +++ b/app/src/main/res/drawable/ic_file_download_24dp.xml @@ -5,5 +5,5 @@ android:viewportHeight="24.0"> + android:fillColor="@color/track_management_icons" /> diff --git a/app/src/main/res/drawable/ic_file_download_grey_24dp.xml b/app/src/main/res/drawable/ic_file_download_grey_24dp.xml deleted file mode 100644 index 1e5bf77..0000000 --- a/app/src/main/res/drawable/ic_file_download_grey_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_info_grey_24dp.xml b/app/src/main/res/drawable/ic_info_24dp.xml similarity index 86% rename from app/src/main/res/drawable/ic_info_grey_24dp.xml rename to app/src/main/res/drawable/ic_info_24dp.xml index b49c82e..b701d0e 100644 --- a/app/src/main/res/drawable/ic_info_grey_24dp.xml +++ b/app/src/main/res/drawable/ic_info_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> + 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" + android:fillColor="@color/statistic_sheet_icons" /> diff --git a/app/src/main/res/drawable/ic_info_white_24dp.xml b/app/src/main/res/drawable/ic_info_white_24dp.xml deleted file mode 100644 index de69530..0000000 --- a/app/src/main/res/drawable/ic_info_white_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_my_location_grey_24dp.xml b/app/src/main/res/drawable/ic_my_location_24dp.xml similarity index 91% rename from app/src/main/res/drawable/ic_my_location_grey_24dp.xml rename to app/src/main/res/drawable/ic_my_location_24dp.xml index 28aacd1..79d5816 100644 --- a/app/src/main/res/drawable/ic_my_location_grey_24dp.xml +++ b/app/src/main/res/drawable/ic_my_location_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_track_calendar_white_24dp.xml b/app/src/main/res/drawable/ic_track_calendar_white_24dp.xml deleted file mode 100644 index 0cc338b..0000000 --- a/app/src/main/res/drawable/ic_track_calendar_white_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index f1ab3c9..a93b03f 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -23,12 +23,12 @@ android:clickable="true" android:focusable="true" android:contentDescription="@string/descr_fab_my_location" - app:backgroundTint="@color/trackbook_white" + app:backgroundTint="@color/location_buttom_background" 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" /> + app:srcCompat="@drawable/ic_my_location_24dp" /> @@ -56,7 +56,7 @@ android:clickable="true" android:focusable="true" android:contentDescription="@string/descr_fab_sub_menu_label_1" - app:cardBackgroundColor="@color/trackbook_white" + app:cardBackgroundColor="@color/fab_button_card_background" app:cardCornerRadius="4dp" app:cardElevation="4dp" app:cardUseCompatPadding="true" @@ -72,7 +72,8 @@ android:paddingRight="6dp" android:paddingTop="2dp" android:text="@string/fab_sub_menu_save" - android:textAppearance="?android:attr/textAppearanceSmall" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="@color/fab_button_card_text" android:textStyle="bold" tools:layout_editor_absoluteX="110dp" tools:layout_editor_absoluteY="239dp" /> @@ -103,7 +104,7 @@ android:clickable="true" android:focusable="true" android:contentDescription="@string/descr_fab_sub_menu_label_2" - app:cardBackgroundColor="@color/trackbook_white" + app:cardBackgroundColor="@color/fab_button_card_background" app:cardCornerRadius="4dp" app:cardElevation="4dp" app:cardUseCompatPadding="true" @@ -119,7 +120,8 @@ android:paddingRight="6dp" android:paddingTop="2dp" android:text="@string/fab_sub_menu_clear" - android:textAppearance="?android:attr/textAppearanceSmall" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="@color/fab_button_card_text" android:textStyle="bold" tools:layout_editor_absoluteX="124dp" tools:layout_editor_absoluteY="447dp" /> @@ -148,7 +150,7 @@ android:id="@+id/navigation" android:layout_width="0dp" android:layout_height="wrap_content" - android:background="@color/trackbook_red" + android:background="@color/bottom_navigation_background" android:clickable="true" android:focusable="true" app:itemIconTint="@drawable/selector_bottom_navigation" diff --git a/app/src/main/res/layout/custom_dropdown_item_collapsed.xml b/app/src/main/res/layout/custom_dropdown_item_collapsed.xml index 759026b..7fd0097 100644 --- a/app/src/main/res/layout/custom_dropdown_item_collapsed.xml +++ b/app/src/main/res/layout/custom_dropdown_item_collapsed.xml @@ -7,6 +7,7 @@ android:paddingBottom="@dimen/activity_vertical_margin" android:paddingStart="@dimen/activity_horizontal_margin" android:paddingEnd="@dimen/activity_horizontal_margin" - android:textColor="@color/trackbook_grey" + android:textColor="@color/track_management_text" + android:background="@color/track_management_background" android:ellipsize="marquee" android:singleLine="true" /> \ No newline at end of file diff --git a/app/src/main/res/layout/custom_dropdown_item_expanded.xml b/app/src/main/res/layout/custom_dropdown_item_expanded.xml index f1d4db5..7fd0097 100644 --- a/app/src/main/res/layout/custom_dropdown_item_expanded.xml +++ b/app/src/main/res/layout/custom_dropdown_item_expanded.xml @@ -7,7 +7,7 @@ android:paddingBottom="@dimen/activity_vertical_margin" android:paddingStart="@dimen/activity_horizontal_margin" android:paddingEnd="@dimen/activity_horizontal_margin" - android:textColor="@color/trackbook_grey" - android:background="@color/trackbook_white" + android:textColor="@color/track_management_text" + android:background="@color/track_management_background" android:ellipsize="marquee" android:singleLine="true" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_main_track.xml b/app/src/main/res/layout/fragment_main_track.xml index 01a8307..d7ca6ed 100644 --- a/app/src/main/res/layout/fragment_main_track.xml +++ b/app/src/main/res/layout/fragment_main_track.xml @@ -34,7 +34,7 @@ android:layout_width="@dimen/bottom_sheet_width" android:layout_height="match_parent" android:layout_gravity="center_horizontal" - android:background="@color/trackbook_white" + android:background="@color/statistic_sheet_background_expanded" app:behavior_hideable="false" app:behavior_peekHeight="54dp" app:layout_behavior="android.support.design.widget.BottomSheetBehavior"> diff --git a/app/src/main/res/layout/fragment_main_track_management.xml b/app/src/main/res/layout/fragment_main_track_management.xml index 9e6085c..5024680 100644 --- a/app/src/main/res/layout/fragment_main_track_management.xml +++ b/app/src/main/res/layout/fragment_main_track_management.xml @@ -5,7 +5,7 @@ android:layout_width="@dimen/bottom_sheet_width" android:layout_height="wrap_content" android:layout_centerHorizontal="true" - android:background="@color/trackbook_white"> + android:background="@color/track_management_background"> + app:srcCompat="@drawable/ic_file_download_24dp" /> + app:srcCompat="@drawable/ic_delete_forever_24dp" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_main_track_statistics.xml b/app/src/main/res/layout/fragment_main_track_statistics.xml index f5a35e2..2a5fa2e 100644 --- a/app/src/main/res/layout/fragment_main_track_statistics.xml +++ b/app/src/main/res/layout/fragment_main_track_statistics.xml @@ -22,6 +22,7 @@ android:text="@string/statistics_sheet_h1_statistics" android:textAllCaps="true" android:textAppearance="@android:style/TextAppearance.Medium" + android:textColor="@color/statistic_sheet_text" android:textStyle="bold" app:layout_constraintEnd_toStartOf="@+id/statistics_icon" app:layout_constraintStart_toStartOf="parent" @@ -37,7 +38,7 @@ app:layout_constraintBottom_toBottomOf="@+id/statistics_headline" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="@+id/statistics_headline" - app:srcCompat="@drawable/ic_info_grey_24dp" /> + app:srcCompat="@drawable/ic_info_24dp" /> @@ -57,7 +59,8 @@ android:layout_marginStart="16dp" android:contentDescription="@string/descr_statistics_sheet_p_distance_value" android:text="@string/statistics_sheet_p_default_data" - android:textAppearance="@android:style/TextAppearance.Material.Medium" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@color/statistic_sheet_text" app:layout_constraintBottom_toBottomOf="@+id/statistics_p_distance" app:layout_constraintStart_toEndOf="@+id/statistics_p_distance" app:layout_constraintTop_toTopOf="@+id/statistics_p_distance" /> @@ -68,6 +71,8 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:contentDescription="@string/descr_statistics_sheet_p_steps" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_steps" app:layout_constraintStart_toStartOf="@+id/statistics_p_distance" app:layout_constraintTop_toBottomOf="@+id/statistics_p_distance" /> @@ -79,7 +84,8 @@ android:layout_marginStart="16dp" android:contentDescription="@string/descr_statistics_sheet_p_steps_value" android:text="@string/statistics_sheet_p_default_data" - android:textAppearance="@android:style/TextAppearance.Material.Medium" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@color/statistic_sheet_text" app:layout_constraintBottom_toBottomOf="@+id/statistics_p_steps" app:layout_constraintStart_toEndOf="@+id/statistics_p_steps" app:layout_constraintTop_toTopOf="@+id/statistics_p_steps" /> @@ -90,6 +96,8 @@ android:layout_height="0dp" android:layout_marginTop="16dp" android:contentDescription="@string/descr_statistics_sheet_p_waypoints" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_waypoints" app:layout_constraintStart_toStartOf="@+id/statistics_p_steps" app:layout_constraintTop_toBottomOf="@+id/statistics_p_steps" /> @@ -101,7 +109,8 @@ android:layout_marginStart="16dp" android:contentDescription="@string/descr_statistics_sheet_p_waypoints_value" android:text="@string/statistics_sheet_p_default_data" - android:textAppearance="@android:style/TextAppearance.Material.Medium" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@color/statistic_sheet_text" app:layout_constraintBottom_toBottomOf="@+id/statistics_p_waypoints" app:layout_constraintStart_toEndOf="@+id/statistics_p_waypoints" app:layout_constraintTop_toTopOf="@+id/statistics_p_waypoints" /> @@ -112,6 +121,8 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:contentDescription="@string/descr_statistics_sheet_p_duration" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_duration" app:layout_constraintStart_toStartOf="@+id/statistics_p_waypoints" app:layout_constraintTop_toBottomOf="@+id/statistics_p_waypoints" /> @@ -123,7 +134,8 @@ android:layout_marginStart="16dp" android:contentDescription="@string/descr_statistics_sheet_p_duration_value" android:text="@string/statistics_sheet_p_default_data" - android:textAppearance="@android:style/TextAppearance.Material.Medium" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@color/statistic_sheet_text" app:layout_constraintBottom_toBottomOf="@+id/statistics_p_duration" app:layout_constraintStart_toEndOf="@+id/statistics_p_duration" app:layout_constraintTop_toTopOf="@+id/statistics_p_duration" /> @@ -134,6 +146,8 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:contentDescription="@string/descr_statistics_sheet_p_recording_start" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_recording_start" app:layout_constraintStart_toStartOf="@+id/statistics_p_duration" app:layout_constraintTop_toBottomOf="@+id/statistics_p_duration" /> @@ -145,7 +159,8 @@ android:layout_marginStart="16dp" android:contentDescription="@string/descr_statistics_sheet_p_recording_start_value" android:text="@string/statistics_sheet_p_default_data" - android:textAppearance="@android:style/TextAppearance.Material.Medium" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@color/statistic_sheet_text" app:layout_constraintBottom_toBottomOf="@+id/statistics_p_recording_start" app:layout_constraintStart_toEndOf="@+id/statistics_p_recording_start" app:layout_constraintTop_toTopOf="@+id/statistics_p_recording_start" /> @@ -156,6 +171,8 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:contentDescription="@string/descr_statistics_sheet_p_recording_end" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_recording_stop" app:layout_constraintStart_toStartOf="@+id/statistics_p_recording_start" app:layout_constraintTop_toBottomOf="@+id/statistics_p_recording_start" /> @@ -167,7 +184,8 @@ android:layout_marginStart="16dp" android:contentDescription="@string/descr_statistics_sheet_p_recording_end_value" android:text="@string/statistics_sheet_p_default_data" - android:textAppearance="@android:style/TextAppearance.Material.Medium" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@color/statistic_sheet_text" app:layout_constraintBottom_toBottomOf="@+id/statistics_p_recording_stop" app:layout_constraintStart_toEndOf="@+id/statistics_p_recording_stop" app:layout_constraintTop_toTopOf="@+id/statistics_p_recording_stop" /> @@ -178,6 +196,8 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:contentDescription="@string/descr_statistics_sheet_p_positive_elevation" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_positive_elevation" app:layout_constraintStart_toStartOf="@+id/statistics_p_recording_stop" app:layout_constraintTop_toBottomOf="@+id/statistics_p_recording_stop" /> @@ -187,8 +207,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="16dp" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_default_data" - android:textAppearance="@android:style/TextAppearance.Material.Medium" app:layout_constraintBottom_toBottomOf="@+id/statistics_p_positive_elevation" app:layout_constraintStart_toEndOf="@+id/statistics_p_positive_elevation" app:layout_constraintTop_toTopOf="@+id/statistics_p_positive_elevation" /> @@ -199,6 +220,8 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:contentDescription="@string/descr_statistics_sheet_p_negative_elevation" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_negative_elevation" app:layout_constraintStart_toStartOf="@+id/statistics_p_positive_elevation" app:layout_constraintTop_toBottomOf="@+id/statistics_p_positive_elevation" /> @@ -208,8 +231,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="16dp" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_default_data" - android:textAppearance="@android:style/TextAppearance.Material.Medium" app:layout_constraintBottom_toBottomOf="@+id/statistics_p_negative_elevation" app:layout_constraintStart_toEndOf="@+id/statistics_p_negative_elevation" app:layout_constraintTop_toTopOf="@+id/statistics_p_negative_elevation" /> @@ -220,6 +244,8 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:contentDescription="@string/descr_statistics_sheet_p_max_altitude" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_max_altitude" app:layout_constraintStart_toStartOf="@+id/statistics_p_negative_elevation" app:layout_constraintTop_toBottomOf="@+id/statistics_p_negative_elevation" /> @@ -229,8 +255,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="16dp" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_default_data" - android:textAppearance="@android:style/TextAppearance.Material.Medium" app:layout_constraintBottom_toBottomOf="@+id/statistics_p_max_altitude" app:layout_constraintStart_toEndOf="@+id/statistics_p_max_altitude" app:layout_constraintTop_toTopOf="@+id/statistics_p_max_altitude" /> @@ -242,6 +269,8 @@ android:layout_marginBottom="16dp" android:layout_marginTop="16dp" android:contentDescription="@string/descr_statistics_sheet_p_min_altitude" + android:textAppearance="@style/TextAppearance.AppCompat.Small" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_min_altitude" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="@+id/statistics_p_max_altitude" @@ -252,8 +281,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="16dp" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@color/statistic_sheet_text" android:text="@string/statistics_sheet_p_default_data" - android:textAppearance="@android:style/TextAppearance.Material.Medium" app:layout_constraintBottom_toBottomOf="@+id/statistics_p_min_altitude" app:layout_constraintStart_toEndOf="@+id/statistics_p_min_altitude" app:layout_constraintTop_toTopOf="@+id/statistics_p_min_altitude" /> diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index b2722fd..ec1d41c 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -53,6 +53,7 @@ GPX-Export erfolgreich: GPX-Export fehlgeschlagen: Hinweis: Die Genauogkeit der Höhenmeter-Werte ist geräteabhängig. Gemessen werden die Steigungen und Gefälle der Gesamtstrecke. + Schalter für Nachtmodus (Längeres Drücken erkannt) Quelle diff --git a/app/src/main/res/values-id/strings.xml b/app/src/main/res/values-id/strings.xml index 1d84eb2..e0a71dd 100644 --- a/app/src/main/res/values-id/strings.xml +++ b/app/src/main/res/values-id/strings.xml @@ -53,6 +53,7 @@ GPX export successful: GPX export failed: Hint: The accuracy of elevation data depends on your device. The uphill and downhill elevation of the whole route is measured. + Night mode switch (long press detected) Source diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 6a7e81f..580bba5 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -53,6 +53,7 @@ L\'esportazione GPX è riuscita: L\'esportazione GPX non è riuscita: Hint: The accuracy of elevation data depends on your device. The uphill and downhill elevation of the whole route is measured. + Night mode switch (long press detected) Fonte diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index a2ab07f..2858d0e 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -53,6 +53,7 @@ GPX のエクスポートが完了しました: GPX のエクスポートに失敗しました: ヒント: 標高データの精度は、お使いのデバイスによって異なります。ルート全体の上り坂と下り坂の標高を測定します。 + Night mode switch (long press detected) ソース diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index a4894be..04c41fc 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -53,6 +53,7 @@ GPX-eksportering vellykket: GPX-eksportering mislyktes: Hint: Høydedataens nøyaktighet avhenger av enheten din. Opp og ned-stigningen for hele ruten måles. + Night mode switch (long press detected) Kilde diff --git a/app/src/main/res/values-night-v23/styles.xml b/app/src/main/res/values-night-v23/styles.xml new file mode 100644 index 0000000..75f2741 --- /dev/null +++ b/app/src/main/res/values-night-v23/styles.xml @@ -0,0 +1,24 @@ + + + + + + + + + + diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml new file mode 100644 index 0000000..e605cd5 --- /dev/null +++ b/app/src/main/res/values-night/colors.xml @@ -0,0 +1,23 @@ + + + + + @color/trackbook_black + @color/trackbook_black + + @color/trackbook_white + @color/trackbook_grey_dark + + @color/trackbook_white + @color/trackbook_grey_dark + + @color/trackbook_white + @color/trackbook_white + @color/trackbook_black + + @color/trackbook_white + @color/trackbook_white + @color/trackbook_black_85percent + @color/trackbook_black + + diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 41728fa..6cf909f 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -53,6 +53,7 @@ GPX export successful: GPX export failed: Hint: The accuracy of elevation data depends on your device. The uphill and downhill elevation of the whole route is measured. + Night mode switch (long press detected) Bron diff --git a/app/src/main/res/values-v23/styles.xml b/app/src/main/res/values-v23/styles.xml index 0335113..48833b1 100644 --- a/app/src/main/res/values-v23/styles.xml +++ b/app/src/main/res/values-v23/styles.xml @@ -2,28 +2,23 @@ - - - - - - - - diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 735b5eb..aa74a60 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,6 +1,27 @@ + + @color/trackbook_white + @color/trackbook_red + + @color/trackbook_grey_dark + @color/trackbook_white + + @color/trackbook_grey + @color/trackbook_white + + @color/trackbook_grey_dark + @color/trackbook_grey_dark + @color/trackbook_white + + @color/trackbook_grey_dark + @color/trackbook_grey_dark + @color/trackbook_white_85percent + @color/trackbook_white + + + #FFD93025 #FFB31412 #D9D93025 @@ -16,6 +37,7 @@ #FFFFFFFF #D9FFFFFF #FF000000 + #D9000000 #FFD2D6DA #FFBDC1C6 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a225894..2c653fa 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -53,6 +53,7 @@ GPX export successful: GPX export failed: Hint: The accuracy of elevation data depends on your device. The uphill and downhill elevation of the whole route is measured. + Night mode switch (long press detected) Source diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index d0d375b..e44f5f3 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -2,25 +2,18 @@ - - - - - - - - -