diff --git a/.gitignore b/.gitignore index fa2b55bd10..02e6ae4ce7 100644 --- a/.gitignore +++ b/.gitignore @@ -130,4 +130,6 @@ tools/android/mapswithme.keystore tools/android/yota.keystore android/secure.properties android/fabric.properties +android/pushwoosh.properties +android/res/values/google-service.xml server diff --git a/3party/opening_hours/opening_hours.cpp b/3party/opening_hours/opening_hours.cpp index ea603b43fc..c673d9fc6f 100644 --- a/3party/opening_hours/opening_hours.cpp +++ b/3party/opening_hours/opening_hours.cpp @@ -321,6 +321,14 @@ bool Timespan::HasExtendedHours() const return endHM.GetDuration() <= startHM.GetDuration(); } +void Timespan::ExpandPlus() +{ + if (HasPlus()) + { + SetEnd(HourMinutes(24_h)); + } +} + std::ostream & operator<<(std::ostream & ost, Timespan const & span) { ost << span.GetStart(); @@ -768,6 +776,7 @@ bool OpeningHours::IsValid() const { return m_valid; } + bool OpeningHours::IsTwentyFourHours() const { return m_rule.size() == 1 && m_rule[0].IsTwentyFourHours(); diff --git a/3party/opening_hours/opening_hours.hpp b/3party/opening_hours/opening_hours.hpp index 20f17d86ce..83d0ff3d83 100644 --- a/3party/opening_hours/opening_hours.hpp +++ b/3party/opening_hours/opening_hours.hpp @@ -231,6 +231,8 @@ public: void SetPeriod(TimespanPeriod const & period) { m_period = period; } void SetPlus(bool const plus) { m_plus = plus; } + void ExpandPlus(); + private: Time m_start; Time m_end; diff --git a/3party/opening_hours/opening_hours_parsers.hpp b/3party/opening_hours/opening_hours_parsers.hpp index d1e0618ead..37b74f6fb8 100644 --- a/3party/opening_hours/opening_hours_parsers.hpp +++ b/3party/opening_hours/opening_hours_parsers.hpp @@ -373,7 +373,8 @@ public: [bind(&Timespan::SetStart, _val, _1), bind(&Timespan::SetPlus, _val, true)] - | time[bind(&Timespan::SetStart, _val, _1)] + // This rule is only used for collection_times tag wish is not in our interest. + // | time[bind(&Timespan::SetStart, _val, _1)] ; main %= timespan % ','; 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 833462d77c..d59b7ba6a9 100644 --- a/3party/opening_hours/opening_hours_tests/opening_hours_tests.cpp +++ b/3party/opening_hours/opening_hours_tests/opening_hours_tests.cpp @@ -664,11 +664,6 @@ BOOST_AUTO_TEST_CASE(OpeningHours_RuleSequence) BOOST_AUTO_TEST_CASE(OpeningHoursTimerange_TestParseUnparse) { - { - auto const rule = "06:00"; - auto const parsedUnparsed = ParseAndUnparse(rule); - BOOST_CHECK_EQUAL(parsedUnparsed, rule); - } { auto const rule = "06:00+"; auto const parsedUnparsed = ParseAndUnparse(rule); @@ -700,9 +695,9 @@ BOOST_AUTO_TEST_CASE(OpeningHoursTimerange_TestParseUnparse) BOOST_CHECK_EQUAL(parsedUnparsed, rule); } { - auto const rule = "dusk"; + auto const rule = "dusk+"; auto const parsedUnparsed = ParseAndUnparse(rule); - BOOST_CHECK_EQUAL(parsedUnparsed, "sunset"); + BOOST_CHECK_EQUAL(parsedUnparsed, "sunset+"); } { auto const rule = "dawn+"; @@ -715,7 +710,7 @@ BOOST_AUTO_TEST_CASE(OpeningHoursTimerange_TestParseUnparse) BOOST_CHECK_EQUAL(parsedUnparsed, rule); } { - auto const rule = "(sunset-12:12)"; + auto const rule = "(sunset-12:12)+"; auto const parsedUnparsed = ParseAndUnparse(rule); BOOST_CHECK_EQUAL(parsedUnparsed, rule); } @@ -1005,7 +1000,7 @@ BOOST_AUTO_TEST_CASE(OpeningHoursRuleSequence_TestParseUnparse) BOOST_CHECK_EQUAL(parsedUnparsed, rule); } { - auto const rule = "06:00-02:00/21:03, 18:15"; + auto const rule = "06:00-02:00/21:03, 18:15-sunset"; auto const parsedUnparsed = ParseAndUnparse(rule); BOOST_CHECK_EQUAL(parsedUnparsed, rule); } @@ -1048,7 +1043,7 @@ BOOST_AUTO_TEST_CASE(OpeningHoursRuleSequence_TestParseUnparse) BOOST_CHECK_EQUAL(parsedUnparsed, rule); } { - auto const rule = "Su-Th (sunset-24:00); Fr-Sa (sunrise+12:12)"; + auto const rule = "Su-Th sunrise-(sunset-24:00); Fr-Sa (sunrise+12:12)-sunset"; auto const parsedUnparsed = ParseAndUnparse(rule); BOOST_CHECK_EQUAL(parsedUnparsed, rule); } @@ -1504,9 +1499,8 @@ BOOST_AUTO_TEST_CASE(OpeningHours_TestIsOpen) BOOST_CHECK(Parse("06:13-15:00; 16:30+", rules)); BOOST_CHECK(IsOpen(rules, "2013-12-12 7:00")); + BOOST_CHECK(IsOpen(rules, "2013-12-12 20:00")); BOOST_CHECK(IsClosed(rules, "2013-12-12 16:00")); - /// Open end is not supported yet, so evaluate to close - BOOST_CHECK(IsClosed(rules, "2013-12-12 20:00")); } { TRuleSequences rules; @@ -1538,6 +1532,15 @@ BOOST_AUTO_TEST_CASE(OpeningHours_TestIsOpen) BOOST_CHECK(IsClosed(rules, "2015-04-12 14:15")); BOOST_CHECK(IsClosed(rules, "2016-04-12 20:15")); } + { + TRuleSequences rules; + BOOST_CHECK(Parse("Mo-Th 15:00+; Fr-Su 13:00+", rules)); + + BOOST_CHECK(!IsOpen(rules, "2016-06-06 13:14")); + BOOST_CHECK(IsOpen(rules, "2016-06-06 17:06")); + BOOST_CHECK(IsOpen(rules, "2016-06-05 13:06")); + BOOST_CHECK(IsOpen(rules, "2016-05-31 18:28")); + } } @@ -1568,4 +1571,18 @@ BOOST_AUTO_TEST_CASE(OpeningHours_TestOpeningHours) OpeningHours oh("Nov +1"); BOOST_CHECK(!oh.IsValid()); } + { + OpeningHours oh("Mo-Th 15:00+; Fr-Su 13:00+"); + BOOST_CHECK(oh.IsValid()); + + std::tm time = {}; + BOOST_CHECK(GetTimeTuple("2016-05-31 18:28", fmt, time)); + BOOST_CHECK(oh.IsOpen(mktime(&time))); + + BOOST_CHECK(GetTimeTuple("2016-05-31 22:28", fmt, time)); + BOOST_CHECK(oh.IsOpen(mktime(&time))); + + BOOST_CHECK(GetTimeTuple("2016-05-31 10:30", fmt, time)); + BOOST_CHECK(oh.IsClosed(mktime(&time))); + } } diff --git a/3party/opening_hours/rules_evaluation.cpp b/3party/opening_hours/rules_evaluation.cpp index 3762b8360d..7fdac0f3e9 100644 --- a/3party/opening_hours/rules_evaluation.cpp +++ b/3party/opening_hours/rules_evaluation.cpp @@ -190,12 +190,13 @@ namespace osmoh // ADL shadows ::operator==. using ::operator==; -bool IsActive(Timespan const & span, std::tm const & time) +bool IsActive(Timespan span, std::tm const & time) { // Timespan with e.h. should be split into parts with no e.h. // before calling IsActive(). // TODO(mgsergio): set assert(!span.HasExtendedHours()) + span.ExpandPlus(); if (span.HasStart() && span.HasEnd()) { THourMinutes start; @@ -331,7 +332,6 @@ bool IsActive(RuleSequence const & rule, time_t const timestamp) if (checkIsActive(rule, dateTimeTMShifted) && IsActive(additionalSpan, dateTimeTMShifted)) - { return true; } diff --git a/3party/opening_hours/rules_evaluation_private.hpp b/3party/opening_hours/rules_evaluation_private.hpp index 37329574ea..a5a15ef9a7 100644 --- a/3party/opening_hours/rules_evaluation_private.hpp +++ b/3party/opening_hours/rules_evaluation_private.hpp @@ -6,7 +6,7 @@ namespace osmoh { -bool IsActive(Timespan const & spsn, std::tm const & date); +bool IsActive(Timespan span, std::tm const & date); bool IsActive(WeekdayRange const & range, std::tm const & date); bool IsActive(Holiday const & holiday, std::tm const & date); bool IsActive(Weekdays const & weekdays, std::tm const & date); diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index b552b89b0d..e4f5359f39 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -65,14 +65,22 @@ android:name="com.facebook.sdk.ApplicationId" android:value="@string/fb_app_id"/> - - + + + + + + - - + + + + - + - - + + - - - - - - - - - - - - + + + + + + + + + + + diff --git a/android/build.gradle b/android/build.gradle index 4e1080fff4..4d6c830b78 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -40,15 +40,15 @@ dependencies { compile 'com.google.android.gms:play-services-location:8.4.0' compile 'com.google.android.gms:play-services-analytics:8.4.0' compile 'com.google.android.gms:play-services-plus:8.4.0' + compile 'com.google.android.gms:play-services-gcm:8.4.0' // crash reporting compile 'net.hockeyapp.android:HockeySDK:3.7.1' compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') { transitive = true } compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.2@aar') { transitive = true } // 3-party compile 'com.facebook.android:facebook-android-sdk:4.8.0' - compile 'com.parse.bolts:bolts-android:1.4.0' - compile 'com.parse:parse-android:1.13.0' compile 'com.google.code.gson:gson:2.6.1' + compile 'com.pushwoosh:pushwoosh:4.1.3' compile fileTree(dir: '3rd_party', include: '*.jar') // BottomSheet compile project(":3rd_party:BottomSheet") @@ -94,6 +94,13 @@ android { props.load(new FileInputStream("${projectDir}/fabric.properties")); manifestPlaceholders = [ 'FABRIC_API_KEY': props['apiKey'] ] buildConfigField 'String', 'FABRIC_API_KEY', /"${props['apiKey']}"/ + + // PushWoosh keys + Properties pwProps = new Properties() + pwProps.load(new FileInputStream("${projectDir}/pushwoosh.properties")); + manifestPlaceholders += [ 'PW_APPID': pwProps['pwAppId'] ] + buildConfigField 'String', 'PW_APPID', /"${pwProps['pwAppId']}"/ + manifestPlaceholders += [ 'PW_PROJECT_ID': pwProps['pwProjectId'] ] } sourceSets.main { diff --git a/android/gradle.properties b/android/gradle.properties index 5782486a4f..820d8e1987 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -3,8 +3,8 @@ propMinSdkVersion=15 # https://code.google.com/p/android/issues/detail?id=184567 propTargetSdkVersion=22 propBuildToolsVersion=22.0.1 -propVersionCode=615 -propVersionName=6.1.5 +propVersionCode=620 +propVersionName=6.2.0 propDebugNdkFlags=V=1 NDK_DEBUG=1 DEBUG=1 propReleaseNdkFlags=V=1 NDK_DEBUG=0 PRODUCTION=1 diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 366a9e4745..b2e31bb7c3 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -88,6 +88,7 @@ LOCAL_SRC_FILES := \ com/mapswithme/maps/SearchEngine.cpp \ com/mapswithme/maps/SearchRecents.cpp \ com/mapswithme/maps/UserMarkHelper.cpp \ + com/mapswithme/maps/SponsoredHotel.cpp \ com/mapswithme/maps/settings/UnitLocale.cpp \ com/mapswithme/platform/Platform.cpp \ com/mapswithme/platform/HttpThread.cpp \ diff --git a/android/jni/com/mapswithme/core/jni_helper.cpp b/android/jni/com/mapswithme/core/jni_helper.cpp index 07978b886a..5bf37b0ae0 100644 --- a/android/jni/com/mapswithme/core/jni_helper.cpp +++ b/android/jni/com/mapswithme/core/jni_helper.cpp @@ -60,19 +60,26 @@ JavaVM * GetJVM() return g_jvm; } -jmethodID GetMethodID(JNIEnv * env, jobject obj, char const * fn, char const * sig) +jmethodID GetMethodID(JNIEnv * env, jobject obj, char const * name, char const * signature) { TScopedLocalClassRef clazz(env, env->GetObjectClass(obj)); ASSERT(clazz.get(), ("Can't get class: ", DescribeException())); - jmethodID mid = env->GetMethodID(clazz.get(), fn, sig); - ASSERT(mid, ("Can't get methodID", fn, sig, DescribeException())); + jmethodID mid = env->GetMethodID(clazz.get(), name, signature); + ASSERT(mid, ("Can't get method ID", name, signature, DescribeException())); return mid; } -jmethodID GetConstructorID(JNIEnv * env, jclass clazz, char const * sig) +jmethodID GetStaticMethodID(JNIEnv * env, jclass clazz, char const * name, char const * signature) { - jmethodID const ctorID = env->GetMethodID(clazz, "", sig); + jmethodID mid = env->GetStaticMethodID(clazz, name, signature); + ASSERT(mid, ("Can't get static method ID", name, signature, DescribeException())); + return mid; +} + +jmethodID GetConstructorID(JNIEnv * env, jclass clazz, char const * signature) +{ + jmethodID const ctorID = env->GetMethodID(clazz, "", signature); ASSERT(ctorID, (DescribeException())); return ctorID; } diff --git a/android/jni/com/mapswithme/core/jni_helper.hpp b/android/jni/com/mapswithme/core/jni_helper.hpp index 75896c00f0..8384784437 100644 --- a/android/jni/com/mapswithme/core/jni_helper.hpp +++ b/android/jni/com/mapswithme/core/jni_helper.hpp @@ -17,8 +17,9 @@ namespace jni JNIEnv * GetEnv(); JavaVM * GetJVM(); -jmethodID GetMethodID(JNIEnv * env, jobject obj, char const * fn, char const * sig); -jmethodID GetConstructorID(JNIEnv * env, jclass clazz, char const * sig); +jmethodID GetMethodID(JNIEnv * env, jobject obj, char const * name, char const * signature); +jmethodID GetStaticMethodID(JNIEnv * env, jclass clazz, char const * name, char const * signature); +jmethodID GetConstructorID(JNIEnv * env, jclass clazz, char const * signature); // Result value should be DeleteGlobalRef`ed by caller jclass GetGlobalClassRef(JNIEnv * env, char const * s); diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index 0a83be6233..a748bafa03 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -458,6 +458,11 @@ place_page::Info & Framework::GetPlacePageInfo() return m_info; } +void Framework::RequestBookingMinPrice(string const & hotelId, string const & currencyCode, function const & callback) +{ + return m_work.GetBookingApi().GetMinPrice(hotelId, currencyCode, callback); +} + bool Framework::HasSpaceForMigration() { return m_work.IsEnoughSpaceForMigrate(); @@ -722,7 +727,7 @@ Java_com_mapswithme_maps_Framework_nativeSetWritableDir(JNIEnv * env, jclass, js { string newPath = jni::ToNativeString(env, jNewPath); g_framework->RemoveLocalMaps(); - android::Platform::Instance().SetStoragePath(newPath); + android::Platform::Instance().SetWritableDir(newPath); g_framework->AddLocalMaps(); } @@ -1048,31 +1053,4 @@ Java_com_mapswithme_maps_Framework_nativeGetActiveObjectFormattedCuisine(JNIEnv return jni::ToJavaString(env, g_framework->GetPlacePageInfo().FormatCuisines()); } -JNIEXPORT jboolean JNICALL -Java_com_mapswithme_maps_Framework_nativeIsActiveObjectABuilding(JNIEnv * env, jclass) -{ - return g_framework->GetPlacePageInfo().IsBuilding(); -} - -JNIEXPORT jboolean JNICALL -Java_com_mapswithme_maps_Framework_nativeCanAddPlaceFromPlacePage(JNIEnv * env, jclass clazz) -{ - return g_framework->GetPlacePageInfo().ShouldShowAddPlace(); -} - -JNIEXPORT jobject JNICALL -Java_com_mapswithme_maps_Framework_nativeGetSponsoredHotelInfo(JNIEnv * env, jclass clazz) -{ - place_page::Info const & ppInfo = g_framework->GetPlacePageInfo(); - if (!ppInfo.m_isSponsoredHotel) - return nullptr; - - static jclass const infoClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/widget/placepage/SponsoredHotelInfo"); - static jmethodID const infoCtor = jni::GetConstructorID(env, infoClass, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); - - return env->NewObject(infoClass, infoCtor, jni::ToJavaString(env, ppInfo.GetRatingFormatted()), - jni::ToJavaString(env, ppInfo.GetApproximatePricing()), - jni::ToJavaString(env, ppInfo.GetWebsite())); -} - } // extern "C" diff --git a/android/jni/com/mapswithme/maps/Framework.hpp b/android/jni/com/mapswithme/maps/Framework.hpp index 718db382d9..1e4f34c3d6 100644 --- a/android/jni/com/mapswithme/maps/Framework.hpp +++ b/android/jni/com/mapswithme/maps/Framework.hpp @@ -152,6 +152,7 @@ namespace android void SetPlacePageInfo(place_page::Info const & info); place_page::Info & GetPlacePageInfo(); + void RequestBookingMinPrice(string const & hotelId, string const & currency, function const & callback); bool HasSpaceForMigration(); storage::TCountryId PreMigrate(ms::LatLon const & position, storage::Storage::TChangeCountryFunction const & statusChangeListener, diff --git a/android/jni/com/mapswithme/maps/MapManager.cpp b/android/jni/com/mapswithme/maps/MapManager.cpp index 75a7f5b32d..6889012c1e 100644 --- a/android/jni/com/mapswithme/maps/MapManager.cpp +++ b/android/jni/com/mapswithme/maps/MapManager.cpp @@ -243,7 +243,7 @@ Java_com_mapswithme_maps_downloader_MapManager_nativeGetUpdateInfo(JNIEnv * env, static jclass const infoClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/downloader/UpdateInfo"); ASSERT(infoClass, (jni::DescribeException())); - static jmethodID const ctor = jni::GetConstructorID(env, infoClass, "(II)V"); + static jmethodID const ctor = jni::GetConstructorID(env, infoClass, "(IJ)V"); ASSERT(ctor, (jni::DescribeException())); return env->NewObject(infoClass, ctor, info.m_numberOfMwmFilesToUpdate, info.m_totalUpdateSizeInBytes); diff --git a/android/jni/com/mapswithme/maps/MwmApplication.cpp b/android/jni/com/mapswithme/maps/MwmApplication.cpp index 27ce1b9b7d..f05cce95b1 100644 --- a/android/jni/com/mapswithme/maps/MwmApplication.cpp +++ b/android/jni/com/mapswithme/maps/MwmApplication.cpp @@ -9,6 +9,14 @@ crashlytics_context_t * g_crashlytics; extern "C" { + // static void nativePreparePlatform(String settingsPath); + JNIEXPORT void JNICALL + Java_com_mapswithme_maps_MwmApplication_nativePreparePlatform(JNIEnv * env, jclass clazz, jstring settingsPath) + { + android::Platform::Instance().SetSettingsDir(jni::ToNativeString(env, settingsPath)); + } + + // void nativeInitPlatform(String apkPath, String storagePath, String tmpPath, String obbGooglePath, String flavorName, String buildType, boolean isTablet); JNIEXPORT void JNICALL Java_com_mapswithme_maps_MwmApplication_nativeInitPlatform(JNIEnv * env, jobject thiz, jstring apkPath, jstring storagePath, jstring tmpPath, jstring obbGooglePath, jstring flavorName, jstring buildType, jboolean isTablet) @@ -16,6 +24,7 @@ extern "C" android::Platform::Instance().Initialize(env, thiz, apkPath, storagePath, tmpPath, obbGooglePath, flavorName, buildType, isTablet); } + // static void nativeInitFramework(); JNIEXPORT void JNICALL Java_com_mapswithme_maps_MwmApplication_nativeInitFramework(JNIEnv * env, jclass clazz) { @@ -23,12 +32,14 @@ extern "C" g_framework = new android::Framework(); } + // static void nativeProcessFunctor(long functorPointer); JNIEXPORT void JNICALL Java_com_mapswithme_maps_MwmApplication_nativeProcessFunctor(JNIEnv * env, jclass clazz, jlong functorPointer) { android::Platform::Instance().ProcessFunctor(functorPointer); } + // static void nativeAddLocalization(String name, String value); JNIEXPORT void JNICALL Java_com_mapswithme_maps_MwmApplication_nativeAddLocalization(JNIEnv * env, jclass clazz, jstring name, jstring value) { @@ -36,6 +47,8 @@ extern "C" jni::ToNativeString(env, value)); } + // @UiThread + // static void nativeInitCrashlytics(); JNIEXPORT void JNICALL Java_com_mapswithme_maps_MwmApplication_nativeInitCrashlytics(JNIEnv * env, jclass clazz) { diff --git a/android/jni/com/mapswithme/maps/PrivateVariables.cpp b/android/jni/com/mapswithme/maps/PrivateVariables.cpp index d38feeebbe..55fa8722e8 100644 --- a/android/jni/com/mapswithme/maps/PrivateVariables.cpp +++ b/android/jni/com/mapswithme/maps/PrivateVariables.cpp @@ -22,18 +22,6 @@ extern "C" return env->NewStringUTF(MY_TRACKER_KEY); } - JNIEXPORT jstring JNICALL - Java_com_mapswithme_maps_PrivateVariables_parseApplicationId(JNIEnv * env, jclass clazz) - { - return env->NewStringUTF(PARSE_APPLICATION_ID); - } - - JNIEXPORT jstring JNICALL - Java_com_mapswithme_maps_PrivateVariables_parseClientKey(JNIEnv * env, jclass clazz) - { - return env->NewStringUTF(PARSE_CLIENT_KEY); - } - JNIEXPORT jstring JNICALL Java_com_mapswithme_maps_PrivateVariables_myTargetSlot(JNIEnv * env, jclass clazz) { diff --git a/android/jni/com/mapswithme/maps/SponsoredHotel.cpp b/android/jni/com/mapswithme/maps/SponsoredHotel.cpp new file mode 100644 index 0000000000..b9ece774fd --- /dev/null +++ b/android/jni/com/mapswithme/maps/SponsoredHotel.cpp @@ -0,0 +1,71 @@ +#include "Framework.hpp" + +#include "../core/jni_helper.hpp" +#include "../platform/Platform.hpp" +#include "map/place_page_info.hpp" + +#include "std/bind.hpp" + +namespace +{ + +jclass g_hotelClass; +jmethodID g_hotelClassCtor; +jmethodID g_priceCallback; + +void PrepareClassRefs(JNIEnv * env, jclass hotelClass) +{ + if (g_hotelClass) + return; + + g_hotelClass = static_cast(env->NewGlobalRef(hotelClass)); + + // SponsoredHotel(String rating, String price, String urlBook, String urlDescription) + g_hotelClassCtor = jni::GetConstructorID(env, g_hotelClass, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); + // static void onPriceReceived(final String id, final String price, final String currency) + g_priceCallback = jni::GetStaticMethodID(env, g_hotelClass, "onPriceReceived", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); +} + +} // namespace + +extern "C" +{ + +// static SponsoredHotel nativeGetCurrent(); +JNIEXPORT jobject JNICALL +Java_com_mapswithme_maps_widget_placepage_SponsoredHotel_nativeGetCurrent(JNIEnv * env, jclass clazz) +{ + PrepareClassRefs(env, clazz); + + place_page::Info const & ppInfo = g_framework->GetPlacePageInfo(); + if (!ppInfo.m_isSponsoredHotel) + return nullptr; + + return env->NewObject(g_hotelClass, g_hotelClassCtor, jni::ToJavaString(env, ppInfo.GetRatingFormatted()), + jni::ToJavaString(env, ppInfo.GetApproximatePricing()), + jni::ToJavaString(env, ppInfo.GetSponsoredBookingUrl()), + jni::ToJavaString(env, ppInfo.GetSponsoredDescriptionUrl())); +} + +// static void nativeRequestPrice(String id, String currencyCode); +JNIEXPORT void JNICALL +Java_com_mapswithme_maps_widget_placepage_SponsoredHotel_nativeRequestPrice(JNIEnv * env, jclass clazz, jstring id, jstring currencyCode) +{ + PrepareClassRefs(env, clazz); + + string const hotelId = jni::ToNativeString(env, id); + string const code = jni::ToNativeString(env, currencyCode); + + g_framework->RequestBookingMinPrice(hotelId, code, [hotelId](string const & price, string const & currency) + { + GetPlatform().RunOnGuiThread([=]() + { + JNIEnv * env = jni::GetEnv(); + env->CallStaticVoidMethod(g_hotelClass, g_priceCallback, jni::ToJavaString(env, hotelId), + jni::ToJavaString(env, price), + jni::ToJavaString(env, currency)); + }); + }); +} + +} // extern "C" diff --git a/android/jni/com/mapswithme/maps/editor/Editor.cpp b/android/jni/com/mapswithme/maps/editor/Editor.cpp index bb5091bb1c..b572988e2b 100644 --- a/android/jni/com/mapswithme/maps/editor/Editor.cpp +++ b/android/jni/com/mapswithme/maps/editor/Editor.cpp @@ -244,9 +244,21 @@ Java_com_mapswithme_maps_editor_Editor_nativeSaveEditedFeature(JNIEnv *, jclass) } JNIEXPORT jboolean JNICALL -Java_com_mapswithme_maps_editor_Editor_nativeIsFeatureEditable(JNIEnv *, jclass) +Java_com_mapswithme_maps_editor_Editor_nativeShouldShowEditPlace(JNIEnv *, jclass) { - return g_framework->GetPlacePageInfo().IsEditable(); + return g_framework->GetPlacePageInfo().ShouldShowEditPlace(); +} + +JNIEXPORT jboolean JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeShouldShowAddPlace(JNIEnv *, jclass) +{ + return g_framework->GetPlacePageInfo().ShouldShowAddPlace(); +} + +JNIEXPORT jboolean JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeShouldShowAddBusiness(JNIEnv *, jclass) +{ + return g_framework->GetPlacePageInfo().ShouldShowAddBusiness(); } JNIEXPORT jintArray JNICALL @@ -517,6 +529,41 @@ Java_com_mapswithme_maps_editor_Editor_nativeIsLevelValid(JNIEnv * env, jclass c return osm::EditableMapObject::ValidateBuildingLevels(jni::ToNativeString(env, level)); } +// static boolean nativeIsFlatValid(String flats) +JNIEXPORT jboolean JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeIsFlatValid(JNIEnv * env, jclass clazz, jstring flats) +{ + return osm::EditableMapObject::ValidateFlats(jni::ToNativeString(env, flats)); +} + +// static boolean nativeIsPostCodeValid(String zipCode) +JNIEXPORT jboolean JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeIsZipcodeValid(JNIEnv * env, jclass clazz, jstring zipCode) +{ + return osm::EditableMapObject::ValidatePostCode(jni::ToNativeString(env, zipCode)); +} + +// static boolean nativeIsPhoneValid(String phone) +JNIEXPORT jboolean JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeIsPhoneValid(JNIEnv * env, jclass clazz, jstring phone) +{ + return osm::EditableMapObject::ValidatePhone(jni::ToNativeString(env, phone)); +} + +// static boolean nativeIsWebsiteValid(String website) +JNIEXPORT jboolean JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeIsWebsiteValid(JNIEnv * env, jclass clazz, jstring website) +{ + return osm::EditableMapObject::ValidateWebsite(jni::ToNativeString(env, website)); +} + +// static boolean nativeIsEmailValid(String email) +JNIEXPORT jboolean JNICALL +Java_com_mapswithme_maps_editor_Editor_nativeIsEmailValid(JNIEnv * env, jclass clazz, jstring email) +{ + return osm::EditableMapObject::ValidateEmail(jni::ToNativeString(env, email)); +} + JNIEXPORT jstring JNICALL Java_com_mapswithme_maps_editor_Editor_nativeGetCategory(JNIEnv * env, jclass clazz) { diff --git a/android/jni/com/mapswithme/maps/editor/OsmOAuth.cpp b/android/jni/com/mapswithme/maps/editor/OsmOAuth.cpp index 11b1d96be6..dd91eccb88 100644 --- a/android/jni/com/mapswithme/maps/editor/OsmOAuth.cpp +++ b/android/jni/com/mapswithme/maps/editor/OsmOAuth.cpp @@ -1,11 +1,15 @@ #include #include "com/mapswithme/core/jni_helper.hpp" +#include "com/mapswithme/maps/Framework.hpp" #include "base/logging.hpp" +#include "base/string_utils.hpp" +#include "base/timer.hpp" #include "editor/osm_auth.hpp" #include "editor/server_api.hpp" +#include "editor/user_stats.hpp" namespace { @@ -115,4 +119,33 @@ Java_com_mapswithme_maps_editor_OsmOAuth_nativeGetOsmUsername(JNIEnv * env, jcla return nullptr; } } + +JNIEXPORT void JNICALL +Java_com_mapswithme_maps_editor_OsmOAuth_nativeUpdateOsmUserStats(JNIEnv * env, jclass clazz, jstring jUsername, jboolean forceUpdate) +{ + static jclass const statsClazz = jni::GetGlobalClassRef(env, "com/mapswithme/maps/editor/data/UserStats"); + static jmethodID const statsCtor = jni::GetConstructorID(env, statsClazz, "(IILjava/lang/String;J)V"); + static jclass const osmAuthClazz = static_cast(env->NewGlobalRef(clazz)); + // static void onUserStatsUpdated(UserStats stats) + static jmethodID const listenerId = jni::GetStaticMethodID(env, osmAuthClazz, "onUserStatsUpdated", "(Lcom/mapswithme/maps/editor/data/UserStats;)V"); + + string const username = jni::ToNativeString(env, jUsername); + auto const policy = forceUpdate ? editor::UserStatsLoader::UpdatePolicy::Force + : editor::UserStatsLoader::UpdatePolicy::Lazy; + g_framework->NativeFramework()->UpdateUserStats(username, policy, [username]() + { + editor::UserStats const & userStats = g_framework->NativeFramework()->GetUserStats(username); + if (!userStats.IsValid()) + return; + int32_t count, rank; + string levelUp; + userStats.GetChangesCount(count); + userStats.GetRank(rank); + userStats.GetLevelUpRequiredFeat(levelUp); + JNIEnv * env = jni::GetEnv(); + env->CallStaticVoidMethod(osmAuthClazz, listenerId, + env->NewObject(statsClazz, statsCtor, count, rank, jni::ToJavaString(env, levelUp), + my::TimeTToSecondsSinceEpoch(userStats.GetLastUpdate()))); + }); +} } // extern "C" diff --git a/android/jni/com/mapswithme/platform/Language.cpp b/android/jni/com/mapswithme/platform/Language.cpp index 8069ca1aae..7c64984cf1 100644 --- a/android/jni/com/mapswithme/platform/Language.cpp +++ b/android/jni/com/mapswithme/platform/Language.cpp @@ -34,10 +34,8 @@ string GetAndroidSystemLanguage() } static jclass const localeClass = jni::GetGlobalClassRef(env, "java/util/Locale"); - static jmethodID const localeGetDefaultId = env->GetStaticMethodID(localeClass, "getDefault", "()Ljava/util/Locale;"); - ASSERT(localeGetDefaultId, ()); + static jmethodID const localeGetDefaultId = jni::GetStaticMethodID(env, localeClass, "getDefault", "()Ljava/util/Locale;"); static jmethodID const localeToStringId = env->GetMethodID(localeClass, "toString", "()Ljava/lang/String;"); - ASSERT(localeToStringId, ()); jni::TScopedLocalRef localeInstance(env, env->CallStaticObjectMethod(localeClass, localeGetDefaultId)); jni::TScopedLocalRef langString(env, env->CallObjectMethod(localeInstance.get(), localeToStringId)); diff --git a/android/jni/com/mapswithme/platform/Platform.cpp b/android/jni/com/mapswithme/platform/Platform.cpp index 27856e9398..6b0b1d76ce 100644 --- a/android/jni/com/mapswithme/platform/Platform.cpp +++ b/android/jni/com/mapswithme/platform/Platform.cpp @@ -22,9 +22,7 @@ string Platform::UniqueClientId() const jclass uuidClass = env->FindClass("java/util/UUID"); ASSERT(uuidClass, ("Can't find java class java/util/UUID")); - jmethodID randomUUIDId = env->GetStaticMethodID(uuidClass, "randomUUID", "()Ljava/util/UUID;"); - ASSERT(randomUUIDId, ("Can't find static java/util/UUID.randomUUIDId() method")); - + jmethodID randomUUIDId = jni::GetStaticMethodID(env, uuidClass, "randomUUID", "()Ljava/util/UUID;"); jobject uuidInstance = env->CallStaticObjectMethod(uuidClass, randomUUIDId); ASSERT(uuidInstance, ("UUID.randomUUID() returned NULL")); @@ -59,9 +57,7 @@ string Platform::GetMemoryInfo() const static shared_ptr classMemLogging = jni::make_global_ref(env->FindClass("com/mapswithme/util/log/MemLogging")); ASSERT(classMemLogging, ()); - static jmethodID const getMemoryInfoId = env->GetStaticMethodID(static_cast(*classMemLogging), "getMemoryInfo", "()Ljava/lang/String;"); - ASSERT(getMemoryInfoId, ()); - + static jmethodID const getMemoryInfoId = jni::GetStaticMethodID(env, static_cast(*classMemLogging), "getMemoryInfo", "()Ljava/lang/String;"); jstring const memInfoString = (jstring)env->CallStaticObjectMethod(static_cast(*classMemLogging), getMemoryInfoId); ASSERT(memInfoString, ()); @@ -82,9 +78,7 @@ Platform::EConnectionType Platform::ConnectionStatus() static shared_ptr clazzConnectionState = jni::make_global_ref(env->FindClass("com/mapswithme/util/ConnectionState")); ASSERT(clazzConnectionState, ()); - static jmethodID const getConnectionMethodId = env->GetStaticMethodID(static_cast(*clazzConnectionState), "getConnectionState", "()B"); - ASSERT(getConnectionMethodId, ()); - + static jmethodID const getConnectionMethodId = jni::GetStaticMethodID(env, static_cast(*clazzConnectionState), "getConnectionState", "()B"); return static_cast(env->CallStaticByteMethod(static_cast(*clazzConnectionState), getConnectionMethodId)); } @@ -117,13 +111,8 @@ namespace android m_isTablet = isTablet; m_resourcesDir = jni::ToNativeString(env, apkPath); - // Settings file should be in a one place always (default external storage). - 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)) - m_writableDir = m_settingsDir; + m_writableDir = jni::ToNativeString(env, storagePath); string const obbPath = jni::ToNativeString(env, obbGooglePath); Platform::FilesList files; @@ -135,7 +124,6 @@ namespace android LOG(LINFO, ("Apk path = ", m_resourcesDir)); LOG(LINFO, ("Writable path = ", m_writableDir)); LOG(LINFO, ("Temporary path = ", m_tmpDir)); - LOG(LINFO, ("Settings path = ", m_settingsDir)); LOG(LINFO, ("OBB Google path = ", obbPath)); LOG(LINFO, ("OBB Google files = ", files)); @@ -165,10 +153,17 @@ namespace android return m_writableDir.substr(0, i); } - void Platform::SetStoragePath(string const & path) + void Platform::SetWritableDir(string const & dir) { - m_writableDir = path; + m_writableDir = dir; settings::Set("StoragePath", m_writableDir); + LOG(LINFO, ("Writable path = ", m_writableDir)); + } + + void Platform::SetSettingsDir(string const & dir) + { + m_settingsDir = dir; + LOG(LINFO, ("Settings path = ", m_settingsDir)); } bool Platform::HasAvailableSpaceForWriting(uint64_t size) const diff --git a/android/jni/com/mapswithme/platform/Platform.hpp b/android/jni/com/mapswithme/platform/Platform.hpp index 8ee36a66fe..2b11f6c9a5 100644 --- a/android/jni/com/mapswithme/platform/Platform.hpp +++ b/android/jni/com/mapswithme/platform/Platform.hpp @@ -23,7 +23,8 @@ namespace android /// get storage path without ending "/MapsWithMe/" string GetStoragePathPrefix() const; /// assign storage path (should contain ending "/MapsWithMe/") - void SetStoragePath(string const & path); + void SetWritableDir(string const & dir); + void SetSettingsDir(string const & dir); bool HasAvailableSpaceForWriting(uint64_t size) const; void RunOnGuiThread(TFunctor const & fn); diff --git a/android/proguard-mwm.txt b/android/proguard-mwm.txt index 19697678b1..3d114434b2 100644 --- a/android/proguard-mwm.txt +++ b/android/proguard-mwm.txt @@ -12,6 +12,12 @@ -dontwarn okio.** -dontwarn com.facebook.** +# pushwoosh +-keep class com.pushwoosh.** { *; } +-keep class com.arellomobile.** { *; } +-dontwarn com.pushwoosh.** +-dontwarn com.arellomobile.** + # myTarget -dontwarn ru.mail.android.mytarget.** -dontwarn com.mopub.** diff --git a/android/res/drawable-hdpi/ic_bicycle_beta.png b/android/res/drawable-hdpi/ic_bicycle_beta.png new file mode 100644 index 0000000000..6f43c3c904 Binary files /dev/null and b/android/res/drawable-hdpi/ic_bicycle_beta.png differ diff --git a/android/res/drawable-hdpi/ic_leaderboard.png b/android/res/drawable-hdpi/ic_leaderboard.png new file mode 100644 index 0000000000..c5a6bd193e Binary files /dev/null and b/android/res/drawable-hdpi/ic_leaderboard.png differ diff --git a/android/res/drawable-hdpi/ic_more.png b/android/res/drawable-hdpi/ic_more.png new file mode 100644 index 0000000000..3f97515006 Binary files /dev/null and b/android/res/drawable-hdpi/ic_more.png differ diff --git a/android/res/drawable-hdpi/img_news_migration.png b/android/res/drawable-hdpi/img_migration.png similarity index 100% rename from android/res/drawable-hdpi/img_news_migration.png rename to android/res/drawable-hdpi/img_migration.png diff --git a/android/res/drawable-hdpi/img_news_bicycle.png b/android/res/drawable-hdpi/img_news_bicycle.png new file mode 100644 index 0000000000..7a0d2ab5c1 Binary files /dev/null and b/android/res/drawable-hdpi/img_news_bicycle.png differ diff --git a/android/res/drawable-hdpi/img_news_booking.png b/android/res/drawable-hdpi/img_news_booking.png new file mode 100644 index 0000000000..01cfb31aa7 Binary files /dev/null and b/android/res/drawable-hdpi/img_news_booking.png differ diff --git a/android/res/drawable-hdpi/img_news_editor.png b/android/res/drawable-hdpi/img_news_editor.png deleted file mode 100644 index 49e8211a51..0000000000 Binary files a/android/res/drawable-hdpi/img_news_editor.png and /dev/null differ diff --git a/android/res/drawable-hdpi/img_news_search.png b/android/res/drawable-hdpi/img_news_search.png deleted file mode 100644 index 2d13453751..0000000000 Binary files a/android/res/drawable-hdpi/img_news_search.png and /dev/null differ diff --git a/android/res/drawable-ldpi/ic_leadreboard.png b/android/res/drawable-ldpi/ic_leadreboard.png new file mode 100644 index 0000000000..477f80abef Binary files /dev/null and b/android/res/drawable-ldpi/ic_leadreboard.png differ diff --git a/android/res/drawable-ldpi/ic_more.png b/android/res/drawable-ldpi/ic_more.png new file mode 100644 index 0000000000..fde57e5936 Binary files /dev/null and b/android/res/drawable-ldpi/ic_more.png differ diff --git a/android/res/drawable-mdpi/ic_bicycle_beta.png b/android/res/drawable-mdpi/ic_bicycle_beta.png new file mode 100644 index 0000000000..0b08371173 Binary files /dev/null and b/android/res/drawable-mdpi/ic_bicycle_beta.png differ diff --git a/android/res/drawable-mdpi/ic_leaderboard.png b/android/res/drawable-mdpi/ic_leaderboard.png new file mode 100644 index 0000000000..45e1c59aaf Binary files /dev/null and b/android/res/drawable-mdpi/ic_leaderboard.png differ diff --git a/android/res/drawable-mdpi/ic_more.png b/android/res/drawable-mdpi/ic_more.png new file mode 100644 index 0000000000..d9b0267b77 Binary files /dev/null and b/android/res/drawable-mdpi/ic_more.png differ diff --git a/android/res/drawable-mdpi/img_news_migration.png b/android/res/drawable-mdpi/img_migration.png similarity index 100% rename from android/res/drawable-mdpi/img_news_migration.png rename to android/res/drawable-mdpi/img_migration.png diff --git a/android/res/drawable-mdpi/img_news_bicycle.png b/android/res/drawable-mdpi/img_news_bicycle.png new file mode 100644 index 0000000000..9096f77d1c Binary files /dev/null and b/android/res/drawable-mdpi/img_news_bicycle.png differ diff --git a/android/res/drawable-mdpi/img_news_booking.png b/android/res/drawable-mdpi/img_news_booking.png new file mode 100644 index 0000000000..93f9e5dfa7 Binary files /dev/null and b/android/res/drawable-mdpi/img_news_booking.png differ diff --git a/android/res/drawable-mdpi/img_news_editor.png b/android/res/drawable-mdpi/img_news_editor.png deleted file mode 100644 index ad1522118e..0000000000 Binary files a/android/res/drawable-mdpi/img_news_editor.png and /dev/null differ diff --git a/android/res/drawable-mdpi/img_news_search.png b/android/res/drawable-mdpi/img_news_search.png deleted file mode 100644 index 1f54decaa6..0000000000 Binary files a/android/res/drawable-mdpi/img_news_search.png and /dev/null differ diff --git a/android/res/drawable-xhdpi/ic_bicycle_beta.png b/android/res/drawable-xhdpi/ic_bicycle_beta.png new file mode 100644 index 0000000000..489e86be3a Binary files /dev/null and b/android/res/drawable-xhdpi/ic_bicycle_beta.png differ diff --git a/android/res/drawable-xhdpi/ic_leaderboard.png b/android/res/drawable-xhdpi/ic_leaderboard.png new file mode 100644 index 0000000000..576258ac53 Binary files /dev/null and b/android/res/drawable-xhdpi/ic_leaderboard.png differ diff --git a/android/res/drawable-xhdpi/ic_more.png b/android/res/drawable-xhdpi/ic_more.png new file mode 100644 index 0000000000..fed3172552 Binary files /dev/null and b/android/res/drawable-xhdpi/ic_more.png differ diff --git a/android/res/drawable-xhdpi/img_news_migration.png b/android/res/drawable-xhdpi/img_migration.png similarity index 100% rename from android/res/drawable-xhdpi/img_news_migration.png rename to android/res/drawable-xhdpi/img_migration.png diff --git a/android/res/drawable-xhdpi/img_news_bicycle.png b/android/res/drawable-xhdpi/img_news_bicycle.png new file mode 100644 index 0000000000..f20ecde974 Binary files /dev/null and b/android/res/drawable-xhdpi/img_news_bicycle.png differ diff --git a/android/res/drawable-xhdpi/img_news_booking.png b/android/res/drawable-xhdpi/img_news_booking.png new file mode 100644 index 0000000000..6ee23c3a0e Binary files /dev/null and b/android/res/drawable-xhdpi/img_news_booking.png differ diff --git a/android/res/drawable-xhdpi/img_news_editor.png b/android/res/drawable-xhdpi/img_news_editor.png deleted file mode 100644 index 60ec5a0732..0000000000 Binary files a/android/res/drawable-xhdpi/img_news_editor.png and /dev/null differ diff --git a/android/res/drawable-xhdpi/img_news_search.png b/android/res/drawable-xhdpi/img_news_search.png deleted file mode 100644 index e9ed2345e9..0000000000 Binary files a/android/res/drawable-xhdpi/img_news_search.png and /dev/null differ diff --git a/android/res/drawable-xxhdpi/ic_bicycle_beta.png b/android/res/drawable-xxhdpi/ic_bicycle_beta.png new file mode 100644 index 0000000000..6547dca075 Binary files /dev/null and b/android/res/drawable-xxhdpi/ic_bicycle_beta.png differ diff --git a/android/res/drawable-xxhdpi/ic_leaderboard.png b/android/res/drawable-xxhdpi/ic_leaderboard.png new file mode 100644 index 0000000000..ebd5db9a95 Binary files /dev/null and b/android/res/drawable-xxhdpi/ic_leaderboard.png differ diff --git a/android/res/drawable-xxhdpi/ic_more.png b/android/res/drawable-xxhdpi/ic_more.png new file mode 100644 index 0000000000..9b2b5f8c71 Binary files /dev/null and b/android/res/drawable-xxhdpi/ic_more.png differ diff --git a/android/res/drawable-xxhdpi/img_news_migration.png b/android/res/drawable-xxhdpi/img_migration.png similarity index 100% rename from android/res/drawable-xxhdpi/img_news_migration.png rename to android/res/drawable-xxhdpi/img_migration.png diff --git a/android/res/drawable-xxhdpi/img_news_bicycle.png b/android/res/drawable-xxhdpi/img_news_bicycle.png new file mode 100644 index 0000000000..13681f59ed Binary files /dev/null and b/android/res/drawable-xxhdpi/img_news_bicycle.png differ diff --git a/android/res/drawable-xxhdpi/img_news_booking.png b/android/res/drawable-xxhdpi/img_news_booking.png new file mode 100644 index 0000000000..8449de153b Binary files /dev/null and b/android/res/drawable-xxhdpi/img_news_booking.png differ diff --git a/android/res/drawable-xxhdpi/img_news_editor.png b/android/res/drawable-xxhdpi/img_news_editor.png deleted file mode 100644 index bf5be7d011..0000000000 Binary files a/android/res/drawable-xxhdpi/img_news_editor.png and /dev/null differ diff --git a/android/res/drawable-xxhdpi/img_news_search.png b/android/res/drawable-xxhdpi/img_news_search.png deleted file mode 100644 index 74bfbe9697..0000000000 Binary files a/android/res/drawable-xxhdpi/img_news_search.png and /dev/null differ diff --git a/android/res/drawable-xxxhdpi/ic_bicycle_beta.png b/android/res/drawable-xxxhdpi/ic_bicycle_beta.png new file mode 100644 index 0000000000..8e435949f1 Binary files /dev/null and b/android/res/drawable-xxxhdpi/ic_bicycle_beta.png differ diff --git a/android/res/drawable-xxxhdpi/img_news_migration.png b/android/res/drawable-xxxhdpi/img_migration.png similarity index 100% rename from android/res/drawable-xxxhdpi/img_news_migration.png rename to android/res/drawable-xxxhdpi/img_migration.png diff --git a/android/res/drawable-xxxhdpi/img_news_bicycle.png b/android/res/drawable-xxxhdpi/img_news_bicycle.png new file mode 100644 index 0000000000..79f8786f80 Binary files /dev/null and b/android/res/drawable-xxxhdpi/img_news_bicycle.png differ diff --git a/android/res/drawable-xxxhdpi/img_news_booking.png b/android/res/drawable-xxxhdpi/img_news_booking.png new file mode 100644 index 0000000000..32cb5c3c40 Binary files /dev/null and b/android/res/drawable-xxxhdpi/img_news_booking.png differ diff --git a/android/res/drawable-xxxhdpi/img_news_editor.png b/android/res/drawable-xxxhdpi/img_news_editor.png deleted file mode 100644 index 790c15635e..0000000000 Binary files a/android/res/drawable-xxxhdpi/img_news_editor.png and /dev/null differ diff --git a/android/res/drawable-xxxhdpi/img_news_search.png b/android/res/drawable-xxxhdpi/img_news_search.png deleted file mode 100644 index 55c90e20a9..0000000000 Binary files a/android/res/drawable-xxxhdpi/img_news_search.png and /dev/null differ diff --git a/android/res/layout/dialog_edit_text.xml b/android/res/layout/dialog_edit_text.xml index 8c6c31e3d4..fb184187f8 100644 --- a/android/res/layout/dialog_edit_text.xml +++ b/android/res/layout/dialog_edit_text.xml @@ -23,6 +23,8 @@ style="@style/MwmWidget.PlacePage.EditText" android:layout_width="match_parent" android:layout_height="wrap_content" + android:inputType="text" + android:maxLength="100" android:singleLine="true"/> diff --git a/android/res/layout/fragment_auth_editor.xml b/android/res/layout/fragment_auth_editor.xml index ebcbcfd8c7..670add2329 100644 --- a/android/res/layout/fragment_auth_editor.xml +++ b/android/res/layout/fragment_auth_editor.xml @@ -5,7 +5,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - - - - + android:fillViewport="true"> - + + + + + + + - - - + android:layout_height="wrap_content"/> + android:orientation="vertical" + android:paddingLeft="@dimen/margin_base" + android:paddingStart="@dimen/margin_base" + android:paddingRight="@dimen/margin_base" + android:paddingEnd="@dimen/margin_base" + tools:visibility="gone">