From 7fca41d7634a5e6af15694d4c113dcab9280a9f6 Mon Sep 17 00:00:00 2001 From: Dmitry Yunitsky Date: Mon, 18 Apr 2016 15:58:18 +0300 Subject: [PATCH 01/10] [android] Display and edit category in editor. --- .../jni/com/mapswithme/maps/editor/Editor.cpp | 7 + android/res/layout/fragment_editor.xml | 173 ++++++++++++------ android/res/values/styles-editor.xml | 1 + .../src/com/mapswithme/maps/MwmActivity.java | 2 + .../com/mapswithme/maps/editor/Editor.java | 2 + .../maps/editor/EditorFragment.java | 11 +- .../maps/editor/EditorHostFragment.java | 10 + 7 files changed, 146 insertions(+), 60 deletions(-) diff --git a/android/jni/com/mapswithme/maps/editor/Editor.cpp b/android/jni/com/mapswithme/maps/editor/Editor.cpp index 526489d7fb..d8150be125 100644 --- a/android/jni/com/mapswithme/maps/editor/Editor.cpp +++ b/android/jni/com/mapswithme/maps/editor/Editor.cpp @@ -373,4 +373,11 @@ Java_com_mapswithme_maps_editor_Editor_nativeIsHouseValid(JNIEnv * env, jclass c { return osm::EditableMapObject::ValidateHouseNumber(jni::ToNativeString(env, houseNumber)); } + +// static boolean nativeGetCategory(); +JNIEXPORT jstring JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeGetCategory(JNIEnv * env, jclass clazz) +{ + return jni::ToJavaString(env, g_editableMapObject.GetLocalizedType()); +} } // extern "C" diff --git a/android/res/layout/fragment_editor.xml b/android/res/layout/fragment_editor.xml index dd781d8967..f244a30414 100644 --- a/android/res/layout/fragment_editor.xml +++ b/android/res/layout/fragment_editor.xml @@ -4,18 +4,73 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:padding="@dimen/margin_half" tools:context=".editor.EditorActivity" tools:ignore="DuplicateIds"> - + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/android/res/values/styles-editor.xml b/android/res/values/styles-editor.xml index 94adf3fa12..28741749c9 100644 --- a/android/res/values/styles-editor.xml +++ b/android/res/values/styles-editor.xml @@ -27,6 +27,7 @@