From 5196977a33e2de08b20be1ae373ed1821185009f Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Sun, 1 Nov 2020 18:38:18 +0200 Subject: [PATCH] OpenStreetMap editing, plugin settings --- OsmAnd/res/layout/bottom_sheet_login.xml | 49 +++++++ OsmAnd/res/layout/preference_login.xml | 81 +++++++++++ OsmAnd/res/values/strings.xml | 10 +- OsmAnd/res/xml/osm_editing.xml | 10 +- .../base/MenuBottomSheetDialogFragment.java | 2 +- .../LoginBottomSheetFragment.java | 135 ++++++++++++++++++ .../plus/osmedit/OsmEditingFragment.java | 87 +++++------ .../osmedit/ValidateOsmLoginDetailsTask.java | 12 +- .../bottomsheets/OsmLoginDataBottomSheet.java | 13 +- .../fragments/ImportCompleteFragment.java | 2 +- 10 files changed, 345 insertions(+), 56 deletions(-) create mode 100644 OsmAnd/res/layout/bottom_sheet_login.xml create mode 100644 OsmAnd/res/layout/preference_login.xml create mode 100644 OsmAnd/src/net/osmand/plus/measurementtool/LoginBottomSheetFragment.java diff --git a/OsmAnd/res/layout/bottom_sheet_login.xml b/OsmAnd/res/layout/bottom_sheet_login.xml new file mode 100644 index 0000000000..e8bf2a3ee5 --- /dev/null +++ b/OsmAnd/res/layout/bottom_sheet_login.xml @@ -0,0 +1,49 @@ + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/preference_login.xml b/OsmAnd/res/layout/preference_login.xml new file mode 100644 index 0000000000..01c566a969 --- /dev/null +++ b/OsmAnd/res/layout/preference_login.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 7861393b31..790280186c 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,6 +11,14 @@ Thx - Hardy --> + Account + Use login and password + You need to login to upload new or modified changes. \n\nYou can log in using the safe OAuth method or use your login and password. + You can view all your unloaded edits or OSM bugs in %1$s. Uploaded points don’t show in OsmAnd. + Sing in with OpenStreetMap + Login to OpenStreetMap.org + Login to OpenStreetMap + These plugin setting are global, and apply to all profiles Travel Emergency Sport @@ -481,9 +489,7 @@ Route recalculation Announce Username and password - These settings apply to all profiles. OSM editing - View your edits or OSM bugs not yet uploaded in %1$s. Uploaded points will not show any more. OSM Icon shown while navigating or moving. Icon shown at rest. diff --git a/OsmAnd/res/xml/osm_editing.xml b/OsmAnd/res/xml/osm_editing.xml index 990a15349c..53f20cb7a0 100644 --- a/OsmAnd/res/xml/osm_editing.xml +++ b/OsmAnd/res/xml/osm_editing.xml @@ -16,9 +16,13 @@ android:key="osm_login_data" android:layout="@layout/preference_with_descr" android:persistent="false" - android:title="@string/login_and_pass" - tools:icon="@drawable/ic_action_openstreetmap_logo" - tools:summary="@string/open_street_map_login_descr" /> + android:title="@string/login_open_street_map" /> + + { private OsmandApplication app; + private final WeakReference fragmentRef; - public ValidateOsmLoginDetailsTask(OsmandApplication app) { + public ValidateOsmLoginDetailsTask(OsmandApplication app, OsmEditingFragment targetfragment) { this.app = app; + this.fragmentRef = new WeakReference<>(targetfragment); } @Override @@ -26,9 +30,15 @@ public class ValidateOsmLoginDetailsTask extends AsyncTask