diff --git a/OsmAnd/res/layout/available_gpx.xml b/OsmAnd/res/layout/available_gpx.xml index 79fadd724f..e1386906b5 100644 --- a/OsmAnd/res/layout/available_gpx.xml +++ b/OsmAnd/res/layout/available_gpx.xml @@ -67,7 +67,6 @@ android:layout_marginRight="0dp" android:layout_marginTop="0dp" android:layout_weight="1" - android:background="?attr/expandable_list_background" android:groupIndicator="@android:color/transparent"/> diff --git a/OsmAnd/res/layout/dash_gpx_track_item.xml b/OsmAnd/res/layout/dash_gpx_track_item.xml index 700e614bd0..fc6c7453a5 100644 --- a/OsmAnd/res/layout/dash_gpx_track_item.xml +++ b/OsmAnd/res/layout/dash_gpx_track_item.xml @@ -23,46 +23,47 @@ android:id="@+id/check_local_index" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:focusable="false" - android:visibility="gone" android:layout_marginLeft="@dimen/local_index_check_right_margin" - android:layout_marginTop="@dimen/favorites_icon_top_margin"/> + android:layout_marginTop="@dimen/favorites_icon_top_margin" + android:focusable="false" + android:visibility="gone"/> + android:focusable="false" + android:src="@drawable/ic_gpx_track" + android:visibility="gone"/> + android:orientation="horizontal" + android:visibility="visible"> + android:textColor="?android:textColorSecondary" + android:textSize="@dimen/download_descr_text_size"/> + android:layout_marginRight="@dimen/gpx_small_text_margin" + android:textColor="?android:textColorSecondary" + android:textSize="@dimen/download_descr_text_size"/> + android:textColor="?android:textColorSecondary" + android:textSize="@dimen/download_descr_text_size"/> + android:orientation="horizontal" + android:visibility="gone"> + android:textColor="?android:textColorSecondary" + android:textSize="@dimen/download_descr_text_size"/> + android:visibility="gone"/> + android:src="@drawable/ic_action_gsave_dark" + android:visibility="gone" + tools:visibility="visible"/> + android:src="?attr/list_settings_icon" + android:visibility="gone"/> + + - diff --git a/OsmAnd/res/layout/expandable_list.xml b/OsmAnd/res/layout/expandable_list.xml index 39dc5fc613..b5e7e756ab 100644 --- a/OsmAnd/res/layout/expandable_list.xml +++ b/OsmAnd/res/layout/expandable_list.xml @@ -20,7 +20,6 @@ style="@style/OsmandListView" android:layout_width="fill_parent" android:layout_height="0dp" - android:background="?attr/expandable_list_background" android:layout_marginLeft="0dp" android:layout_marginRight="0dp" android:layout_marginTop="0dp" diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml index a613afb73a..973aa05ae9 100644 --- a/OsmAnd/res/values/sizes.xml +++ b/OsmAnd/res/values/sizes.xml @@ -42,6 +42,7 @@ 24dp 3dp 14dp + 6dp 14sp diff --git a/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java index ae45358df0..dff0ce9bb0 100644 --- a/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java @@ -66,6 +66,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.CheckBox; +import android.widget.CompoundButton; import android.widget.EditText; import android.widget.ExpandableListView; import android.widget.Filter; @@ -267,6 +268,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { v.findViewById(R.id.options).setVisibility(View.GONE); v.findViewById(R.id.stop).setVisibility(View.VISIBLE); + v.findViewById(R.id.check_item).setVisibility(View.GONE); save.setImageDrawable(icon); } @@ -787,6 +789,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { v = inflater.inflate(R.layout.dash_gpx_track_item, parent, false); } udpateGpxInfoView(v, child, app, gpxNormal, gpxOnMap, false); + ImageView icon = (ImageView) v.findViewById(R.id.icon); ImageButton options = (ImageButton) v.findViewById(R.id.options); options.setOnClickListener(new View.OnClickListener() { @@ -821,6 +824,27 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { options.setVisibility(View.VISIBLE); } + final CompoundButton checkItem = (CompoundButton) v.findViewById(R.id.check_item); + if (isSelectedGroup(groupPosition)) { + checkItem.setVisibility(View.VISIBLE); + v.findViewById(R.id.options).setVisibility(View.GONE); + } else { + checkItem.setVisibility(View.GONE); + } + + final SelectedGpxFile selectedGpxFile = selectedGpxHelper.getSelectedFileByName(child.getFileName()); + checkItem.setChecked(selectedGpxFile != null); + checkItem.setOnClickListener( new View.OnClickListener() { + @Override + public void onClick(View v) { + if (child.gpx != null) { + selectedGpxHelper.selectGpxFile(child.gpx, checkItem.isChecked(), false); + } else { + selectedGpxHelper.getSelectedGPXFiles().remove(selectedGpxFile); + } + } + }); + v.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -1420,6 +1444,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { if (sgpx != null) { icon.setImageDrawable(gpxOnMap); analysis = sgpx.getTrackAnalysis(); + } boolean sectionRead = analysis == null; if (sectionRead) { @@ -1473,6 +1498,8 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { } else { descr.setVisibility(View.GONE); } + + v.findViewById(R.id.check_item).setVisibility(View.GONE); } } diff --git a/OsmAnd/src/net/osmand/plus/monitoring/DashTrackFragment.java b/OsmAnd/src/net/osmand/plus/monitoring/DashTrackFragment.java index 3ca9771f97..2905447ce2 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/DashTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/DashTrackFragment.java @@ -140,6 +140,7 @@ public class DashTrackFragment extends DashBaseFragment { AvailableGPXFragment.createCurrentTrackView(view, app); ((TextView) view.findViewById(R.id.name)).setText(R.string.currently_recording_track); AvailableGPXFragment.updateCurrentTrack(view, getActivity(), app); + view.findViewById(R.id.divider).setVisibility(View.VISIBLE); tracks.addView(view); startHandler(view);