Track tab - GPX Context menu

Change UI for statistic block (Distance, Timespan etc). The text should be on the left and icon on the right, the icon is 16dp (currently is used big 24dp icons)

Options edit, delete, split interval
This commit is contained in:
androiddevkotlin 2021-01-20 22:19:27 +02:00
parent 09827cd895
commit a4cc3f83c8
8 changed files with 563 additions and 715 deletions

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color">
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
@ -15,8 +15,8 @@
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_gravity="center_vertical"/>
android:layout_height="@dimen/list_item_description_width"
android:layout_gravity="center_vertical" />
<LinearLayout
android:id="@+id/gpx_join_gaps_container"
@ -32,14 +32,14 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:text="@string/join_segments"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
osmand:typeface="@string/font_roboto_regular" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/gpx_join_gaps_switch"
@ -49,10 +49,10 @@
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding" />
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding" />
</LinearLayout>
@ -61,242 +61,98 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="13dp"
android:paddingBottom="11dp">
android:paddingTop="@dimen/context_menu_first_line_top_margin"
android:paddingBottom="@dimen/content_padding_small">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingStart="16dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/average_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_altitude_average"/>
android:layout_marginStart="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/average_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="40 m"
android:textColor="?android:attr/textColorPrimary"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/average_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="3dp"
android:text="@string/average_altitude"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/average_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="40 m" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/average_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="@dimen/subHeaderPadding"
osmand:srcCompat="@drawable/ic_action_altitude_average" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/content_padding_small"
android:layout_marginLeft="@dimen/content_padding_small"
android:layout_marginEnd="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_weight="1"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingStart="16dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/range_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_altitude_average"/>
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/range_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="30m - 53m"
android:textColor="?android:attr/textColorPrimary"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/range_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="3dp"
android:text="@string/altitude_range"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/list_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="8dp"
android:paddingStart="16dp"
android:paddingEnd="8dp">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:paddingLeft="8dp"
android:paddingRight="16dp"
android:paddingStart="8dp"
android:paddingEnd="16dp">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ascent_descent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="13dp"
android:paddingBottom="11dp">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingStart="16dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ascent_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_altitude_ascent"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/ascent_text"
android:id="@+id/range_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="174"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
<TextView
android:id="@+id/ascent_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="3dp"
android:text="@string/altitude_ascent"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
tools:text="30m - 53m" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingStart="16dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/descent_icon"
android:id="@+id/range_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_altitude_descent"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/descent_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="164"
android:textColor="?android:attr/textColorPrimary"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
<TextView
android:id="@+id/descent_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="3dp"
android:text="@string/altitude_descent"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
</LinearLayout>
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="@dimen/subHeaderPadding"
osmand:srcCompat="@drawable/ic_action_altitude_average" />
</LinearLayout>
@ -305,61 +161,157 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
android:layout_marginStart="@dimen/content_padding_small"
android:layout_marginLeft="@dimen/content_padding_small"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:background="?attr/dashboard_divider" />
<LinearLayout
android:id="@+id/ascent_descent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="@dimen/context_menu_first_line_top_margin"
android:paddingBottom="@dimen/content_padding_small">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/ascent_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:text="@string/altitude_ascent"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/ascent_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="174" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ascent_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="@dimen/subHeaderPadding"
osmand:srcCompat="@drawable/ic_action_altitude_ascent" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/descent_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:text="@string/altitude_descent"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/descent_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="164" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/descent_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="@dimen/subHeaderPadding"
osmand:srcCompat="@drawable/ic_action_altitude_descent" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider" />
<LinearLayout
android:id="@+id/details_view"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:gravity="center">
<ImageButton
android:visibility="gone"
tools:visibility="visible"
android:id="@+id/overflow_menu"
android:background="@null"
android:paddingRight="16dp"
android:paddingLeft="16dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
tools:src="@drawable/ic_overflow_menu_dark"
android:paddingStart="16dp"
android:paddingEnd="16dp" />
android:gravity="center"
android:orientation="horizontal">
<net.osmand.plus.widgets.TextViewEx
android:background="?attr/selectableItemBackground"
android:id="@+id/split_interval"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="start|center_vertical"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_sub_text_size"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"
android:text="@string/gpx_split_interval"
android:paddingEnd="16dp"
android:paddingStart="16dp" />
<net.osmand.plus.widgets.TextViewEx
android:background="?attr/selectableItemBackground"
android:id="@+id/analyze_on_map"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="end|center_vertical"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_sub_text_size"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"
android:layout_weight="1"
android:background="?attr/selectableItemBackground"
android:gravity="start|center_vertical"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:text="@string/analyze_on_map"
android:paddingEnd="16dp"
android:paddingStart="16dp" />
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/overflow_menu"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/selectableItemBackground"
android:gravity="end|center_vertical"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:text="@string/shared_string_options"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />
</LinearLayout>

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color">
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
@ -15,8 +15,8 @@
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_gravity="center_vertical"/>
android:layout_height="@dimen/list_item_description_width"
android:layout_gravity="center_vertical" />
<LinearLayout
android:id="@+id/gpx_join_gaps_container"
@ -32,14 +32,14 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:text="@string/join_segments"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
osmand:typeface="@string/font_roboto_regular" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/gpx_join_gaps_switch"
@ -49,10 +49,10 @@
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding" />
</LinearLayout>
@ -61,144 +61,112 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="13dp"
android:paddingBottom="11dp">
android:paddingTop="@dimen/context_menu_first_line_top_margin"
android:paddingBottom="@dimen/content_padding">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingStart="16dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/distance_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_polygom_dark"/>
android:layout_marginStart="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/distance_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="40 km"
android:textColor="?android:attr/textColorPrimary"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/distance_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="3dp"
android:text="@string/distance"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/distance_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="40 km" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/distance_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="@dimen/subHeaderPadding"
osmand:srcCompat="@drawable/ic_action_distance_16" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:layout_weight="1"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingStart="16dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/duration_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_time_start"/>
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/duration_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="3:32:44"
android:textColor="?android:attr/textColorPrimary"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/duration_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="3dp"
android:text="@string/shared_string_time_span"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/duration_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="3:32:44" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/duration_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="@dimen/subHeaderPadding"
osmand:srcCompat="@drawable/ic_action_time_span_16" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/list_divider"
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding_half"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding_half">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:paddingLeft="@dimen/content_padding_half"
android:paddingRight="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding_half">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
</LinearLayout>
</LinearLayout>
android:layout_height="1dp"
android:layout_marginStart="@dimen/content_padding_small"
android:layout_marginLeft="@dimen/content_padding_small"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:background="?attr/dashboard_divider" />
<LinearLayout
android:id="@+id/start_end_time"
@ -210,112 +178,112 @@
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="@dimen/content_padding"
android:paddingStart="@dimen/content_padding">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/start_time_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_time_start"/>
android:layout_marginStart="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/start_time_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="15:04:58"
android:textColor="?android:attr/textColorPrimary"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
<TextView
android:id="@+id/start_date_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="Aug 8, 2016"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_desc_text_size"/>
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/start_time_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="@dimen/content_padding_half"
android:text="@string/shared_string_start_time"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/start_time_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="15:04:58" />
<TextView
android:id="@+id/start_date_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_desc_text_size"
tools:text="Aug 8, 2016" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/start_time_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="@dimen/subHeaderPadding"
osmand:srcCompat="@drawable/ic_action_time_start_16" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:layout_weight="1"
android:orientation="horizontal"
android:paddingLeft="@dimen/content_padding"
android:paddingStart="@dimen/content_padding">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/end_time_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_time_start"/>
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/end_time_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="20:58:00"
android:textColor="?android:attr/textColorPrimary"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
<TextView
android:id="@+id/end_date_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="Aug 8, 2016"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_desc_text_size"/>
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/end_time_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="@dimen/content_padding_half"
android:text="@string/shared_string_end_time"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/end_time_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="20:58:00" />
<TextView
android:id="@+id/end_date_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_desc_text_size"
tools:text="Aug 8, 2016" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/end_time_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="@dimen/subHeaderPadding"
osmand:srcCompat="@drawable/ic_action_time_end_16" />
</LinearLayout>
</LinearLayout>
@ -323,61 +291,46 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
android:background="?attr/dashboard_divider" />
<LinearLayout
android:id="@+id/details_view"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:gravity="center">
<ImageButton
android:visibility="gone"
tools:visibility="visible"
android:id="@+id/overflow_menu"
android:background="@null"
android:paddingRight="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:layout_width="wrap_content"
android:layout_height="match_parent"
tools:src="@drawable/ic_overflow_menu_dark"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
android:gravity="center"
android:orientation="horizontal">
<net.osmand.plus.widgets.TextViewEx
android:background="?attr/selectableItemBackground"
android:id="@+id/split_interval"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:gravity="start|center_vertical"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_sub_text_size"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"
android:text="@string/gpx_split_interval"
android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding" />
<net.osmand.plus.widgets.TextViewEx
android:background="?attr/selectableItemBackground"
android:id="@+id/analyze_on_map"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/selectableItemBackground"
android:gravity="start|center_vertical"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:gravity="end|center_vertical"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_sub_text_size"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"
android:text="@string/analyze_on_map"
android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding" />
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/overflow_menu"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/selectableItemBackground"
android:gravity="end|center_vertical"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:text="@string/shared_string_options"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />
</LinearLayout>

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color">
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
@ -16,7 +16,7 @@
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_gravity="center_vertical"/>
android:layout_gravity="center_vertical" />
<LinearLayout
android:id="@+id/gpx_join_gaps_container"
@ -32,14 +32,14 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:text="@string/join_segments"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
osmand:typeface="@string/font_roboto_regular" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/gpx_join_gaps_switch"
@ -49,10 +49,10 @@
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding" />
</LinearLayout>
@ -66,139 +66,106 @@
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="@dimen/content_padding"
android:paddingStart="@dimen/content_padding">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/average_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_speed"/>
android:layout_marginStart="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/average_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="6.8 km/h"
android:textColor="?android:attr/textColorPrimary"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/average_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="3dp"
android:text="@string/average_speed"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/average_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="6.8 km/h" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/average_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="2dp"
osmand:srcCompat="@drawable/ic_action_speed" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/content_padding_small"
android:layout_marginLeft="@dimen/content_padding_small"
android:layout_marginEnd="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_weight="1"
android:orientation="horizontal"
android:paddingLeft="@dimen/content_padding"
android:paddingStart="@dimen/content_padding">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/max_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_max_speed"/>
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/max_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="31.3 km/h"
android:textColor="?android:attr/textColorPrimary"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/max_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="3dp"
android:text="@string/max_speed"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/max_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="31.3 km/h" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/max_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="2dp"
osmand:srcCompat="@drawable/ic_action_max_speed_16" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/list_divider"
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding_half"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding_half">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:paddingLeft="@dimen/content_padding_half"
android:paddingRight="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding_half">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
</LinearLayout>
</LinearLayout>
android:layout_height="1dp"
android:layout_marginStart="@dimen/content_padding_small"
android:layout_marginLeft="@dimen/content_padding_small"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:background="?attr/dashboard_divider" />
<LinearLayout
android:id="@+id/time_distance"
@ -210,94 +177,95 @@
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="@dimen/content_padding"
android:paddingStart="@dimen/content_padding">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/time_moving_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_time_span"/>
android:layout_marginStart="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/time_moving_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="174"
android:textColor="?android:attr/textColorPrimary"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/time_moving_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="3dp"
android:text="@string/shared_string_time_moving"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/time_moving_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="174" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/time_moving_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="2dp"
osmand:srcCompat="@drawable/ic_action_time_span" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:layout_weight="1"
android:orientation="horizontal"
android:paddingLeft="@dimen/content_padding"
android:paddingStart="@dimen/content_padding">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/distance_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_polygom_dark"/>
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_marginStart="18dp">
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/distance_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:background="@null"
android:text="@string/distance_moving"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_desc_text_size" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/distance_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
tools:text="42 km"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/default_desc_text_size"/>
<TextView
android:id="@+id/distance_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="3dp"
android:text="@string/distance_moving"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_sub_text_size"/>
tools:text="42 km" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/distance_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/poi_icon_size"
android:layout_marginTop="5dp"
osmand:srcCompat="@drawable/ic_action_polygom_dark" />
</LinearLayout>
</LinearLayout>
@ -305,61 +273,46 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
android:background="?attr/dashboard_divider" />
<LinearLayout
android:id="@+id/details_view"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:gravity="center">
<ImageButton
android:visibility="gone"
tools:visibility="visible"
android:id="@+id/overflow_menu"
android:background="@null"
android:paddingRight="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:layout_width="wrap_content"
android:layout_height="match_parent"
tools:src="@drawable/ic_overflow_menu_dark"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
android:gravity="center"
android:orientation="horizontal">
<net.osmand.plus.widgets.TextViewEx
android:background="?attr/selectableItemBackground"
android:id="@+id/split_interval"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:gravity="start|center_vertical"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_sub_text_size"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"
android:text="@string/gpx_split_interval"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
<net.osmand.plus.widgets.TextViewEx
android:background="?attr/selectableItemBackground"
android:id="@+id/analyze_on_map"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/selectableItemBackground"
android:gravity="start|center_vertical"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:gravity="end|center_vertical"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_sub_text_size"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"
android:text="@string/analyze_on_map"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/overflow_menu"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/selectableItemBackground"
android:gravity="end|center_vertical"
android:paddingStart="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:text="@string/shared_string_options"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />
</LinearLayout>

