diff --git a/android/app/src/main/cpp/app/organicmaps/editor/OsmOAuth.cpp b/android/app/src/main/cpp/app/organicmaps/editor/OsmOAuth.cpp index fc18cf19f8..9987212c80 100644 --- a/android/app/src/main/cpp/app/organicmaps/editor/OsmOAuth.cpp +++ b/android/app/src/main/cpp/app/organicmaps/editor/OsmOAuth.cpp @@ -112,4 +112,10 @@ Java_app_organicmaps_editor_OsmOAuth_nativeGetHistoryUrl(JNIEnv * env, jclass, j { return jni::ToJavaString(env, OsmOAuth::ServerAuth().GetHistoryURL(jni::ToNativeString(env, user))); } + +JNIEXPORT jstring JNICALL +Java_app_organicmaps_editor_OsmOAuth_nativeGetNotesUrl(JNIEnv * env, jclass, jstring user) +{ + return jni::ToJavaString(env, OsmOAuth::ServerAuth().GetNotesURL(jni::ToNativeString(env, user))); +} } // extern "C" diff --git a/android/app/src/main/java/app/organicmaps/editor/OsmOAuth.java b/android/app/src/main/java/app/organicmaps/editor/OsmOAuth.java index a8afa2f3b6..0df60c1ccb 100644 --- a/android/app/src/main/java/app/organicmaps/editor/OsmOAuth.java +++ b/android/app/src/main/java/app/organicmaps/editor/OsmOAuth.java @@ -100,6 +100,11 @@ public final class OsmOAuth return nativeGetHistoryUrl(getUsername(context)); } + public static String getNotesUrl(@NonNull Context context) + { + return nativeGetNotesUrl(getUsername(context)); + } + /* Returns 5 strings: ServerURL, ClientId, ClientSecret, Scope, RedirectUri */ @@ -133,6 +138,10 @@ public final class OsmOAuth @NonNull public static native String nativeGetHistoryUrl(String user); + @WorkerThread + @NonNull + public static native String nativeGetNotesUrl(String user); + /** * @return < 0 if failed to get changesets count. */ diff --git a/android/app/src/main/java/app/organicmaps/editor/ProfileFragment.java b/android/app/src/main/java/app/organicmaps/editor/ProfileFragment.java index f548fec4da..c2fdbafe37 100644 --- a/android/app/src/main/java/app/organicmaps/editor/ProfileFragment.java +++ b/android/app/src/main/java/app/organicmaps/editor/ProfileFragment.java @@ -57,6 +57,7 @@ public class ProfileFragment extends BaseMwmToolbarFragment mProfileImage = mUserInfoBlock.findViewById(R.id.user_profile_image); view.findViewById(R.id.about_osm).setOnClickListener((v) -> Utils.openUrl(requireActivity(), getString(R.string.osm_wiki_about_url))); view.findViewById(R.id.osm_history).setOnClickListener((v) -> Utils.openUrl(requireActivity(), OsmOAuth.getHistoryUrl(requireContext()))); + view.findViewById(R.id.osm_notes).setOnClickListener((v) -> Utils.openUrl(requireActivity(), OsmOAuth.getNotesUrl(requireContext()))); } diff --git a/android/app/src/main/res/layout/fragment_osm_profile.xml b/android/app/src/main/res/layout/fragment_osm_profile.xml index 6e4c0db8be..78acddb50b 100644 --- a/android/app/src/main/res/layout/fragment_osm_profile.xml +++ b/android/app/src/main/res/layout/fragment_osm_profile.xml @@ -86,11 +86,13 @@ + + + app:layout_constraintTop_toTopOf="parent" /> + + +