From c6e8c0a7e6a134025c68602bf4a1d6dca9cfc4ec Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Tue, 7 Apr 2020 16:06:44 +0300 Subject: [PATCH] Fix review. --- OsmAnd/res/layout/gpx_track_select_item.xml | 32 +++++++++---------- OsmAnd/res/values/sizes.xml | 2 -- .../osmand/plus/helpers/GpxTrackAdapter.java | 31 ++++++++---------- .../net/osmand/plus/helpers/GpxUiHelper.java | 2 +- 4 files changed, 31 insertions(+), 36 deletions(-) diff --git a/OsmAnd/res/layout/gpx_track_select_item.xml b/OsmAnd/res/layout/gpx_track_select_item.xml index a30f3963da..844b1382f2 100644 --- a/OsmAnd/res/layout/gpx_track_select_item.xml +++ b/OsmAnd/res/layout/gpx_track_select_item.xml @@ -28,8 +28,8 @@ android:layout_marginRight="@dimen/list_content_padding" android:layout_weight="1" android:orientation="vertical" - android:paddingTop="12dp" - android:paddingBottom="12dp"> + android:paddingTop="@dimen/content_padding_small" + android:paddingBottom="@dimen/content_padding_small"> @@ -54,8 +54,8 @@ android:id="@+id/distance_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="@dimen/gpx_select_small_icon_end_margin" - android:layout_marginRight="@dimen/gpx_select_small_icon_end_margin" + android:layout_marginEnd="@dimen/content_padding_half" + android:layout_marginRight="@dimen/content_padding_half" android:src="@drawable/ic_action_distance_16" android:contentDescription="@string/distance" /> @@ -63,8 +63,8 @@ android:id="@+id/distance" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="@dimen/gpx_select_small_text_end_margin" - android:layout_marginRight="@dimen/gpx_select_small_text_end_margin" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginRight="@dimen/content_padding" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" /> @@ -72,8 +72,8 @@ android:id="@+id/points_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="@dimen/gpx_select_small_icon_end_margin" - android:layout_marginRight="@dimen/gpx_select_small_icon_end_margin" + android:layout_marginEnd="@dimen/content_padding_half" + android:layout_marginRight="@dimen/content_padding_half" android:src="@drawable/ic_action_waypoint_16" android:contentDescription="@string/track_points" /> @@ -81,8 +81,8 @@ android:id="@+id/points_count" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="@dimen/gpx_select_small_text_end_margin" - android:layout_marginRight="@dimen/gpx_select_small_text_end_margin" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginRight="@dimen/content_padding" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" tools:text="0" /> @@ -91,8 +91,8 @@ android:id="@+id/time_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="@dimen/gpx_select_small_icon_end_margin" - android:layout_marginRight="@dimen/gpx_select_small_icon_end_margin" + android:layout_marginEnd="@dimen/content_padding_half" + android:layout_marginRight="@dimen/content_padding_half" android:src="@drawable/ic_action_time_16" android:contentDescription="@string/shared_string_time_moving" /> @@ -100,8 +100,8 @@ android:id="@+id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="@dimen/gpx_select_small_text_end_margin" - android:layout_marginRight="@dimen/gpx_select_small_text_end_margin" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginRight="@dimen/content_padding" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" /> diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml index ee6cae6a2c..57f4331982 100644 --- a/OsmAnd/res/values/sizes.xml +++ b/OsmAnd/res/values/sizes.xml @@ -78,8 +78,6 @@ 16dp 34dp 24dp - 8dp - 16dp 3dp 14dp 6dp diff --git a/OsmAnd/src/net/osmand/plus/helpers/GpxTrackAdapter.java b/OsmAnd/src/net/osmand/plus/helpers/GpxTrackAdapter.java index 40a871c5f2..5579414293 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/GpxTrackAdapter.java +++ b/OsmAnd/src/net/osmand/plus/helpers/GpxTrackAdapter.java @@ -29,21 +29,21 @@ import java.util.List; public class GpxTrackAdapter extends RecyclerView.Adapter { private LayoutInflater themedInflater; - private List myImageNameList; + private List gpxInfoList; private OsmandApplication app; private boolean showCurrentGpx; private OnItemClickListener onItemClickListener; private UiUtilities iconsCache; - GpxTrackAdapter(Activity activity, List myImageNameList, boolean showCurrentGpx, + GpxTrackAdapter(Activity activity, List gpxInfoList, boolean showCurrentGpx, OnItemClickListener onItemClickListener) { this.showCurrentGpx = showCurrentGpx; this.onItemClickListener = onItemClickListener; app = (OsmandApplication) activity.getApplication(); - boolean nightMode = !app.getSettings().isLightContent(); + boolean nightMode = app.getDaynightHelper().isNightModeForMapControls(); themedInflater = UiUtilities.getInflater(activity, nightMode); - this.myImageNameList = myImageNameList; + this.gpxInfoList = gpxInfoList; iconsCache = app.getUIUtilities(); } @@ -61,23 +61,29 @@ public class GpxTrackAdapter extends RecyclerView.Adapter list, final ContextMenuAdapter adapter) { final OsmandApplication app = (OsmandApplication) activity.getApplication(); - boolean nightMode = !app.getSettings().isLightContent(); + boolean nightMode = app.getDaynightHelper().isNightModeForMapControls(); final View customLayout = UiUtilities.getInflater(activity, nightMode).inflate(R.layout.gpx_track_select_dialog, null); AlertDialog.Builder builder = new AlertDialog.Builder(UiUtilities.getThemedContext(activity, nightMode)); builder.setView(customLayout);