View file

@ -9,4 +9,9 @@
android:id="@+id/action_delete"
android:icon="@drawable/ic_action_remove_dark"
android:title="@string/shared_string_delete"/>
<item
android:id="@+id/split_interval"
android:icon="@drawable/ic_action_split_interval"
android:title="@string/gpx_split_interval"/>
</menu>

View file

@ -275,17 +275,7 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
openAnalyzeOnMap(GPXTabItemType.GPX_TAB_ITEM_SPEED);
}
});
if (gpxFile.showCurrentTrack) {
view.findViewById(R.id.split_interval).setVisibility(View.GONE);
} else {
view.findViewById(R.id.split_interval).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openSplitIntervalScreen();
}
});
}
ImageView overflowMenu = view.findViewById(R.id.overflow_menu);
TextView overflowMenu = view.findViewById(R.id.overflow_menu);
if (!gpxItem.group.getTrack().generalTrack) {
setupOptionsPopupMenu(overflowMenu, false);
} else {
@ -293,13 +283,12 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
}
}
private void setupOptionsPopupMenu(ImageView overflowMenu, final boolean confirmDeletion) {
overflowMenu.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_overflow_menu_white));
private void setupOptionsPopupMenu(TextView overflowMenu, final boolean confirmDeletion) {
overflowMenu.setVisibility(View.VISIBLE);
overflowMenu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
actionsListener.showOptionsPopupMenu(view, getTrkSegment(), confirmDeletion);
actionsListener.showOptionsPopupMenu(view, getTrkSegment(), confirmDeletion, gpxItem);
}
});
}
@ -359,17 +348,7 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
openAnalyzeOnMap(GPXTabItemType.GPX_TAB_ITEM_ALTITUDE);
}
});
if (gpxFile.showCurrentTrack) {
view.findViewById(R.id.split_interval).setVisibility(View.GONE);
} else {
view.findViewById(R.id.split_interval).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openSplitIntervalScreen();
}
});
}
ImageView overflowMenu = view.findViewById(R.id.overflow_menu);
TextView overflowMenu = view.findViewById(R.id.overflow_menu);
if (!gpxItem.group.getTrack().generalTrack) {
setupOptionsPopupMenu(overflowMenu, false);
} else {
@ -436,17 +415,7 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
openAnalyzeOnMap(GPXTabItemType.GPX_TAB_ITEM_GENERAL);
}
});
if (gpxFile.showCurrentTrack) {
view.findViewById(R.id.split_interval).setVisibility(View.GONE);
} else {
view.findViewById(R.id.split_interval).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openSplitIntervalScreen();
}
});
}
ImageView overflowMenu = view.findViewById(R.id.overflow_menu);
TextView overflowMenu = view.findViewById(R.id.overflow_menu);
if (!gpxItem.group.getTrack().generalTrack) {
setupOptionsPopupMenu(overflowMenu, true);
} else {

View file

@ -21,7 +21,7 @@ public interface SegmentActionsListener {
void openSplitInterval(GpxDisplayItem gpxItem, TrkSegment trkSegment);
void showOptionsPopupMenu(View view, TrkSegment trkSegment, boolean confirmDeletion);
void showOptionsPopupMenu(View view, TrkSegment trkSegment, boolean confirmDeletion, GpxDisplayItem gpxItem);
void openAnalyzeOnMap(GpxDisplayItem gpxItem, List<ILineDataSet> dataSets, GPXTabItemType tabType);
}

View file

@ -66,7 +66,7 @@ public class TrackSegmentFragment extends OsmAndListFragment implements TrackBit
private TrackDisplayHelper displayHelper;
private TrackActivityFragmentAdapter fragmentAdapter;
private SegmentGPXAdapter adapter;
private final GpxDisplayItemType[] filterTypes = new GpxDisplayItemType[] {GpxDisplayItemType.TRACK_SEGMENT};
private final GpxDisplayItemType[] filterTypes = new GpxDisplayItemType[]{GpxDisplayItemType.TRACK_SEGMENT};
private IconPopupMenu optionsPopupMenu;
private boolean updateEnable;
@ -357,14 +357,20 @@ public class TrackSegmentFragment extends OsmAndListFragment implements TrackBit
}
@Override
public void showOptionsPopupMenu(View view, final TrkSegment segment, final boolean confirmDeletion) {
public void showOptionsPopupMenu(final View view, final TrkSegment segment, final boolean confirmDeletion, final GpxDisplayItem gpxItem) {
FragmentActivity activity = getActivity();
if (activity != null) {
optionsPopupMenu = new IconPopupMenu(activity, view.findViewById(R.id.overflow_menu));
Menu menu = optionsPopupMenu.getMenu();
IconPopupMenu optionsPopupMenu = new IconPopupMenu(activity, view.findViewById(R.id.overflow_menu));
final Menu menu = optionsPopupMenu.getMenu();
optionsPopupMenu.getMenuInflater().inflate(R.menu.track_segment_menu, menu);
menu.findItem(R.id.action_edit).setIcon(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_edit_dark));
menu.findItem(R.id.action_delete).setIcon(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_remove_dark));
boolean isSelectedTrackRecordingNow = displayHelper.getGpx().showCurrentTrack;
if (isSelectedTrackRecordingNow) {
menu.findItem(R.id.split_interval).setVisible(false);
} else {
menu.findItem(R.id.split_interval).setIcon(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_split_interval));
}
optionsPopupMenu.setOnMenuItemClickListener(new IconPopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -389,6 +395,8 @@ public class TrackSegmentFragment extends OsmAndListFragment implements TrackBit
builder.show();
}
return true;
} else if (i == R.id.split_interval) {
openSplitInterval(gpxItem, segment);
}
return false;
}

