Move constant

This commit is contained in:
PavelRatushny 2017-10-20 17:35:23 +03:00
parent 3180688607
commit 8d50394b75
3 changed files with 7 additions and 6 deletions

View file

@ -144,8 +144,6 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
MapMarkerChangedListener, OnDismissDialogFragmentListener, OnDrawMapListener {
public static final String INTENT_KEY_PARENT_MAP_ACTIVITY = "intent_parent_map_activity_key";
public static final String OPEN_MAP_MARKERS_GROUPS = "open_map_markers_groups";
private static final int SHOW_POSITION_MSG_ID = OsmAndConstants.UI_HANDLER_MAP_VIEW + 1;
private static final int LONG_KEYPRESS_MSG_ID = OsmAndConstants.UI_HANDLER_MAP_VIEW + 2;
private static final int LONG_KEYPRESS_DELAY = 500;
@ -682,7 +680,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
}
}
}
if (intent.hasExtra(OPEN_MAP_MARKERS_GROUPS)) {
if (intent.hasExtra(MapMarkersDialogFragment.OPEN_MAP_MARKERS_GROUPS)) {
MapMarkersDialogFragment.showInstance(this, true);
}
}

View file

@ -39,6 +39,8 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
public static final String TAG = "MapMarkersDialogFragment";
public static final String OPEN_MAP_MARKERS_GROUPS = "open_map_markers_groups";
private static final int ACTIVE_MARKERS_POSITION = 0;
private static final int GROUPS_POSITION = 1;
private static final int HISTORY_MARKERS_POSITION = 2;
@ -66,7 +68,7 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
Bundle args = getArguments();
boolean openGroups = false;
if (args != null && args.getBoolean(MapActivity.OPEN_MAP_MARKERS_GROUPS)) {
if (args != null && args.getBoolean(OPEN_MAP_MARKERS_GROUPS)) {
openGroups = true;
}
List<Fragment> fragments = getChildFragmentManager().getFragments();
@ -372,7 +374,7 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
MapMarkersDialogFragment fragment = new MapMarkersDialogFragment();
if (openGroups) {
Bundle args = new Bundle();
args.putBoolean(MapActivity.OPEN_MAP_MARKERS_GROUPS, true);
args.putBoolean(OPEN_MAP_MARKERS_GROUPS, true);
fragment.setArguments(args);
}
fragment.show(mapActivity.getSupportFragmentManager(), TAG);

View file

@ -59,6 +59,7 @@ import net.osmand.plus.activities.TrackActivity;
import net.osmand.plus.base.FavoriteImageDrawable;
import net.osmand.plus.base.OsmandExpandableListFragment;
import net.osmand.plus.dialogs.DirectionsDialogs;
import net.osmand.plus.mapmarkers.MapMarkersDialogFragment;
import net.osmand.plus.measurementtool.NewGpxData;
import net.osmand.util.Algorithms;
@ -644,7 +645,7 @@ public class TrackPointFragment extends OsmandExpandableListFragment {
.setAction(getResources().getString(R.string.view), new View.OnClickListener() {
@Override
public void onClick(View v) {
MapActivity.launchMapActivityMoveToTop(getTrackActivity(), MapActivity.OPEN_MAP_MARKERS_GROUPS);
MapActivity.launchMapActivityMoveToTop(getTrackActivity(), MapMarkersDialogFragment.OPEN_MAP_MARKERS_GROUPS);
}
});
snackbar.addCallback(new Snackbar.Callback() {