From db71ae697f3572b60272848cce0952fc77458cdb Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Mon, 30 Oct 2023 23:37:27 +0300 Subject: [PATCH] Change route instructions layout --- .../main/java/mobi/maptrek/MainActivity.java | 9 ++- app/src/main/res/layout/activity_main.xml | 78 ++++++++++++------- 2 files changed, 55 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/mobi/maptrek/MainActivity.java b/app/src/main/java/mobi/maptrek/MainActivity.java index bea3f898..4409edfa 100644 --- a/app/src/main/java/mobi/maptrek/MainActivity.java +++ b/app/src/main/java/mobi/maptrek/MainActivity.java @@ -2431,26 +2431,27 @@ private void updateNavigationGauges(boolean updateRoutePanels) { mViews.navigationSign.setImageDrawable(signDrawable); int color = getResources().getColor(R.color.panelBackground, getTheme()); mViews.routeWaypoint.setBackgroundColor(color); - mViews.navigationSign.setBackgroundColor(color); + mViews.routeSignBackground.setBackgroundColor(color); mViews.navigationSign.setTag(false); } mViews.routeWptDistance.setText(StringFormatter.distanceH(mNavigationService.getWptDistance())); int ete = mNavigationService.getWptEte(); if (ete == Integer.MAX_VALUE) { - mViews.routeWptEte.setText("-"); + mViews.routeWptEte.setVisibility(View.GONE); } else { + mViews.routeWptEte.setVisibility(View.VISIBLE); mViews.routeWptEte.setText(StringFormatter.timeH(ete)); if (ete <= 1) { if (!Boolean.TRUE.equals(mViews.navigationSign.getTag())) { int color = getResources().getColor(R.color.panelAccentBackground, getTheme()); mViews.routeWaypoint.setBackgroundColor(color); - mViews.navigationSign.setBackgroundColor(color); + mViews.routeSignBackground.setBackgroundColor(color); mViews.navigationSign.setTag(true); } } else if (Boolean.TRUE.equals(mViews.navigationSign.getTag())) { int color = getResources().getColor(R.color.panelBackground, getTheme()); mViews.routeWaypoint.setBackgroundColor(color); - mViews.navigationSign.setBackgroundColor(color); + mViews.routeSignBackground.setBackgroundColor(color); mViews.navigationSign.setTag(false); } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 0f1dd55a..b2f67bec 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -78,60 +78,82 @@ app:layout_constraintTop_toTopOf="parent" tools:visibility="visible"> + + + + + + - - + tools:ignore="ContentDescription" + tools:src="@drawable/instruction_turn_right" /> + +