View file

@ -462,7 +462,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
segment = segments.get(0);
}
}
GpxDisplayItemType[] filterTypes = new GpxDisplayItemType[] {GpxDisplayItemType.TRACK_SEGMENT};
GpxDisplayItemType[] filterTypes = new GpxDisplayItemType[]{GpxDisplayItemType.TRACK_SEGMENT};
List<GpxDisplayItem> items = TrackDisplayHelper.flatten(displayHelper.getOriginalGroups(filterTypes));
if (segment != null && !Algorithms.isEmpty(items)) {
SplitSegmentDialogFragment.showInstance(fragmentManager, displayHelper, items.get(0), segment);
@ -677,14 +677,20 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
}
@Override
public void showOptionsPopupMenu(View view, final TrkSegment segment, final boolean confirmDeletion) {
public void showOptionsPopupMenu(final View view, final TrkSegment segment, final boolean confirmDeletion, final GpxDisplayItem gpxItem) {
FragmentActivity activity = getActivity();
if (activity != null) {
IconPopupMenu optionsPopupMenu = new IconPopupMenu(activity, view.findViewById(R.id.overflow_menu));
Menu menu = optionsPopupMenu.getMenu();
final Menu menu = optionsPopupMenu.getMenu();
optionsPopupMenu.getMenuInflater().inflate(R.menu.track_segment_menu, menu);
menu.findItem(R.id.action_edit).setIcon(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_edit_dark));
menu.findItem(R.id.action_delete).setIcon(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_remove_dark));
boolean isSelectedTrackRecordingNow = displayHelper.getGpx().showCurrentTrack;
if (isSelectedTrackRecordingNow) {
menu.findItem(R.id.split_interval).setVisible(false);
} else {
menu.findItem(R.id.split_interval).setIcon(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_split_interval));
}
optionsPopupMenu.setOnMenuItemClickListener(new IconPopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -709,6 +715,8 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
builder.show();
}
return true;
} else if (i == R.id.split_interval) {
openSplitInterval(gpxItem, segment);
}
return false;
}
@ -762,7 +770,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
@Override
public void gpxSavingFinished(Exception errorMessage) {
if (selectedGpxFile != null) {
List<GpxDisplayGroup> groups = displayHelper.getDisplayGroups(new GpxDisplayItemType[] {GpxDisplayItemType.TRACK_SEGMENT});
List<GpxDisplayGroup> groups = displayHelper.getDisplayGroups(new GpxDisplayItemType[]{GpxDisplayItemType.TRACK_SEGMENT});
selectedGpxFile.setDisplayGroups(groups, app);
selectedGpxFile.processPoints(app);
}