Search in sources :

Example 1 with FilteredSelectedGpxFile

use of net.osmand.plus.track.helpers.FilteredSelectedGpxFile in project Osmand by osmandapp.

the class GpsFilterFragment method restoreSelectedGpxFile.

private void restoreSelectedGpxFile(String gpxFilePath) {
    if (!Algorithms.isEmpty(gpxFilePath)) {
        TrackMenuFragment.loadSelectedGpxFile(requireMapActivity(), gpxFilePath, false, (gpxFile) -> {
            selectedGpxFile = gpxFile;
            FilteredSelectedGpxFile filteredSelectedGpxFile = setFileToFilter(selectedGpxFile);
            if (view != null && filteredSelectedGpxFile != null) {
                initContent(filteredSelectedGpxFile);
            }
            return true;
        });
    }
}
Also used : FilteredSelectedGpxFile(net.osmand.plus.track.helpers.FilteredSelectedGpxFile)

Example 2 with FilteredSelectedGpxFile

use of net.osmand.plus.track.helpers.FilteredSelectedGpxFile in project Osmand by osmandapp.

the class GpsFilterFragment method setupToolbar.

private void setupToolbar() {
    View toolbar = view.findViewById(R.id.toolbar);
    AndroidUiHelper.updateVisibility(toolbar, isPortrait());
    ImageButton closeButton = toolbar.findViewById(R.id.close_button);
    closeButton.setOnClickListener(v -> dismiss(false));
    closeButton.setImageResource(AndroidUtils.getNavigationIconResId(toolbar.getContext()));
    View resetToOriginalButton = toolbar.findViewById(R.id.reset_to_original_button);
    resetToOriginalButton.setOnClickListener(v -> {
        FilteredSelectedGpxFile filteredSelectedGpxFile = selectedGpxFile.getFilteredSelectedGpxFile();
        if (filteredSelectedGpxFile != null && app != null) {
            filteredSelectedGpxFile.resetFilters(app);
            gpsFilterScreensAdapter.onResetFilters();
        }
    });
    View scrollToActionsButton = toolbar.findViewById(R.id.scroll_to_actions_button);
    scrollToActionsButton.setOnClickListener(v -> {
        if (gpsFilterScreensAdapter != null) {
            gpsFilterScreensAdapter.softScrollToActionsCard();
        }
    });
}
Also used : FilteredSelectedGpxFile(net.osmand.plus.track.helpers.FilteredSelectedGpxFile) ImageButton(android.widget.ImageButton) View(android.view.View)

Aggregations

FilteredSelectedGpxFile (net.osmand.plus.track.helpers.FilteredSelectedGpxFile)2 View (android.view.View)1 ImageButton (android.widget.ImageButton)1