Fix #10072
This commit is contained in:
parent
e880f99a25
commit
262b8d0084
2 changed files with 9 additions and 3 deletions
|
@ -47,7 +47,7 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment {
|
||||||
public static final String TAG = SendGpxBottomSheetFragment.class.getSimpleName();
|
public static final String TAG = SendGpxBottomSheetFragment.class.getSimpleName();
|
||||||
|
|
||||||
private GpxInfo[] gpxInfos;
|
private GpxInfo[] gpxInfos;
|
||||||
private UploadVisibility selectedUploadVisibility = UploadVisibility.PUBLIC;
|
private UploadVisibility selectedUploadVisibility;
|
||||||
|
|
||||||
private TextInputEditText tagsField;
|
private TextInputEditText tagsField;
|
||||||
private TextInputEditText messageField;
|
private TextInputEditText messageField;
|
||||||
|
@ -59,12 +59,15 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment {
|
||||||
@Override
|
@Override
|
||||||
public void createMenuItems(Bundle savedInstanceState) {
|
public void createMenuItems(Bundle savedInstanceState) {
|
||||||
OsmandApplication app = requiredMyApplication();
|
OsmandApplication app = requiredMyApplication();
|
||||||
OsmandSettings settings = app.getSettings();
|
final OsmandSettings settings = app.getSettings();
|
||||||
|
|
||||||
LayoutInflater themedInflater = UiUtilities.getInflater(app, nightMode);
|
LayoutInflater themedInflater = UiUtilities.getInflater(app, nightMode);
|
||||||
View sendGpxView = themedInflater.inflate(R.layout.send_gpx_fragment, null);
|
View sendGpxView = themedInflater.inflate(R.layout.send_gpx_fragment, null);
|
||||||
sendGpxView.getViewTreeObserver().addOnGlobalLayoutListener(getShadowLayoutListener());
|
sendGpxView.getViewTreeObserver().addOnGlobalLayoutListener(getShadowLayoutListener());
|
||||||
|
|
||||||
|
if (selectedUploadVisibility == null) {
|
||||||
|
selectedUploadVisibility = settings.OSM_UPLOAD_VISIBILITY.get();
|
||||||
|
}
|
||||||
tagsField = sendGpxView.findViewById(R.id.tags_field);
|
tagsField = sendGpxView.findViewById(R.id.tags_field);
|
||||||
messageField = sendGpxView.findViewById(R.id.message_field);
|
messageField = sendGpxView.findViewById(R.id.message_field);
|
||||||
|
|
||||||
|
@ -96,8 +99,9 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment {
|
||||||
horizontalSelectionAdapter.setSelectedItemByTitle(getString(selectedUploadVisibility.getTitleId()));
|
horizontalSelectionAdapter.setSelectedItemByTitle(getString(selectedUploadVisibility.getTitleId()));
|
||||||
horizontalSelectionAdapter.setListener(new HorizontalSelectionAdapterListener() {
|
horizontalSelectionAdapter.setListener(new HorizontalSelectionAdapterListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(HorizontalSelectionAdapter.HorizontalSelectionItem item) {
|
public void onItemSelected(HorizontalSelectionItem item) {
|
||||||
selectedUploadVisibility = (OsmEditingPlugin.UploadVisibility) item.getObject();
|
selectedUploadVisibility = (OsmEditingPlugin.UploadVisibility) item.getObject();
|
||||||
|
settings.OSM_UPLOAD_VISIBILITY.set(selectedUploadVisibility);
|
||||||
visibilityName.setText(selectedUploadVisibility.getTitleId());
|
visibilityName.setText(selectedUploadVisibility.getTitleId());
|
||||||
visibilityDescription.setText(selectedUploadVisibility.getDescriptionId());
|
visibilityDescription.setText(selectedUploadVisibility.getDescriptionId());
|
||||||
horizontalSelectionAdapter.notifyDataSetChanged();
|
horizontalSelectionAdapter.notifyDataSetChanged();
|
||||||
|
|
|
@ -47,6 +47,7 @@ import net.osmand.plus.helpers.enums.SpeedConstants;
|
||||||
import net.osmand.plus.helpers.enums.TracksSortByMode;
|
import net.osmand.plus.helpers.enums.TracksSortByMode;
|
||||||
import net.osmand.plus.mapmarkers.CoordinateInputFormats.Format;
|
import net.osmand.plus.mapmarkers.CoordinateInputFormats.Format;
|
||||||
import net.osmand.plus.mapmarkers.MapMarkersMode;
|
import net.osmand.plus.mapmarkers.MapMarkersMode;
|
||||||
|
import net.osmand.plus.osmedit.OsmEditingPlugin.UploadVisibility;
|
||||||
import net.osmand.plus.profiles.LocationIcon;
|
import net.osmand.plus.profiles.LocationIcon;
|
||||||
import net.osmand.plus.profiles.NavigationIcon;
|
import net.osmand.plus.profiles.NavigationIcon;
|
||||||
import net.osmand.plus.profiles.ProfileIconColors;
|
import net.osmand.plus.profiles.ProfileIconColors;
|
||||||
|
@ -1135,6 +1136,7 @@ public class OsmandSettings {
|
||||||
// this value string is synchronized with settings_pref.xml preference name
|
// this value string is synchronized with settings_pref.xml preference name
|
||||||
public final OsmandPreference<String> OSM_USER_NAME = new StringPreference(this, "user_name", "").makeGlobal().makeShared();
|
public final OsmandPreference<String> OSM_USER_NAME = new StringPreference(this, "user_name", "").makeGlobal().makeShared();
|
||||||
public final OsmandPreference<String> OSM_USER_DISPLAY_NAME = new StringPreference(this, "user_display_name", "").makeGlobal().makeShared();
|
public final OsmandPreference<String> OSM_USER_DISPLAY_NAME = new StringPreference(this, "user_display_name", "").makeGlobal().makeShared();
|
||||||
|
public final CommonPreference<UploadVisibility> OSM_UPLOAD_VISIBILITY = new EnumStringPreference<>(this, "upload_visibility", UploadVisibility.PUBLIC, UploadVisibility.values()).makeGlobal().makeShared();
|
||||||
|
|
||||||
public static final String BILLING_USER_DONATION_WORLD_PARAMETER = "";
|
public static final String BILLING_USER_DONATION_WORLD_PARAMETER = "";
|
||||||
public static final String BILLING_USER_DONATION_NONE_PARAMETER = "none";
|
public static final String BILLING_USER_DONATION_NONE_PARAMETER = "none";
|
||||||
|
|
Loading…
Reference in a new issue