merge
This commit is contained in:
commit
843ba63cf3
14 changed files with 299 additions and 94 deletions
|
@ -1640,4 +1640,84 @@
|
|||
<string name="poi_payment_bancomat_yes">S\'accepten targes Bancomat</string>
|
||||
<string name="poi_payment_bancomat_no">No s\'accepten targes Bancomat</string>
|
||||
<string name="poi_payment_prepaid_ticket_yes">S\'accepten tiquets de prepagament</string>
|
||||
<string name="poi_payment_jcb_yes">S\'accepten targes JCB</string>
|
||||
<string name="poi_payment_jcb_no">No s\'accepten targes JCB</string>
|
||||
<string name="poi_payment_laser_yes">S\'accepten targes Laser</string>
|
||||
<string name="poi_payment_laser_no">No s\'accepten targes Laser</string>
|
||||
<string name="poi_payment_ep_quick_yes">S\'accepten targes Quick</string>
|
||||
<string name="poi_payment_ep_quick_no">No s\'accepten targes Quick</string>
|
||||
<string name="poi_payment_eurowag_yes">S\'accepten targes Eurowag</string>
|
||||
<string name="poi_payment_eurowag_no">No s\'accepten targes Eurowag</string>
|
||||
<string name="poi_payment_e_zpass_yes">S\'accepta E-ZPass</string>
|
||||
<string name="poi_payment_e_zpass_no">No s\'accepta E-ZPass</string>
|
||||
<string name="poi_payment_euroshell_yes">S\'accepten targes de carburant Euroshell</string>
|
||||
<string name="poi_payment_euroshell_no">No s\'accepten targes de carburant Euroshell</string>
|
||||
<string name="poi_payment_kitcard_yes">S\'accepta KITCard</string>
|
||||
<string name="poi_payment_kitcard_no">No s\'accepta KITCard</string>
|
||||
<string name="poi_payment_westfalen_card_yes">S\'accepten targes Westfalen</string>
|
||||
<string name="poi_payment_westfalen_card_no">No s\'accepten targes Westfalen</string>
|
||||
<string name="poi_payment_v_pay_yes">S\'accepten targes V PAY</string>
|
||||
<string name="poi_payment_v_pay_no">No s\'accepten targes V PAY</string>
|
||||
<string name="poi_payment_dogecoin_yes">S\'accepta Dogecoin</string>
|
||||
<string name="poi_payment_dogecoin_no">No s\'accepta Dogecoin</string>
|
||||
<string name="poi_payment_cibus_yes">S\'accepten targes Cibus</string>
|
||||
<string name="poi_payment_cibus_no">No s\'accepten targes Cibus</string>
|
||||
<string name="poi_payment_ep_proton_yes">S\'accepten targes Proton</string>
|
||||
<string name="poi_payment_ep_proton_no">No s\'accepten targes Proton</string>
|
||||
<string name="poi_payment_ep_avant_yes">S\'accepta AvantCard</string>
|
||||
<string name="poi_payment_ep_avant_no">No s\'accepta AvantCard</string>
|
||||
<string name="poi_payment_ep_mep_yes">S\'accepta MEP</string>
|
||||
<string name="poi_payment_ep_mep_no">No s\'accepta MEP</string>
|
||||
<string name="poi_payment_ep_minicash_yes">S\'accepta MiniCash</string>
|
||||
<string name="poi_payment_ep_minicash_no">No s\'accepta MiniCash</string>
|
||||
<string name="poi_payment_ep_moneo_yes">S\'accepta Moneo</string>
|
||||
<string name="poi_payment_ep_moneo_no">No s\'accepta Moneo</string>
|
||||
<string name="poi_payment_ep_monedero4b_yes">S\'accepta Monedero 4B</string>
|
||||
<string name="poi_payment_ep_monedero4b_no">No s\'accepta Monedero 4B</string>
|
||||
<string name="poi_payment_ep_monedero_yes">S\'accepta Monedero</string>
|
||||
<string name="poi_payment_ep_monedero_no">No s\'accepta Monedero</string>
|
||||
<string name="poi_payment_bankaxess_yes">S\'accepta BankAxess</string>
|
||||
<string name="poi_payment_bankaxess_no">No s\'accepta BankAxess</string>
|
||||
<string name="poi_payment_coinkite_yes">S\'accepta Coinkite</string>
|
||||
<string name="poi_payment_coinkite_no">No s\'accepta Coinkite</string>
|
||||
<string name="poi_payment_roadrunner_yes">S\'accepten targes Roadrunner</string>
|
||||
<string name="poi_payment_roadrunner_no">No s\'accepten targes Roadrunner</string>
|
||||
<string name="poi_payment_svg_yes">S\'accepta SVG</string>
|
||||
<string name="poi_payment_svg_no">No s\'accepta SVG</string>
|
||||
<string name="poi_payment_sms_yes">S\'accepten pagaments SMS</string>
|
||||
<string name="poi_payment_sms_no">No s\'accepten pagaments SMS</string>
|
||||
<string name="poi_payment_ov_chipkaart_yes">S\'accepta OV-Chipkaart</string>
|
||||
<string name="poi_payment_ov_chipkaart_no">No s\'accepta OV-Chipkaart</string>
|
||||
<string name="poi_payment_oyster_yes">S\'accepten targes Oyster</string>
|
||||
<string name="poi_payment_oyster_no">No s\'accepten targes Oyster</string>
|
||||
<string name="poi_payment_sube_yes">S\'accepten targes SUBE</string>
|
||||
<string name="poi_payment_sube_no">No s\'accepten targes SUBE</string>
|
||||
<string name="poi_payment_via_verde_yes">S\'accepta Via Verde</string>
|
||||
<string name="poi_payment_via_verde_no">No s\'accepta Via Verde</string>
|
||||
<string name="poi_payment_paypal_yes">S\'accepta PayPal</string>
|
||||
<string name="poi_payment_paypal_no">No s\'accepta PayPal</string>
|
||||
<string name="poi_payment_u_key_yes">S\'accepta U-Key</string>
|
||||
<string name="poi_payment_u_key_no">No s\'accepta U-Key</string>
|
||||
<string name="poi_payment_token_yes">S\'accepta Tokens</string>
|
||||
<string name="poi_payment_token_no">No s\'accepta Tokens</string>
|
||||
<string name="poi_payment_golden_crown_yes">S\'accepten targes Golden Crown</string>
|
||||
<string name="poi_payment_golden_crown_no">No s\'accepten targes Golden Crown</string>
|
||||
<string name="poi_payment_pro100_yes">S\'accepten targes PRO100</string>
|
||||
<string name="poi_payment_pro100_no">No s\'accepten targes PRO100</string>
|
||||
<string name="poi_payment_union_card_yes">S\'accepta Union Card</string>
|
||||
<string name="poi_payment_union_card_no">No s\'accepta Union Card</string>
|
||||
<string name="poi_payment_mtsmoney_yes">S\'accepta MTS-Money</string>
|
||||
<string name="poi_payment_mtsmoney_no">No s\'accepta MTS-Money</string>
|
||||
<string name="poi_payment_yandexmoney_yes">S\'accepta Yandex.Money</string>
|
||||
<string name="poi_payment_yandexmoney_no">No s\'accepta Yandex.Money</string>
|
||||
<string name="poi_diet_vegetarian_only">Només dieta vegetariana</string>
|
||||
<string name="poi_diet_vegetarian_yes">Dieta vegetariana</string>
|
||||
<string name="poi_diet_vegetarian_no">Dieta vegetariana: no</string>
|
||||
<string name="poi_diet_vegetarian_few">Dieta vegetariana: algun plat</string>
|
||||
<string name="poi_diet_vegan_only">Només dieta vegana</string>
|
||||
<string name="poi_diet_vegan_yes">Dieta vegana</string>
|
||||
<string name="poi_diet_vegan_no">Dieta vegana: no</string>
|
||||
<string name="poi_diet_gluten_free_only">Només dieta per celíacs</string>
|
||||
<string name="poi_diet_gluten_free_yes">Dieta per celíacs</string>
|
||||
<string name="poi_diet_gluten_free_no">Dieta per celíacs:no</string>
|
||||
</resources>
|
||||
|
|
|
@ -2384,4 +2384,9 @@
|
|||
|
||||
<string name="poi_conveying_yes">Движущаяся(йся): да</string>
|
||||
|
||||
<string name="poi_bridge_ref">Метка моста</string>
|
||||
<string name="poi_tunnel_ref">Метка туннеля</string>
|
||||
|
||||
<string name="poi_ref">Метка</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -1970,4 +1970,5 @@
|
|||
<string name="feedback">Återkoppling</string>
|
||||
<string name="read_more">Läs mer</string>
|
||||
<string name="whats_new">Nyheter</string>
|
||||
<string name="rendering_attr_hideProposed_name">Dölj föreslagna objekt</string>
|
||||
</resources>
|
|
@ -2378,5 +2378,9 @@
|
|||
|
||||
<string name="poi_conveying_yes">Conveying: yes</string>
|
||||
|
||||
<string name="poi_bridge_ref">Bridge ref</string>
|
||||
<string name="poi_tunnel_ref">Tunnel ref</string>
|
||||
|
||||
<string name="poi_ref">Ref</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -265,23 +265,11 @@ public class AppInitializer implements IProgress {
|
|||
}
|
||||
app.poiTypes.setPoiTranslator(new MapPoiTypes.PoiTranslator() {
|
||||
|
||||
public String getLangTranslation(String l) {
|
||||
try {
|
||||
Field f = R.string.class.getField("lang_"+l);
|
||||
if (f != null) {
|
||||
Integer in = (Integer) f.get(null);
|
||||
return app.getString(in);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println(e.getMessage());
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTranslation(AbstractPoiType type) {
|
||||
if(type.getBaseLangType() != null) {
|
||||
return getTranslation(type.getBaseLangType()) + " (" + getLangTranslation(type.getLang()).toLowerCase() +")";
|
||||
return getTranslation(type.getBaseLangType()) + " (" + app.getLangTranslation(type.getLang()).toLowerCase() +")";
|
||||
}
|
||||
try {
|
||||
Field f = R.string.class.getField("poi_" + type.getIconKeyName());
|
||||
|
|
|
@ -715,4 +715,16 @@ public class OsmandApplication extends Application {
|
|||
}
|
||||
|
||||
|
||||
public String getLangTranslation(String l) {
|
||||
try {
|
||||
java.lang.reflect.Field f = R.string.class.getField("lang_"+l);
|
||||
if (f != null) {
|
||||
Integer in = (Integer) f.get(null);
|
||||
return getString(in);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println(e.getMessage());
|
||||
}
|
||||
return l;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,9 +11,11 @@ import android.view.ViewGroup;
|
|||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.OsmAndAppCustomization;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.activities.search.SearchActivity;
|
||||
import net.osmand.plus.dashboard.tools.DashFragmentData;
|
||||
import net.osmand.plus.helpers.FontCache;
|
||||
|
@ -45,11 +47,17 @@ public class DashSearchFragment extends DashBaseFragment {
|
|||
|
||||
|
||||
protected void searchActivity(final Activity activity, final OsmAndAppCustomization appCustomization, int tab) {
|
||||
final Intent search = new Intent(activity, appCustomization.getSearchActivity());
|
||||
//search.putExtra(SearchActivity.SHOW_ONLY_ONE_TAB, true);
|
||||
search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
Intent newIntent = new Intent(activity, appCustomization.getSearchActivity());
|
||||
// causes wrong position caching: newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
LatLon loc = ((MapActivity)activity).getMapLocation();
|
||||
newIntent.putExtra(SearchActivity.SEARCH_LAT, loc.getLatitude());
|
||||
newIntent.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude());
|
||||
if(((MapActivity)activity).getMapViewTrackingUtilities().isMapLinkedToLocation()) {
|
||||
newIntent.putExtra(SearchActivity.SEARCH_NEARBY, true);
|
||||
}
|
||||
newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
getMyApplication().getSettings().SEARCH_TAB.set(tab);
|
||||
activity.startActivity(search);
|
||||
activity.startActivity(newIntent);
|
||||
}
|
||||
|
||||
private void setupButtons(View view) {
|
||||
|
|
|
@ -416,20 +416,13 @@ public class ConfigureMapMenu {
|
|||
public static String[] mapNamesIds = new String[] { "", "en", "als", "af", "ar", "az", "be", "bg", "bn", "bpy", "br", "bs", "ca", "ceb", "cs", "cy", "da", "de", "el", "et", "es", "eu", "fa", "fi", "fr", "fy", "ga", "gl", "he", "hi", "hr", "ht", "hu", "hy", "id", "is", "it", "ja", "ka", "ko", "ku", "la", "lb", "lt", "lv", "mk", "ml", "mr", "ms", "nds", "new", "nl", "nn", "no", "nv", "os", "pl", "pms", "pt", "ro", "ru", "sh", "sc", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", "tl", "tr", "uk", "vi", "vo", "zh" };
|
||||
|
||||
public static String[] getMapNamesValues(Context ctx) {
|
||||
return new String[] { ctx.getString(R.string.local_map_names), ctx.getString(R.string.lang_en),
|
||||
ctx.getString(R.string.lang_ar),
|
||||
ctx.getString(R.string.lang_be), ctx.getString(R.string.lang_bg), ctx.getString(R.string.lang_ca), ctx.getString(R.string.lang_ceb), ctx.getString(R.string.lang_cs),
|
||||
ctx.getString(R.string.lang_da), ctx.getString(R.string.lang_de), ctx.getString(R.string.lang_el), ctx.getString(R.string.lang_et),
|
||||
ctx.getString(R.string.lang_es), ctx.getString(R.string.lang_fi), ctx.getString(R.string.lang_fr), ctx.getString(R.string.lang_gl),
|
||||
ctx.getString(R.string.lang_he), ctx.getString(R.string.lang_hi), ctx.getString(R.string.lang_hr),
|
||||
ctx.getString(R.string.lang_ht), ctx.getString(R.string.lang_hu), ctx.getString(R.string.lang_id), ctx.getString(R.string.lang_it), ctx.getString(R.string.lang_ja),
|
||||
ctx.getString(R.string.lang_ko), ctx.getString(R.string.lang_lt),
|
||||
ctx.getString(R.string.lang_lv), ctx.getString(R.string.lang_ms), ctx.getString(R.string.lang_new), ctx.getString(R.string.lang_nl), ctx.getString(R.string.lang_nn),
|
||||
ctx.getString(R.string.lang_no),
|
||||
ctx.getString(R.string.lang_pl), ctx.getString(R.string.lang_pt), ctx.getString(R.string.lang_ro), ctx.getString(R.string.lang_ru),
|
||||
ctx.getString(R.string.lang_sk), ctx.getString(R.string.lang_sl), ctx.getString(R.string.lang_sr), ctx.getString(R.string.lang_sv),
|
||||
ctx.getString(R.string.lang_sw), ctx.getString(R.string.lang_te), ctx.getString(R.string.lang_th), ctx.getString(R.string.lang_tr), ctx.getString(R.string.lang_uk),
|
||||
ctx.getString(R.string.lang_vi), ctx.getString(R.string.lang_vo), ctx.getString(R.string.lang_zh) };
|
||||
String[] translates = new String[mapNamesIds.length];
|
||||
translates[0] = ctx.getString(R.string.local_map_names);
|
||||
for(int i = 1; i < translates.length; i++) {
|
||||
translates[i] = ((OsmandApplication)ctx.getApplicationContext()).getLangTranslation(mapNamesIds[i]);
|
||||
}
|
||||
|
||||
return translates;
|
||||
}
|
||||
|
||||
private void createProperties(List<RenderingRuleProperty> customRules, final int strId, String cat,
|
||||
|
|
|
@ -680,11 +680,8 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
TextView distanceText = (TextView) view.findViewById(R.id.distance);
|
||||
ImageView direction = (ImageView) view.findViewById(R.id.direction);
|
||||
|
||||
boolean mapLinked = getMapActivity().getMapViewTrackingUtilities().isMapLinkedToLocation() && menu.getMyLocation() != null;
|
||||
float myHeading = menu.getHeading() == null ? 0f : menu.getHeading();
|
||||
float h = !mapLinked ? -getMapActivity().getMapRotate() : myHeading;
|
||||
|
||||
DashLocationFragment.updateLocationView(!mapLinked, menu.getMyLocation(), h, direction, distanceText,
|
||||
DashLocationFragment.updateLocationView(false, menu.getMyLocation(), myHeading, direction, distanceText,
|
||||
menu.getLatLon().getLatitude(), menu.getLatLon().getLongitude(), screenOrientation, getMyApplication(), getActivity());
|
||||
}
|
||||
|
||||
|
@ -910,10 +907,6 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
}
|
||||
|
||||
public void updateLocation(boolean centerChanged, boolean locationChanged, boolean compassChanged) {
|
||||
boolean mapLinkedToLocation = getMapActivity().getMapViewTrackingUtilities().isMapLinkedToLocation();
|
||||
if (compassChanged && !mapLinkedToLocation) {
|
||||
return;
|
||||
}
|
||||
updateDistanceDirection();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,11 +23,14 @@ import net.osmand.plus.mapcontextmenu.controllers.HistoryMenuController;
|
|||
import net.osmand.plus.mapcontextmenu.controllers.MapDataMenuController;
|
||||
import net.osmand.plus.mapcontextmenu.controllers.MyLocationMenuController;
|
||||
import net.osmand.plus.mapcontextmenu.controllers.OsMoMenuController;
|
||||
import net.osmand.plus.mapcontextmenu.controllers.OsmBugMenuController;
|
||||
import net.osmand.plus.mapcontextmenu.controllers.ParkingPositionMenuController;
|
||||
import net.osmand.plus.mapcontextmenu.controllers.PointDescriptionMenuController;
|
||||
import net.osmand.plus.mapcontextmenu.controllers.TargetPointMenuController;
|
||||
import net.osmand.plus.mapcontextmenu.controllers.WptPtMenuController;
|
||||
import net.osmand.plus.mapcontextmenu.other.ShareMenu;
|
||||
import net.osmand.plus.osmedit.OsmBugsLayer;
|
||||
import net.osmand.plus.osmedit.OsmBugsLayer.OpenStreetNote;
|
||||
import net.osmand.plus.osmedit.OsmPoint;
|
||||
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;
|
||||
|
||||
|
@ -89,6 +92,8 @@ public abstract class MenuController extends BaseMenuController {
|
|||
menuController = new WptPtMenuController(app, mapActivity, pointDescription, (WptPt) object);
|
||||
} else if (object instanceof BinaryMapDataObject) {
|
||||
menuController = new MapDataMenuController(app, mapActivity, pointDescription, (BinaryMapDataObject) object);
|
||||
} else if (object instanceof OpenStreetNote) {
|
||||
menuController = new OsmBugMenuController(app, mapActivity, pointDescription, (OpenStreetNote) object);
|
||||
} else if (object instanceof LatLon) {
|
||||
if (pointDescription.isParking()) {
|
||||
menuController = new ParkingPositionMenuController(app, mapActivity, pointDescription);
|
||||
|
@ -213,11 +218,11 @@ public abstract class MenuController extends BaseMenuController {
|
|||
}
|
||||
|
||||
public boolean needStreetName() {
|
||||
return true;
|
||||
return !displayDistanceDirection();
|
||||
}
|
||||
|
||||
public boolean needTypeStr() {
|
||||
return menuType != MenuType.STANDARD;
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean displayStreetNameInTitle() {
|
||||
|
@ -238,7 +243,7 @@ public abstract class MenuController extends BaseMenuController {
|
|||
|
||||
public String getTypeStr() { return ""; }
|
||||
|
||||
public String getNameStr() { return ""; }
|
||||
public String getNameStr() { return pointDescription.getName(); }
|
||||
|
||||
public void share(LatLon latLon, String title) {
|
||||
ShareMenu.show(latLon, title, getMapActivity());
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
package net.osmand.plus.mapcontextmenu.controllers;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.PointDescription;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.mapcontextmenu.MenuBuilder;
|
||||
import net.osmand.plus.mapcontextmenu.MenuController;
|
||||
import net.osmand.plus.osmedit.OsmBugsLayer.OpenStreetNote;
|
||||
import net.osmand.plus.osmedit.OsmEditingPlugin;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
public class OsmBugMenuController extends MenuController {
|
||||
|
||||
private OsmEditingPlugin plugin;
|
||||
private OpenStreetNote bug;
|
||||
|
||||
public OsmBugMenuController(OsmandApplication app, final MapActivity mapActivity, PointDescription pointDescription, final OpenStreetNote bug) {
|
||||
super(new MenuBuilder(app), pointDescription, mapActivity);
|
||||
plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class);
|
||||
this.bug = bug;
|
||||
|
||||
leftTitleButtonController = new TitleButtonController() {
|
||||
@Override
|
||||
public void buttonPressed() {
|
||||
if (plugin != null) {
|
||||
plugin.getBugsLayer(getMapActivity()).commentBug(bug);
|
||||
}
|
||||
}
|
||||
};
|
||||
leftTitleButtonController.caption = getMapActivity().getString(R.string.poi_dialog_comment);
|
||||
leftTitleButtonController.leftIconId = R.drawable.ic_action_note_dark;
|
||||
|
||||
rightTitleButtonController = new TitleButtonController() {
|
||||
@Override
|
||||
public void buttonPressed() {
|
||||
if (plugin != null) {
|
||||
plugin.getBugsLayer(getMapActivity()).closeBug(bug);
|
||||
}
|
||||
}
|
||||
};
|
||||
rightTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_close);
|
||||
rightTitleButtonController.leftIconId = R.drawable.ic_action_remove_dark;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getSupportedMenuStatesPortrait() {
|
||||
return MenuState.HEADER_ONLY | MenuState.HALF_SCREEN | MenuState.FULL_SCREEN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Drawable getLeftIcon() {
|
||||
return getIcon(R.drawable.ic_action_gabout_dark, R.color.osmand_orange_dark, R.color.osmand_orange);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeStr() {
|
||||
return getPointDescription().getTypeName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPlainMenuItems(String typeStr, PointDescription pointDescription, LatLon latLon) {
|
||||
super.addPlainMenuItems(typeStr, pointDescription, latLon);
|
||||
for (String description : bug.getCommentDescriptionList()) {
|
||||
addPlainMenuItem(R.drawable.ic_action_note_dark, description, true);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -621,7 +621,7 @@ public class EditPoiDialogFragment extends DialogFragment {
|
|||
public void onClick(DialogInterface dialog, int which) {
|
||||
String c = comment == null ? null : comment.getText().toString();
|
||||
boolean closeChangeSet = closeChangesetCheckBox != null
|
||||
&& closeChangesetCheckBox.isSelected();
|
||||
&& closeChangesetCheckBox.isChecked();
|
||||
commitNode(OsmPoint.Action.DELETE, n, openstreetmapUtil.getEntityInfo(), c,
|
||||
closeChangeSet, new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -46,6 +46,7 @@ import java.io.InputStreamReader;
|
|||
import java.io.Serializable;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider, DialogProvider {
|
||||
|
@ -278,6 +279,9 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
|
|||
}
|
||||
}
|
||||
reader.close();
|
||||
for (OpenStreetNote note : bugs) {
|
||||
note.acquireDescriptionAndType();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.warn("Error loading bugs", e); //$NON-NLS-1$
|
||||
} catch (NumberFormatException e) {
|
||||
|
@ -412,14 +416,17 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
|
|||
builder.setView(view);
|
||||
((EditText)view.findViewById(R.id.userNameEditText)).setText(getUserName());
|
||||
((EditText)view.findViewById(R.id.passwordEditText)).setText(((OsmandApplication) activity.getApplication()).getSettings().USER_PASSWORD.get());
|
||||
AndroidUtils.softKeyboardDelayed((EditText)view.findViewById(R.id.messageEditText));
|
||||
AndroidUtils.softKeyboardDelayed((EditText) view.findViewById(R.id.messageEditText));
|
||||
builder.setNegativeButton(R.string.shared_string_cancel, null);
|
||||
builder.setPositiveButton(R.string.osb_comment_dialog_add_button, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
OpenStreetNote bug = (OpenStreetNote) args.getSerializable(KEY_BUG);
|
||||
String text = getTextAndUpdateUserPwd(view);
|
||||
addingCommentAsync(bug, text, getUserName());
|
||||
if (bug != null) {
|
||||
String text = getTextAndUpdateUserPwd(view);
|
||||
addingCommentAsync(bug, text, getUserName());
|
||||
activity.getContextMenu().close();
|
||||
}
|
||||
}
|
||||
});
|
||||
return builder.create();
|
||||
|
@ -459,11 +466,12 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
|
|||
OpenStreetNote bug = (OpenStreetNote) args.getSerializable(KEY_BUG);
|
||||
String us = activity.getMyApplication().getSettings().USER_NAME.get();
|
||||
String pwd = activity.getMyApplication().getSettings().USER_PASSWORD.get();
|
||||
if(us.length() == 0 || pwd.length() == 0) {
|
||||
if (us.length() == 0 || pwd.length() == 0) {
|
||||
AccessibleToast.makeText(activity, activity.getString(R.string.osb_author_or_password_not_specified),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
closingAsync(bug, "");
|
||||
activity.getContextMenu().close();
|
||||
}
|
||||
});
|
||||
return builder.create();
|
||||
|
@ -497,31 +505,6 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
|
|||
executeTaskInBackground(task);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populateObjectContextMenu(Object o, ContextMenuAdapter adapter) {
|
||||
if(o instanceof OpenStreetNote) {
|
||||
final OpenStreetNote bug = (OpenStreetNote) o;
|
||||
OnContextMenuClick listener = new OnContextMenuClick() {
|
||||
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
|
||||
if (itemId == R.string.osb_comment_menu_item) {
|
||||
commentBug(bug);
|
||||
} else if (itemId == R.string.osb_close_menu_item) {
|
||||
closeBug(bug);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
adapter.item(R.string.osb_comment_menu_item).iconColor(
|
||||
R.drawable.ic_action_note_dark
|
||||
).listen(listener).reg();
|
||||
adapter.item(R.string.osb_close_menu_item).iconColor(
|
||||
R.drawable.ic_action_remove_dark
|
||||
).listen(listener).reg();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectDescription(Object o) {
|
||||
if(o instanceof OpenStreetNote){
|
||||
|
@ -533,7 +516,10 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
|
|||
@Override
|
||||
public PointDescription getObjectName(Object o) {
|
||||
if(o instanceof OpenStreetNote){
|
||||
return new PointDescription(PointDescription.POINT_TYPE_OSM_NOTE, ((OpenStreetNote)o).getCommentDescription());
|
||||
OpenStreetNote bug = (OpenStreetNote) o;
|
||||
String name = bug.description != null ? bug.description : "";
|
||||
String typeName = bug.typeName != null ? bug.typeName : activity.getString(R.string.osb_bug_name);
|
||||
return new PointDescription(PointDescription.POINT_TYPE_OSM_NOTE, typeName, name);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -587,39 +573,97 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
|
|||
private static final long serialVersionUID = -7848941747811172615L;
|
||||
private double latitude;
|
||||
private double longitude;
|
||||
private String name;
|
||||
private String description;
|
||||
private String typeName;
|
||||
private List<String> dates = new ArrayList<String>();
|
||||
private List<String> comments = new ArrayList<String>();
|
||||
private List<String> users = new ArrayList<String>();
|
||||
private long id;
|
||||
private boolean opened;
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
public void setLatitude(double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
public void setLongitude(double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getCommentDescription() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
private void acquireDescriptionAndType() {
|
||||
for (int i = 0; i < comments.size(); i++) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (i < dates.size()) {
|
||||
sb.append(dates.get(i)).append(" ");
|
||||
}
|
||||
if (i < users.size()) {
|
||||
sb.append(users.get(i)).append(" : ");
|
||||
sb.append(users.get(i));
|
||||
}
|
||||
sb.append(comments.get(i)).append("\n");
|
||||
description = comments.get(i);
|
||||
typeName = sb.toString();
|
||||
break;
|
||||
}
|
||||
if (description != null) {
|
||||
if (comments.size() > 0) {
|
||||
comments.remove(0);
|
||||
}
|
||||
if (dates.size() > 0) {
|
||||
dates.remove(0);
|
||||
}
|
||||
if (users.size() > 0) {
|
||||
users.remove(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public String getCommentDescription() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String s : getCommentDescriptionList()) {
|
||||
if (sb.length() > 0) {
|
||||
sb.append("\n");
|
||||
}
|
||||
sb.append(s);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public List<String> getCommentDescriptionList() {
|
||||
List<String> res = new ArrayList<>(comments.size());
|
||||
for (int i = 0; i < comments.size(); i++) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
boolean needLineFeed = false;
|
||||
if (i < dates.size()) {
|
||||
sb.append(dates.get(i)).append(" ");
|
||||
needLineFeed = true;
|
||||
}
|
||||
if (i < users.size()) {
|
||||
sb.append(users.get(i)).append(":");
|
||||
needLineFeed = true;
|
||||
}
|
||||
if (needLineFeed) {
|
||||
sb.append("\n");
|
||||
}
|
||||
sb.append(comments.get(i));
|
||||
res.add(sb.toString());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class UploadOpenstreetmapPointAsyncTask
|
|||
loadErrorsMap.put(point, errorMessage);
|
||||
}
|
||||
}
|
||||
if(uploaded) {
|
||||
if(uploaded && closeChangeSet) {
|
||||
remotepoi.closeChangeSet();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue