small fixes;
This commit is contained in:
parent
1c140011ab
commit
28d6dd0e4a
12 changed files with 78 additions and 79 deletions
|
@ -104,7 +104,7 @@ import net.osmand.plus.measurementtool.LoginBottomSheetFragment;
|
|||
import net.osmand.plus.measurementtool.MeasurementEditingContext;
|
||||
import net.osmand.plus.measurementtool.MeasurementToolFragment;
|
||||
import net.osmand.plus.measurementtool.SnapTrackWarningFragment;
|
||||
import net.osmand.plus.monitoring.TripRecordingStartingBottomFragment;
|
||||
import net.osmand.plus.monitoring.TripRecordingStartingBottomSheetFragment;
|
||||
import net.osmand.plus.render.RendererRegistry;
|
||||
import net.osmand.plus.resources.ResourceManager;
|
||||
import net.osmand.plus.routepreparationmenu.ChooseRouteFragment;
|
||||
|
@ -2241,8 +2241,8 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
return getFragment(MeasurementToolFragment.TAG);
|
||||
}
|
||||
|
||||
public TripRecordingStartingBottomFragment getTripRecordingBottomSheet() {
|
||||
return getFragment(TripRecordingStartingBottomFragment.TAG);
|
||||
public TripRecordingStartingBottomSheetFragment getTripRecordingBottomSheet() {
|
||||
return getFragment(TripRecordingStartingBottomSheetFragment.TAG);
|
||||
}
|
||||
|
||||
public ChooseRouteFragment getChooseRouteFragment() {
|
||||
|
|
|
@ -62,8 +62,8 @@ import net.osmand.plus.mapmarkers.MarkersPlanRouteContext;
|
|||
import net.osmand.plus.measurementtool.MeasurementToolFragment;
|
||||
import net.osmand.plus.measurementtool.StartPlanRouteBottomSheet;
|
||||
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomFragment;
|
||||
import net.osmand.plus.monitoring.TripRecordingStartingBottomFragment;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomSheetFragment;
|
||||
import net.osmand.plus.monitoring.TripRecordingStartingBottomSheetFragment;
|
||||
import net.osmand.plus.osmedit.dialogs.DismissRouteBottomSheetFragment;
|
||||
import net.osmand.plus.profiles.ProfileDataObject;
|
||||
import net.osmand.plus.profiles.ProfileDataUtils;
|
||||
|
@ -854,9 +854,9 @@ public class MapActivityActions implements DialogProvider {
|
|||
app.logEvent("trip_recording_open");
|
||||
MapActivity.clearPrevActivityIntent();
|
||||
if (monitoringPlugin.hasDataToSave() || monitoringPlugin.wasTrackMonitored()) {
|
||||
TripRecordingBottomFragment.showInstance(mapActivity.getSupportFragmentManager(), monitoringPlugin.getCurrentTrack());
|
||||
TripRecordingBottomSheetFragment.showInstance(mapActivity.getSupportFragmentManager(), monitoringPlugin.getCurrentTrack());
|
||||
} else {
|
||||
TripRecordingStartingBottomFragment.showInstance(mapActivity.getSupportFragmentManager(), app, monitoringPlugin.getCurrentTrack());
|
||||
TripRecordingStartingBottomSheetFragment.showInstance(mapActivity.getSupportFragmentManager(), app, monitoringPlugin.getCurrentTrack());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -85,9 +85,9 @@ import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceUpdateFreq
|
|||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.runLiveUpdate;
|
||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.setAlarmForPendingIntent;
|
||||
import static net.osmand.plus.liveupdates.LiveUpdatesSettingsDialogFragmentNew.getTertiaryTextColorId;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomFragment.getActiveTextColorId;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomFragment.getOsmandIconColorId;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomFragment.getSecondaryIconColorId;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.getActiveTextColorId;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.getOsmandIconColorId;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.getSecondaryIconColorId;
|
||||
|
||||
public class LiveUpdatesFragmentNew extends BaseOsmAndDialogFragment implements OnLiveUpdatesForLocalChange {
|
||||
|
||||
|
|
|
@ -300,8 +300,8 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment
|
|||
FragmentActivity activity = getActivity();
|
||||
if (activity != null && !activity.isChangingConfigurations()) {
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof TripRecordingStartingBottomFragment) {
|
||||
((TripRecordingStartingBottomFragment) target).show();
|
||||
if (target instanceof TripRecordingStartingBottomSheetFragment) {
|
||||
((TripRecordingStartingBottomSheetFragment) target).show();
|
||||
}
|
||||
}
|
||||
super.onDestroy();
|
||||
|
|
|
@ -337,9 +337,9 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
|||
public void controlDialog(final Activity activity, final boolean showTrackSelection) {
|
||||
FragmentManager fragmentManager = ((FragmentActivity) activity).getSupportFragmentManager();
|
||||
if (hasDataToSave() || wasTrackMonitored()) {
|
||||
TripRecordingBottomFragment.showInstance(fragmentManager, getCurrentTrack());
|
||||
TripRecordingBottomSheetFragment.showInstance(fragmentManager, getCurrentTrack());
|
||||
} else {
|
||||
TripRecordingStartingBottomFragment.showInstance(fragmentManager, app, getCurrentTrack());
|
||||
TripRecordingStartingBottomSheetFragment.showInstance(fragmentManager, app, getCurrentTrack());
|
||||
}
|
||||
|
||||
/*final boolean wasTrackMonitored = settings.SAVE_GLOBAL_TRACK_TO_GPX.get();
|
||||
|
@ -558,7 +558,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
|||
runnable.run();
|
||||
} else if (map instanceof FragmentActivity) {
|
||||
FragmentActivity activity = (FragmentActivity) map;
|
||||
TripRecordingStartingBottomFragment.showInstance(activity.getSupportFragmentManager(), app, getCurrentTrack());
|
||||
TripRecordingStartingBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), app, getCurrentTrack());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -73,10 +73,10 @@ import static net.osmand.plus.track.GpxBlockStatisticsBuilder.INIT_BLOCKS_ALTITU
|
|||
import static net.osmand.plus.track.GpxBlockStatisticsBuilder.INIT_BLOCKS_GENERAL;
|
||||
import static net.osmand.plus.track.GpxBlockStatisticsBuilder.INIT_BLOCKS_SPEED;
|
||||
|
||||
public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment implements SegmentActionsListener {
|
||||
public class TripRecordingBottomSheetFragment extends MenuBottomSheetDialogFragment implements SegmentActionsListener {
|
||||
|
||||
public static final String TAG = TripRecordingBottomFragment.class.getSimpleName();
|
||||
private static final Log LOG = PlatformUtil.getLog(TripRecordingBottomFragment.class);
|
||||
public static final String TAG = TripRecordingBottomSheetFragment.class.getSimpleName();
|
||||
private static final Log LOG = PlatformUtil.getLog(TripRecordingBottomSheetFragment.class);
|
||||
public static final String UPDATE_TRACK_ICON = "update_track_icon";
|
||||
private static final int GPS_UPDATE_INTERVAL = 1000;
|
||||
private static final String[] INIT_BLOCKS_KEYS =
|
||||
|
@ -122,7 +122,7 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
|
|||
|
||||
public static void showInstance(@NonNull FragmentManager fragmentManager, SelectedGpxFile selectedGpxFile) {
|
||||
if (!fragmentManager.isStateSaved()) {
|
||||
TripRecordingBottomFragment fragment = new TripRecordingBottomFragment();
|
||||
TripRecordingBottomSheetFragment fragment = new TripRecordingBottomSheetFragment();
|
||||
fragment.setSelectedGpxFile(selectedGpxFile);
|
||||
fragment.show(fragmentManager, TAG);
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
|
|||
LinearLayout showTrackContainer = itemView.findViewById(R.id.show_track_on_map);
|
||||
trackAppearanceIcon = showTrackContainer.findViewById(R.id.additional_button_icon);
|
||||
createShowTrackItem(showTrackContainer, trackAppearanceIcon, ItemType.SHOW_TRACK.getTitleId(),
|
||||
TripRecordingBottomFragment.this, nightMode, new Runnable() {
|
||||
TripRecordingBottomSheetFragment.this, nightMode, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
hide();
|
||||
|
@ -213,7 +213,7 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
if (fragmentManager != null) {
|
||||
TripRecordingOptionsBottomFragment.showInstance(fragmentManager, TripRecordingBottomFragment.this);
|
||||
TripRecordingOptionsBottomSheetFragment.showInstance(fragmentManager, TripRecordingBottomSheetFragment.this);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -11,7 +11,7 @@ import net.osmand.plus.base.MenuBottomSheetDialogFragment;
|
|||
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomFragment.ItemType;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.ItemType;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
@ -19,15 +19,15 @@ import androidx.fragment.app.FragmentManager;
|
|||
|
||||
import static net.osmand.AndroidUtils.getPrimaryTextColorId;
|
||||
|
||||
public class TripRecordingClearDataBottomFragment extends MenuBottomSheetDialogFragment implements TripRecordingBottomFragment.DismissTargetFragment {
|
||||
public class TripRecordingClearDataBottomSheetFragment extends MenuBottomSheetDialogFragment implements TripRecordingBottomSheetFragment.DismissTargetFragment {
|
||||
|
||||
public static final String TAG = TripRecordingClearDataBottomFragment.class.getSimpleName();
|
||||
public static final String TAG = TripRecordingClearDataBottomSheetFragment.class.getSimpleName();
|
||||
|
||||
private OsmandApplication app;
|
||||
|
||||
public static void showInstance(@NonNull FragmentManager fragmentManager, @NonNull Fragment target) {
|
||||
if (!fragmentManager.isStateSaved()) {
|
||||
TripRecordingClearDataBottomFragment fragment = new TripRecordingClearDataBottomFragment();
|
||||
TripRecordingClearDataBottomSheetFragment fragment = new TripRecordingClearDataBottomSheetFragment();
|
||||
fragment.setTargetFragment(target, 0);
|
||||
fragment.show(fragmentManager, TAG);
|
||||
}
|
||||
|
@ -81,15 +81,15 @@ public class TripRecordingClearDataBottomFragment extends MenuBottomSheetDialogF
|
|||
}
|
||||
|
||||
private View createItem(LayoutInflater inflater, ItemType type) {
|
||||
return TripRecordingBottomFragment.createItem(app, nightMode, inflater, type);
|
||||
return TripRecordingBottomSheetFragment.createItem(app, nightMode, inflater, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof TripRecordingOptionsBottomFragment) {
|
||||
((TripRecordingOptionsBottomFragment) target).hide();
|
||||
if (target instanceof TripRecordingOptionsBottomSheetFragment) {
|
||||
((TripRecordingOptionsBottomSheetFragment) target).hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,8 +97,8 @@ public class TripRecordingClearDataBottomFragment extends MenuBottomSheetDialogF
|
|||
public void onPause() {
|
||||
super.onPause();
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof TripRecordingOptionsBottomFragment) {
|
||||
((TripRecordingOptionsBottomFragment) target).show();
|
||||
if (target instanceof TripRecordingOptionsBottomSheetFragment) {
|
||||
((TripRecordingOptionsBottomSheetFragment) target).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,8 +110,8 @@ public class TripRecordingClearDataBottomFragment extends MenuBottomSheetDialogF
|
|||
@Override
|
||||
public void dismissTarget() {
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof TripRecordingOptionsBottomFragment) {
|
||||
((TripRecordingOptionsBottomFragment) target).dismiss();
|
||||
if (target instanceof TripRecordingOptionsBottomSheetFragment) {
|
||||
((TripRecordingOptionsBottomSheetFragment) target).dismiss();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,24 +12,24 @@ import net.osmand.plus.base.MenuBottomSheetDialogFragment;
|
|||
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomFragment.ItemType;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.ItemType;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import static net.osmand.AndroidUtils.getPrimaryTextColorId;
|
||||
import static net.osmand.plus.monitoring.TripRecordingOptionsBottomFragment.ACTION_STOP_AND_DISMISS;
|
||||
import static net.osmand.plus.monitoring.TripRecordingOptionsBottomSheetFragment.ACTION_STOP_AND_DISMISS;
|
||||
|
||||
public class TripRecordingDiscardBottomFragment extends MenuBottomSheetDialogFragment implements TripRecordingBottomFragment.DismissTargetFragment {
|
||||
public class TripRecordingDiscardBottomSheetFragment extends MenuBottomSheetDialogFragment implements TripRecordingBottomSheetFragment.DismissTargetFragment {
|
||||
|
||||
public static final String TAG = TripRecordingDiscardBottomFragment.class.getSimpleName();
|
||||
public static final String TAG = TripRecordingDiscardBottomSheetFragment.class.getSimpleName();
|
||||
|
||||
private OsmandApplication app;
|
||||
|
||||
public static void showInstance(@NonNull FragmentManager fragmentManager, @NonNull Fragment target) {
|
||||
if (!fragmentManager.isStateSaved()) {
|
||||
TripRecordingDiscardBottomFragment fragment = new TripRecordingDiscardBottomFragment();
|
||||
TripRecordingDiscardBottomSheetFragment fragment = new TripRecordingDiscardBottomSheetFragment();
|
||||
fragment.setTargetFragment(target, 0);
|
||||
fragment.show(fragmentManager, TAG);
|
||||
}
|
||||
|
@ -93,15 +93,15 @@ public class TripRecordingDiscardBottomFragment extends MenuBottomSheetDialogFra
|
|||
}
|
||||
|
||||
private View createItem(LayoutInflater inflater, ItemType type) {
|
||||
return TripRecordingBottomFragment.createItem(app, nightMode, inflater, type);
|
||||
return TripRecordingBottomSheetFragment.createItem(app, nightMode, inflater, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof TripRecordingOptionsBottomFragment) {
|
||||
((TripRecordingOptionsBottomFragment) target).hide();
|
||||
if (target instanceof TripRecordingOptionsBottomSheetFragment) {
|
||||
((TripRecordingOptionsBottomSheetFragment) target).hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,16 +109,16 @@ public class TripRecordingDiscardBottomFragment extends MenuBottomSheetDialogFra
|
|||
public void onPause() {
|
||||
super.onPause();
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof TripRecordingOptionsBottomFragment) {
|
||||
((TripRecordingOptionsBottomFragment) target).show();
|
||||
if (target instanceof TripRecordingOptionsBottomSheetFragment) {
|
||||
((TripRecordingOptionsBottomSheetFragment) target).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismissTarget() {
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof TripRecordingOptionsBottomFragment) {
|
||||
((TripRecordingOptionsBottomFragment) target).dismiss();
|
||||
if (target instanceof TripRecordingOptionsBottomSheetFragment) {
|
||||
((TripRecordingOptionsBottomSheetFragment) target).dismiss();
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
|
|||
import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomFragment.ItemType;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.ItemType;
|
||||
import net.osmand.plus.myplaces.SaveCurrentTrackTask;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
import net.osmand.plus.track.SaveGpxAsyncTask.SaveGpxListener;
|
||||
|
@ -35,9 +35,9 @@ import net.osmand.util.Algorithms;
|
|||
|
||||
import static net.osmand.AndroidUtils.getPrimaryTextColorId;
|
||||
|
||||
public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFragment implements TripRecordingBottomFragment.DismissTargetFragment {
|
||||
public class TripRecordingOptionsBottomSheetFragment extends MenuBottomSheetDialogFragment implements TripRecordingBottomSheetFragment.DismissTargetFragment {
|
||||
|
||||
public static final String TAG = TripRecordingOptionsBottomFragment.class.getSimpleName();
|
||||
public static final String TAG = TripRecordingOptionsBottomSheetFragment.class.getSimpleName();
|
||||
public static final String ACTION_STOP_AND_DISMISS = "action_stop_and_discard";
|
||||
private static final int SAVE_UPDATE_INTERVAL = 1000;
|
||||
|
||||
|
@ -72,7 +72,7 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
|
|||
|
||||
public static void showInstance(@NonNull FragmentManager fragmentManager, @NonNull Fragment target) {
|
||||
if (!fragmentManager.isStateSaved()) {
|
||||
TripRecordingOptionsBottomFragment fragment = new TripRecordingOptionsBottomFragment();
|
||||
TripRecordingOptionsBottomSheetFragment fragment = new TripRecordingOptionsBottomSheetFragment();
|
||||
fragment.setTargetFragment(target, 0);
|
||||
fragment.show(fragmentManager, TAG);
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
if (fragmentManager != null && hasDataToSave()) {
|
||||
TripRecordingClearDataBottomFragment.showInstance(fragmentManager, TripRecordingOptionsBottomFragment.this);
|
||||
TripRecordingClearDataBottomSheetFragment.showInstance(fragmentManager, TripRecordingOptionsBottomSheetFragment.this);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -123,7 +123,7 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
if (fragmentManager != null) {
|
||||
TripRecordingDiscardBottomFragment.showInstance(fragmentManager, TripRecordingOptionsBottomFragment.this);
|
||||
TripRecordingDiscardBottomSheetFragment.showInstance(fragmentManager, TripRecordingOptionsBottomSheetFragment.this);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -189,8 +189,8 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
|
|||
super.onResume();
|
||||
runUpdatingTimeTrackSaved();
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof TripRecordingBottomFragment) {
|
||||
((TripRecordingBottomFragment) target).hide();
|
||||
if (target instanceof TripRecordingBottomSheetFragment) {
|
||||
((TripRecordingBottomSheetFragment) target).hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -224,8 +224,8 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
|
|||
@Override
|
||||
public void run() {
|
||||
String time = getTimeTrackSaved();
|
||||
TripRecordingBottomFragment.createItem(app, nightMode, buttonSave, ItemType.SAVE, hasDataToSave(), !Algorithms.isEmpty(time) ? time : null);
|
||||
TripRecordingBottomFragment.createItem(app, nightMode, buttonClear, ItemType.CLEAR_DATA, hasDataToSave(), null);
|
||||
TripRecordingBottomSheetFragment.createItem(app, nightMode, buttonSave, ItemType.SAVE, hasDataToSave(), !Algorithms.isEmpty(time) ? time : null);
|
||||
TripRecordingBottomSheetFragment.createItem(app, nightMode, buttonClear, ItemType.CLEAR_DATA, hasDataToSave(), null);
|
||||
handler.postDelayed(this, SAVE_UPDATE_INTERVAL);
|
||||
}
|
||||
};
|
||||
|
@ -244,11 +244,11 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
|
|||
}
|
||||
|
||||
private View createItem(LayoutInflater inflater, ItemType type, boolean enabled) {
|
||||
return TripRecordingBottomFragment.createItem(app, nightMode, inflater, type, enabled, null);
|
||||
return TripRecordingBottomSheetFragment.createItem(app, nightMode, inflater, type, enabled, null);
|
||||
}
|
||||
|
||||
private View createItem(LayoutInflater inflater, ItemType type) {
|
||||
return TripRecordingBottomFragment.createItem(app, nightMode, inflater, type);
|
||||
return TripRecordingBottomSheetFragment.createItem(app, nightMode, inflater, type);
|
||||
}
|
||||
|
||||
private SaveGpxListener createSaveListener() {
|
||||
|
@ -286,11 +286,11 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
|
|||
@Override
|
||||
public void dismissTarget() {
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof TripRecordingBottomFragment) {
|
||||
if (target instanceof TripRecordingBottomSheetFragment) {
|
||||
if (isDiscard()) {
|
||||
((TripRecordingBottomFragment) target).dismiss();
|
||||
((TripRecordingBottomSheetFragment) target).dismiss();
|
||||
} else {
|
||||
((TripRecordingBottomFragment) target).show();
|
||||
((TripRecordingBottomSheetFragment) target).show();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,21 +30,20 @@ import net.osmand.plus.base.MenuBottomSheetDialogFragment;
|
|||
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
import net.osmand.plus.helpers.FontCache;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomFragment.ItemType;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.ItemType;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
import net.osmand.plus.settings.fragments.BaseSettingsFragment;
|
||||
import net.osmand.plus.settings.fragments.BaseSettingsFragment.SettingsScreenType;
|
||||
|
||||
import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MINUTES;
|
||||
import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.SECONDS;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomFragment.UPDATE_TRACK_ICON;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomFragment.createItem;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomFragment.createShowTrackItem;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomFragment.updateTrackIcon;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.createItem;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.createShowTrackItem;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.updateTrackIcon;
|
||||
|
||||
public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFragment {
|
||||
public class TripRecordingStartingBottomSheetFragment extends MenuBottomSheetDialogFragment {
|
||||
|
||||
public static final String TAG = TripRecordingStartingBottomFragment.class.getSimpleName();
|
||||
public static final String TAG = TripRecordingStartingBottomSheetFragment.class.getSimpleName();
|
||||
public static final String UPDATE_LOGGING_INTERVAL = "update_logging_interval";
|
||||
|
||||
private OsmandApplication app;
|
||||
|
@ -60,7 +59,7 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
|
|||
|
||||
public static void showInstance(@NonNull FragmentManager fragmentManager) {
|
||||
if (!fragmentManager.isStateSaved()) {
|
||||
TripRecordingStartingBottomFragment fragment = new TripRecordingStartingBottomFragment();
|
||||
TripRecordingStartingBottomSheetFragment fragment = new TripRecordingStartingBottomSheetFragment();
|
||||
fragment.show(fragmentManager, TAG);
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +72,7 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
|
|||
showInstance(fragmentManager);
|
||||
} else {
|
||||
startRecording(app);
|
||||
TripRecordingBottomFragment.showInstance(fragmentManager, selectedGpxFile);
|
||||
TripRecordingBottomSheetFragment.showInstance(fragmentManager, selectedGpxFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +106,7 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
|
|||
LinearLayout showTrackContainer = itemView.findViewById(R.id.show_track_on_map);
|
||||
trackAppearanceIcon = showTrackContainer.findViewById(R.id.additional_button_icon);
|
||||
createShowTrackItem(showTrackContainer, trackAppearanceIcon, R.string.shared_string_show_on_map,
|
||||
TripRecordingStartingBottomFragment.this, nightMode, new Runnable() {
|
||||
TripRecordingStartingBottomSheetFragment.this, nightMode, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
hide();
|
||||
|
@ -143,7 +142,7 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
|
|||
if (mapActivity != null) {
|
||||
hide();
|
||||
BaseSettingsFragment.showInstance(mapActivity, SettingsScreenType.MONITORING_SETTINGS,
|
||||
null, new Bundle(), TripRecordingStartingBottomFragment.this);
|
||||
null, new Bundle(), TripRecordingStartingBottomSheetFragment.this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -234,7 +233,7 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
|
|||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
SavingTrackHelper helper = app.getSavingTrackHelper();
|
||||
TripRecordingBottomFragment.showInstance(mapActivity.getSupportFragmentManager(), helper.getCurrentTrack());
|
||||
TripRecordingBottomSheetFragment.showInstance(mapActivity.getSupportFragmentManager(), helper.getCurrentTrack());
|
||||
}
|
||||
dismiss();
|
||||
}
|
|
@ -34,7 +34,7 @@ import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
|
|||
import org.apache.commons.logging.Log;
|
||||
|
||||
import static net.osmand.plus.liveupdates.LiveUpdatesSettingsDialogFragmentNew.getActivePrimaryColorId;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomFragment.getSecondaryIconColorId;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.getSecondaryIconColorId;
|
||||
|
||||
public class BooleanPreferenceBottomSheet extends BasePreferenceBottomSheet {
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ import net.osmand.plus.dialogs.GpxAppearanceAdapter;
|
|||
import net.osmand.plus.dialogs.GpxAppearanceAdapter.AppearanceListItem;
|
||||
import net.osmand.plus.dialogs.GpxAppearanceAdapter.GpxAppearanceAdapterType;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomFragment;
|
||||
import net.osmand.plus.monitoring.TripRecordingStartingBottomFragment;
|
||||
import net.osmand.plus.monitoring.TripRecordingBottomSheetFragment;
|
||||
import net.osmand.plus.monitoring.TripRecordingStartingBottomSheetFragment;
|
||||
import net.osmand.plus.routepreparationmenu.cards.BaseCard;
|
||||
import net.osmand.plus.routepreparationmenu.cards.BaseCard.CardListener;
|
||||
import net.osmand.plus.settings.backend.CommonPreference;
|
||||
|
@ -64,7 +64,7 @@ import static net.osmand.plus.dialogs.ConfigureMapMenu.CURRENT_TRACK_COLOR_ATTR;
|
|||
import static net.osmand.plus.dialogs.GpxAppearanceAdapter.TRACK_WIDTH_BOLD;
|
||||
import static net.osmand.plus.dialogs.GpxAppearanceAdapter.TRACK_WIDTH_MEDIUM;
|
||||
import static net.osmand.plus.dialogs.GpxAppearanceAdapter.getAppearanceItems;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomFragment.UPDATE_TRACK_ICON;
|
||||
import static net.osmand.plus.monitoring.TripRecordingBottomSheetFragment.UPDATE_TRACK_ICON;
|
||||
|
||||
public class TrackAppearanceFragment extends ContextMenuScrollFragment implements CardListener, ColorPickerListener {
|
||||
|
||||
|
@ -398,10 +398,10 @@ public class TrackAppearanceFragment extends ContextMenuScrollFragment implement
|
|||
@Override
|
||||
public void onContextMenuDismiss(@NonNull ContextMenuFragment fragment) {
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof TripRecordingStartingBottomFragment) {
|
||||
((TripRecordingStartingBottomFragment) target).show();
|
||||
} else if (target instanceof TripRecordingBottomFragment) {
|
||||
((TripRecordingBottomFragment) target).show(UPDATE_TRACK_ICON);
|
||||
if (target instanceof TripRecordingStartingBottomSheetFragment) {
|
||||
((TripRecordingStartingBottomSheetFragment) target).show();
|
||||
} else if (target instanceof TripRecordingBottomSheetFragment) {
|
||||
((TripRecordingBottomSheetFragment) target).show(UPDATE_TRACK_ICON);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue