Merge pull request #10273 from osmandapp/sorting-follow-track

Sorting follow track
This commit is contained in:
Vitaliy 2020-11-26 14:21:08 +00:00 committed by GitHub
commit 39996723dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -75,7 +75,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/route_info_bg"
android:foreground="@drawable/bg_contextmenu_shadow"
android:foregroundGravity="top|fill_horizontal">
<androidx.core.widget.NestedScrollView

View file

@ -156,6 +156,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
if (view != null) {
ImageButton closeButton = view.findViewById(R.id.close_button);
buttonsShadow = view.findViewById(R.id.buttons_shadow);
sortButton = view.findViewById(R.id.sort_button);
closeButton.setImageDrawable(getContentIcon(AndroidUtils.getNavigationIconResId(app)));
closeButton.setOnClickListener(new View.OnClickListener() {
@Override
@ -219,6 +220,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
if (Algorithms.isEmpty(fileName)) {
fileName = app.getString(R.string.shared_string_gpx_track);
}
sortButton.setVisibility(View.GONE);
GPXInfo gpxInfo = new GPXInfo(fileName, file != null ? file.lastModified() : 0, file != null ? file.length() : 0);
TrackEditCard importTrackCard = new TrackEditCard(mapActivity, gpxInfo);
importTrackCard.setListener(this);
@ -268,6 +270,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
tracksCard = new TracksToFollowCard(mapActivity, list, defaultCategory);
tracksCard.setListener(FollowTrackFragment.this);
getCardsContainer().addView(tracksCard.build(mapActivity));
sortButton.setVisibility(View.VISIBLE);
}
}
}