diff --git a/3party/Alohalytics b/3party/Alohalytics index 5c46d5b4c7..6fc3b425c3 160000 --- a/3party/Alohalytics +++ b/3party/Alohalytics @@ -1 +1 @@ -Subproject commit 5c46d5b4c7fc6f24fa01076be1ce55a824a2b5e8 +Subproject commit 6fc3b425c324855b3a8bfdce706bdb32b1947cee diff --git a/3party/opening_hours/opening_hours_tests/opening_hours_tests.cpp b/3party/opening_hours/opening_hours_tests/opening_hours_tests.cpp index 3bef1f5c31..833462d77c 100644 --- a/3party/opening_hours/opening_hours_tests/opening_hours_tests.cpp +++ b/3party/opening_hours/opening_hours_tests/opening_hours_tests.cpp @@ -924,6 +924,11 @@ BOOST_AUTO_TEST_CASE(OpeningHoursWeekRanges_TestParseUnparse) BOOST_AUTO_TEST_CASE(OpeningHoursRuleSequence_TestParseUnparse) { + { + auto const rule = ""; + auto const parsedUnparsed = ParseAndUnparse(rule); + BOOST_CHECK_EQUAL(parsedUnparsed, rule); + } { auto const rule = "24/7"; auto const parsedUnparsed = ParseAndUnparse(rule); diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index b18b5f247c..b552b89b0d 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -237,6 +237,7 @@ android:configChanges="orientation|screenLayout|screenSize" android:label="@string/edit_place" android:theme="@style/MwmTheme.EditorActivity" + android:windowSoftInputMode="adjustResize|stateHidden" android:parentActivityName="com.mapswithme.maps.MwmActivity"> SetRouteBuildingListener(bind(&CallRoutingListener, jni::make_global_ref(listener), _1, _2)); } JNIEXPORT void JNICALL Java_com_mapswithme_maps_Framework_nativeSetRouteProgressListener(JNIEnv * env, jclass, jobject listener) { + CHECK(g_framework, ("Framework isn't created yet!")); frm()->SetRouteProgressListener(bind(&CallRouteProgressListener, jni::make_global_ref(listener), _1)); } @@ -980,10 +987,21 @@ Java_com_mapswithme_maps_Framework_nativeOnBookmarkCategoryChanged(JNIEnv * env, } JNIEXPORT void JNICALL -Java_com_mapswithme_maps_Framework_nativeTurnChoosePositionMode(JNIEnv *, jclass, jboolean turnOn, jboolean isBusiness) +Java_com_mapswithme_maps_Framework_nativeTurnOnChoosePositionMode(JNIEnv *, jclass, jboolean isBusiness, jboolean applyPosition) { - //TODO(Android team): implement positioning - g_framework->SetChoosePositionMode(turnOn, isBusiness, false /* hasPosition */, m2::PointD()); + g_framework->SetChoosePositionMode(true, isBusiness, applyPosition, applyPosition ? g_framework->GetPlacePageInfo().GetMercator() : m2::PointD()); +} + +JNIEXPORT void JNICALL +Java_com_mapswithme_maps_Framework_nativeTurnOffChoosePositionMode(JNIEnv *, jclass) +{ + g_framework->SetChoosePositionMode(false, false, false, m2::PointD()); +} + +JNIEXPORT jboolean JNICALL +Java_com_mapswithme_maps_Framework_nativeIsInChoosePositionMode(JNIEnv *, jclass) +{ + return g_framework->GetChoosePositionMode(); } JNIEXPORT jboolean JNICALL @@ -1004,4 +1022,10 @@ Java_com_mapswithme_maps_Framework_nativeIsActiveObjectABuilding(JNIEnv * env, j { return g_framework->GetPlacePageInfo().IsBuilding(); } + +JNIEXPORT jboolean JNICALL +Java_com_mapswithme_maps_Framework_nativeCanAddPlaceFromPlacePage(JNIEnv * env, jclass clazz) +{ + return g_framework->GetPlacePageInfo().ShouldShowAddPlace(); +} } // extern "C" diff --git a/android/jni/com/mapswithme/maps/Framework.hpp b/android/jni/com/mapswithme/maps/Framework.hpp index 154b0f5130..b95cb0c7f5 100644 --- a/android/jni/com/mapswithme/maps/Framework.hpp +++ b/android/jni/com/mapswithme/maps/Framework.hpp @@ -138,6 +138,7 @@ namespace android void Get3dMode(bool & allow3d, bool & allow3dBuildings); void SetChoosePositionMode(bool isChoosePositionMode, bool isBusiness, bool hasPosition, m2::PointD const & position); + bool GetChoosePositionMode(); void SetupWidget(gui::EWidget widget, float x, float y, dp::Anchor anchor); void ApplyWidgets(); diff --git a/android/jni/com/mapswithme/maps/LocationState.cpp b/android/jni/com/mapswithme/maps/LocationState.cpp index 346f6f960d..6d12d1c2b6 100644 --- a/android/jni/com/mapswithme/maps/LocationState.cpp +++ b/android/jni/com/mapswithme/maps/LocationState.cpp @@ -6,36 +6,36 @@ extern "C" { - JNIEXPORT void JNICALL - Java_com_mapswithme_maps_LocationState_switchToNextMode(JNIEnv * env, jobject thiz) - { - g_framework->NativeFramework()->SwitchMyPositionNextMode(); - } - - JNIEXPORT jint JNICALL - Java_com_mapswithme_maps_LocationState_getLocationStateMode(JNIEnv * env, jobject thiz) - { - return g_framework->GetMyPositionMode(); - } - - void LocationStateModeChanged(location::EMyPositionMode mode, bool routingActive, shared_ptr const & obj) - { - g_framework->SetMyPositionMode(mode); - - JNIEnv * env = jni::GetEnv(); - env->CallVoidMethod(*obj, jni::GetMethodID(env, *obj.get(), "onMyPositionModeChangedCallback", "(IZ)V"), - static_cast(mode), static_cast(routingActive)); - } - - JNIEXPORT void JNICALL - Java_com_mapswithme_maps_LocationState_setMyPositionModeListener(JNIEnv * env, jobject thiz, jobject obj) - { - g_framework->SetMyPositionModeListener(bind(&LocationStateModeChanged, _1, _2, jni::make_global_ref(obj))); - } - - JNIEXPORT void JNICALL - Java_com_mapswithme_maps_LocationState_removeMyPositionModeListener(JNIEnv * env, jobject thiz, jint slotID) - { - g_framework->SetMyPositionModeListener(location::TMyPositionModeChanged()); - } +JNIEXPORT void JNICALL +Java_com_mapswithme_maps_LocationState_nativeSwitchToNextMode(JNIEnv * env, jobject thiz) +{ + g_framework->NativeFramework()->SwitchMyPositionNextMode(); } + +JNIEXPORT jint JNICALL +Java_com_mapswithme_maps_LocationState_nativeGetMode(JNIEnv * env, jobject thiz) +{ + return g_framework->GetMyPositionMode(); +} + +void LocationStateModeChanged(location::EMyPositionMode mode, bool routingActive, shared_ptr const & obj) +{ + g_framework->SetMyPositionMode(mode); + + JNIEnv * env = jni::GetEnv(); + env->CallVoidMethod(*obj, jni::GetMethodID(env, *obj.get(), "onMyPositionModeChangedCallback", "(IZ)V"), + static_cast(mode), static_cast(routingActive)); +} + +JNIEXPORT void JNICALL +Java_com_mapswithme_maps_LocationState_nativeSetListener(JNIEnv * env, jobject thiz, jobject obj) +{ + g_framework->SetMyPositionModeListener(bind(&LocationStateModeChanged, _1, _2, jni::make_global_ref(obj))); +} + +JNIEXPORT void JNICALL +Java_com_mapswithme_maps_LocationState_nativeRemoveListener(JNIEnv * env, jobject thiz, jint slotID) +{ + g_framework->SetMyPositionModeListener(location::TMyPositionModeChanged()); +} +} // extern "C" diff --git a/android/jni/com/mapswithme/maps/MwmApplication.cpp b/android/jni/com/mapswithme/maps/MwmApplication.cpp index d3d461764d..161e23400a 100644 --- a/android/jni/com/mapswithme/maps/MwmApplication.cpp +++ b/android/jni/com/mapswithme/maps/MwmApplication.cpp @@ -29,12 +29,6 @@ extern "C" android::Platform::Instance().ProcessFunctor(functorPointer); } - JNIEXPORT jboolean JNICALL - Java_com_mapswithme_maps_MwmApplication_nativeHasFreeSpace(JNIEnv * env, jclass clazz, jlong size) - { - return android::Platform::Instance().HasAvailableSpaceForWriting(size); - } - JNIEXPORT void JNICALL Java_com_mapswithme_maps_MwmApplication_nativeAddLocalization(JNIEnv * env, jclass clazz, jstring name, jstring value) { diff --git a/android/jni/com/mapswithme/maps/editor/Editor.cpp b/android/jni/com/mapswithme/maps/editor/Editor.cpp index b1a5697699..8384ca5dd7 100644 --- a/android/jni/com/mapswithme/maps/editor/Editor.cpp +++ b/android/jni/com/mapswithme/maps/editor/Editor.cpp @@ -401,6 +401,28 @@ Java_com_mapswithme_maps_editor_Editor_nativeCreateMapObject(JNIEnv *, jclass, j ("Couldn't create mapobject, wrong coordinates of missing mwm")); } +// static void nativeCreateNote(String text); +JNIEXPORT void JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeCreateNote(JNIEnv * env, jclass clazz, jstring text) +{ + Editor::Instance().CreateNote(g_editableMapObject.GetLatLon(), g_editableMapObject.GetID(), + osm::Editor::NoteProblemType::General, jni::ToNativeString(env, text)); +} + +// static void nativePlaceDoesNotExist(String comment); +JNIEXPORT void JNICALL +Java_com_mapswithme_maps_editor_Editor_nativePlaceDoesNotExist(JNIEnv * env, jclass clazz, jstring comment) +{ + Editor::Instance().CreateNote(g_editableMapObject.GetLatLon(), g_editableMapObject.GetID(), + osm::Editor::NoteProblemType::PlaceDoesNotExist, jni::ToNativeString(env, comment)); +} + +JNIEXPORT void JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeRollbackMapObject(JNIEnv * env, jclass clazz) +{ + g_framework->NativeFramework()->RollBackChanges(g_editableMapObject.GetID()); +} + JNIEXPORT jobjectArray JNICALL Java_com_mapswithme_maps_editor_Editor_nativeGetAllFeatureCategories(JNIEnv * env, jclass clazz, jstring jLang) { @@ -481,22 +503,6 @@ Java_com_mapswithme_maps_editor_Editor_nativeGetMwmVersion(JNIEnv * env, jclass return g_editableMapObject.GetID().GetMwmVersion(); } -// static void nativeCreateNote(String text); -JNIEXPORT void JNICALL -Java_com_mapswithme_maps_editor_Editor_nativeCreateNote(JNIEnv * env, jclass clazz, jstring text) -{ - Editor::Instance().CreateNote(g_editableMapObject.GetLatLon(), g_editableMapObject.GetID(), - osm::Editor::NoteProblemType::General, jni::ToNativeString(env, text)); -} - -// static void nativePlaceDoesNotExist(); -JNIEXPORT void JNICALL -Java_com_mapswithme_maps_editor_Editor_nativePlaceDoesNotExist(JNIEnv * env, jclass clazz) -{ - Editor::Instance().CreateNote(g_editableMapObject.GetLatLon(), g_editableMapObject.GetID(), - osm::Editor::NoteProblemType::PlaceDoesNotExist, ""); -} - // static boolean nativeIsHouseValid(String houseNumber); JNIEXPORT jboolean JNICALL Java_com_mapswithme_maps_editor_Editor_nativeIsHouseValid(JNIEnv * env, jclass clazz, jstring houseNumber) @@ -509,4 +515,18 @@ Java_com_mapswithme_maps_editor_Editor_nativeGetCategory(JNIEnv * env, jclass cl { return jni::ToJavaString(env, g_editableMapObject.GetLocalizedType()); } + +// @FeatureStatus +// static native int nativeGetMapObjectStatus(); +JNIEXPORT jint JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeGetMapObjectStatus(JNIEnv * env, jclass clazz) +{ + return static_cast(osm::Editor::Instance().GetFeatureStatus(g_editableMapObject.GetID().m_mwmId, g_editableMapObject.GetID().m_index)); +} + +JNIEXPORT jboolean JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeIsMapObjectUploaded(JNIEnv * env, jclass clazz) +{ + return osm::Editor::Instance().IsFeatureUploaded(g_editableMapObject.GetID().m_mwmId, g_editableMapObject.GetID().m_index); +} } // extern "C" diff --git a/android/jni/com/mapswithme/platform/Platform.cpp b/android/jni/com/mapswithme/platform/Platform.cpp index b64cf1308d..91521d69e0 100644 --- a/android/jni/com/mapswithme/platform/Platform.cpp +++ b/android/jni/com/mapswithme/platform/Platform.cpp @@ -121,11 +121,9 @@ namespace android m_settingsDir = jni::ToNativeString(env, storagePath); m_tmpDir = jni::ToNativeString(env, tmpPath); + // Custom storage isn't set. Use primary storage. if (!settings::Get("StoragePath", m_writableDir)) - { - LOG(LINFO, ("Could not read writable dir. Use primary storage.")); m_writableDir = m_settingsDir; - } string const obbPath = jni::ToNativeString(env, obbGooglePath); Platform::FilesList files; diff --git a/android/res/color/color_timepicker_tab.xml b/android/res/color/color_timepicker_tab.xml deleted file mode 100644 index dbb832244a..0000000000 --- a/android/res/color/color_timepicker_tab.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/android/res/layout-w600dp-port/place_page_details.xml b/android/res/layout-w600dp-port/place_page_details.xml index 851a2a809b..33f1f3fcdf 100644 --- a/android/res/layout-w600dp-port/place_page_details.xml +++ b/android/res/layout-w600dp-port/place_page_details.xml @@ -57,6 +57,8 @@ + + @@ -13,7 +13,8 @@ android:layout_marginBottom="@dimen/margin_base" android:textAppearance="@style/MwmTextAppearance.Title"/> - @@ -22,9 +23,8 @@ style="@style/MwmWidget.PlacePage.EditText" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/name" android:singleLine="true"/> - + diff --git a/android/res/layout/fragment_auth_editor.xml b/android/res/layout/fragment_auth_editor.xml index 1b244827ad..ebcbcfd8c7 100644 --- a/android/res/layout/fragment_auth_editor.xml +++ b/android/res/layout/fragment_auth_editor.xml @@ -40,6 +40,8 @@ android:layout_height="match_parent" android:orientation="vertical" android:padding="@dimen/margin_half_plus" + android:clipToPadding="false" + android:clipChildren="false" tools:ignore="ScrollViewSize"> + android:orientation="vertical" + android:clipToPadding="false" + android:clipChildren="false">