Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Romanov <rromanov@65gb.net>2016-09-23 09:38:50 +0300
committerRoman Romanov <rromanov@65gb.net>2016-10-03 14:01:59 +0300
commit79300a23ee39492d7884de092cac1a20bd55cf09 (patch)
tree3992b1fc5cdcb2054cebfd2251dba26060f62e0d
parentedcb5ba0640d1481be99d69b615a0e9a94c03969 (diff)
[android] Review fixes.
-rw-r--r--android/AndroidManifest.xml92
-rw-r--r--android/build.gradle19
-rw-r--r--android/jni/com/mapswithme/maps/Framework.cpp3
-rw-r--r--android/jni/com/mapswithme/maps/Framework.hpp3
-rw-r--r--android/jni/com/mapswithme/maps/SponsoredHotel.cpp151
-rw-r--r--android/res/drawable/bg_circle_green.xml9
-rw-r--r--android/res/drawable/bg_circle_red.xml9
-rw-r--r--android/res/drawable/divider_transparent.xml2
-rw-r--r--android/res/drawable/ic_chevron_right_white.xml6
-rw-r--r--android/res/drawable/ic_minus_red.xml10
-rw-r--r--android/res/drawable/ic_negative_review.xml22
-rw-r--r--android/res/drawable/ic_plus_green.xml10
-rw-r--r--android/res/drawable/ic_positive_review.xml22
-rw-r--r--android/res/layout/activity_full_screen_gallery.xml94
-rw-r--r--android/res/layout/activity_viewpager_transparent_toolbar.xml94
-rw-r--r--android/res/layout/fragment_fullscreen_image.xml8
-rw-r--r--android/res/layout/fragment_gallery.xml16
-rw-r--r--android/res/layout/fragment_review.xml10
-rw-r--r--android/res/layout/item_comment.xml162
-rw-r--r--android/res/layout/item_facility.xml18
-rw-r--r--android/res/layout/item_gallery.xml32
-rw-r--r--android/res/layout/item_image.xml22
-rw-r--r--android/res/layout/item_more_button.xml12
-rw-r--r--android/res/layout/item_nearby.xml82
-rw-r--r--android/res/layout/item_rating.xml12
-rw-r--r--android/res/layout/place_page_hotel_description.xml48
-rw-r--r--android/res/layout/place_page_hotel_facilities.xml46
-rw-r--r--android/res/layout/place_page_hotel_gallery.xml10
-rw-r--r--android/res/layout/place_page_hotel_nearby.xml24
-rw-r--r--android/res/layout/place_page_hotel_rating.xml44
-rw-r--r--android/res/layout/toolbar_transparent.xml12
-rw-r--r--android/res/values-v16/styles-text.xml10
-rw-r--r--android/res/values/integer.xml3
-rw-r--r--android/res/values/plurals.xml11
-rw-r--r--android/res/values/strings.xml1214
-rw-r--r--android/res/values/styles-place_page.xml2
-rw-r--r--android/res/values/styles-text.xml12
-rw-r--r--android/res/values/styles.xml61
-rw-r--r--android/res/values/themes.xml2
-rw-r--r--android/src/com/mapswithme/maps/base/BaseMwmExtraTitleActivity.java43
-rw-r--r--android/src/com/mapswithme/maps/gallery/FullScreenGalleryActivity.java139
-rw-r--r--android/src/com/mapswithme/maps/gallery/FullScreenGalleryFragment.java31
-rw-r--r--android/src/com/mapswithme/maps/gallery/GalleryActivity.java43
-rw-r--r--android/src/com/mapswithme/maps/gallery/GalleryFragment.java37
-rw-r--r--android/src/com/mapswithme/maps/gallery/GalleryPageAdapter.java18
-rw-r--r--android/src/com/mapswithme/maps/gallery/Image.java148
-rw-r--r--android/src/com/mapswithme/maps/gallery/ImageAdapter.java53
-rw-r--r--android/src/com/mapswithme/maps/review/Review.java68
-rw-r--r--android/src/com/mapswithme/maps/review/ReviewActivity.java46
-rw-r--r--android/src/com/mapswithme/maps/review/ReviewAdapter.java128
-rw-r--r--android/src/com/mapswithme/maps/review/ReviewFragment.java35
-rw-r--r--android/src/com/mapswithme/maps/widget/LineCountTextView.java28
-rw-r--r--android/src/com/mapswithme/maps/widget/StaticGridView.java15
-rw-r--r--android/src/com/mapswithme/maps/widget/placepage/FacilitiesAdapter.java59
-rw-r--r--android/src/com/mapswithme/maps/widget/placepage/GalleryAdapter.java188
-rw-r--r--android/src/com/mapswithme/maps/widget/placepage/LeftPlacePageAnimationController.java43
-rw-r--r--android/src/com/mapswithme/maps/widget/placepage/NearbyAdapter.java79
-rw-r--r--android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java633
-rw-r--r--android/src/com/mapswithme/maps/widget/placepage/ReviewAdapter.java90
-rw-r--r--android/src/com/mapswithme/maps/widget/placepage/SponsoredHotel.java263
-rw-r--r--android/src/com/mapswithme/maps/widget/recycler/DividerItemDecoration.java49
-rw-r--r--android/src/com/mapswithme/maps/widget/recycler/GridDividerItemDecoration.java62
-rw-r--r--android/src/com/mapswithme/util/UiUtils.java20
-rw-r--r--map/booking_api.cpp2
-rw-r--r--strings.txt14
65 files changed, 2596 insertions, 2157 deletions
diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml
index 95c0151f2b..af1a0b02e9 100644
--- a/android/AndroidManifest.xml
+++ b/android/AndroidManifest.xml
@@ -71,11 +71,11 @@
<meta-data
android:name="PW_APPID"
- android:value="${PW_APPID}" />
+ android:value="${PW_APPID}"/>
<meta-data
android:name="PW_PROJECT_ID"
- android:value="${PW_PROJECT_ID}" />
+ android:value="${PW_PROJECT_ID}"/>
<!--meta-data
android:name="PW_LOG_LEVEL"
@@ -241,79 +241,79 @@
</activity>
<activity
- android:name="com.mapswithme.maps.editor.EditorActivity"
- 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">
+ android:name="com.mapswithme.maps.editor.EditorActivity"
+ 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">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
- android:name="android.support.PARENT_ACTIVITY"
- android:value="com.mapswithme.maps.MwmActivity"/>
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="com.mapswithme.maps.MwmActivity"/>
</activity>
<activity
- android:name="com.mapswithme.maps.editor.ProfileActivity"
- android:parentActivityName="com.mapswithme.maps.settings.SettingsActivity">
+ android:name="com.mapswithme.maps.editor.ProfileActivity"
+ android:parentActivityName="com.mapswithme.maps.settings.SettingsActivity">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
- android:name="android.support.PARENT_ACTIVITY"
- android:value="com.mapswithme.maps.settings.SettingsActivity"/>
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="com.mapswithme.maps.settings.SettingsActivity"/>
</activity>
<activity
- android:name="com.mapswithme.maps.editor.FeatureCategoryActivity"
- android:parentActivityName="com.mapswithme.maps.MwmActivity">
+ android:name="com.mapswithme.maps.editor.FeatureCategoryActivity"
+ android:parentActivityName="com.mapswithme.maps.MwmActivity">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
- android:name="android.support.PARENT_ACTIVITY"
- android:value="com.mapswithme.maps.MwmActivity"/>
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="com.mapswithme.maps.MwmActivity"/>
</activity>
<activity
- android:name="com.mapswithme.maps.editor.ReportActivity"
- android:parentActivityName="com.mapswithme.maps.MwmActivity">
+ android:name="com.mapswithme.maps.editor.ReportActivity"
+ android:parentActivityName="com.mapswithme.maps.MwmActivity">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
- android:name="android.support.PARENT_ACTIVITY"
- android:value="com.mapswithme.maps.MwmActivity"/>
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="com.mapswithme.maps.MwmActivity"/>
</activity>
<activity
- android:name="com.mapswithme.maps.editor.OsmAuthActivity"
- android:parentActivityName="com.mapswithme.maps.MwmActivity">
+ android:name="com.mapswithme.maps.editor.OsmAuthActivity"
+ android:parentActivityName="com.mapswithme.maps.MwmActivity">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
- android:name="android.support.PARENT_ACTIVITY"
- android:value="com.mapswithme.maps.MwmActivity"/>
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="com.mapswithme.maps.MwmActivity"/>
</activity>
<activity
- android:name="com.mapswithme.maps.gallery.GalleryActivity"
- android:parentActivityName="com.mapswithme.maps.MwmActivity">
+ android:name="com.mapswithme.maps.gallery.GalleryActivity"
+ android:parentActivityName="com.mapswithme.maps.MwmActivity">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
- android:name="android.support.PARENT_ACTIVITY"
- android:value="com.mapswithme.maps.MwmActivity"/>
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="com.mapswithme.maps.MwmActivity"/>
</activity>
<activity
- android:name="com.mapswithme.maps.gallery.FullScreenGalleryActivity"
- android:parentActivityName="com.mapswithme.maps.MwmActivity">
+ android:name="com.mapswithme.maps.gallery.FullScreenGalleryActivity"
+ android:parentActivityName="com.mapswithme.maps.MwmActivity">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
- android:name="android.support.PARENT_ACTIVITY"
- android:value="com.mapswithme.maps.MwmActivity"/>
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="com.mapswithme.maps.MwmActivity"/>
</activity>
<activity
- android:name="com.mapswithme.maps.review.ReviewActivity"
- android:parentActivityName="com.mapswithme.maps.MwmActivity">
+ android:name="com.mapswithme.maps.review.ReviewActivity"
+ android:parentActivityName="com.mapswithme.maps.MwmActivity">
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
- android:name="android.support.PARENT_ACTIVITY"
- android:value="com.mapswithme.maps.MwmActivity"/>
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="com.mapswithme.maps.MwmActivity"/>
</activity>
<!-- facebook -->
@@ -373,17 +373,17 @@
</receiver>
<!-- PushWoosh -->
- <activity android:name="com.pushwoosh.richpages.RichPageActivity" />
- <activity android:name="com.pushwoosh.MessageActivity" />
- <activity android:name="com.pushwoosh.PushHandlerActivity" />
+ <activity android:name="com.pushwoosh.richpages.RichPageActivity"/>
+ <activity android:name="com.pushwoosh.MessageActivity"/>
+ <activity android:name="com.pushwoosh.PushHandlerActivity"/>
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
- android:permission="com.google.android.c2dm.permission.SEND" >
+ android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
- <action android:name="com.google.android.c2dm.intent.RECEIVE" />
- <category android:name="${applicationId}" />
+ <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
+ <category android:name="${applicationId}"/>
</intent-filter>
</receiver>
@@ -405,10 +405,10 @@
<service
android:name="com.pushwoosh.GCMRegistrationService"
- android:exported="false" />
+ android:exported="false"/>
<service
- android:name="com.pushwoosh.location.GeoLocationService" />
+ android:name="com.pushwoosh.location.GeoLocationService"/>
<!-- Catches app upgraded intent -->
<receiver android:name=".background.UpgradeReceiver">
diff --git a/android/build.gradle b/android/build.gradle
index ad41954325..1f1c3b43f7 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -95,15 +95,15 @@ android {
// Crashlytics API key
Properties props = new Properties()
props.load(new FileInputStream("${projectDir}/fabric.properties"));
- manifestPlaceholders = [ 'FABRIC_API_KEY': props['apiKey'] ]
+ 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'] ]
+ manifestPlaceholders += ['PW_APPID': pwProps['pwAppId']]
buildConfigField 'String', 'PW_APPID', /"${pwProps['pwAppId']}"/
- manifestPlaceholders += [ 'PW_PROJECT_ID': pwProps['pwProjectId'] ]
+ manifestPlaceholders += ['PW_PROJECT_ID': pwProps['pwProjectId']]
}
sourceSets.main {
@@ -212,13 +212,6 @@ android {
android.sourceSets.blackberry.assets.srcDirs = ['flavors/mwm-ttf-assets']
buildConfigField 'String', 'REVIEW_URL', '"https://appworld.blackberry.com/webstore/content/51013892"'
}
-
- nineStore {
- versionName = android.defaultConfig.versionName + '-NineStore'
- android.sourceSets.blackberry.assets.srcDirs = ['flavors/mwm-ttf-assets']
- buildConfigField 'String', 'SUPPORT_MAIL', '"ninestore@mapswithme.com"'
- buildConfigField 'String', 'REVIEW_URL', '"http://www.ninestore.ru/android-apps/mapswithme-maps-pro"'
- }
}
// Currently (as of 1.2.3 gradle plugin) ABI filters aren't supported inside of product flavors, so we cannot generate splitted builds only for Google build.
@@ -333,7 +326,7 @@ if (System.properties['os.name'].toLowerCase().contains('windows'))
project.ext.NDK_BUILD += ".cmd"
def archs = ['x86', 'armeabi-v7a-hard']
-def buildTypes = [[ndkType: 'release', cppType: "production", flags : propReleaseNdkFlags], [ndkType: 'debug', cppType: "debug", flags : propDebugNdkFlags]]
+def buildTypes = [[ndkType: 'release', cppType: "production", flags: propReleaseNdkFlags], [ndkType: 'debug', cppType: "debug", flags: propDebugNdkFlags]]
buildTypes.each { type ->
def suffix = type.ndkType.capitalize()
@@ -410,14 +403,14 @@ obbGenerate.dependsOn obbClean, obbMainGenerate, obbPatchGenerate, obbMainAlign,
def createObbGenerateTask(type, data, name) {
return tasks.create(name: "obb${type}Generate", type: Exec, description: 'Generate obb files') {
- commandLine ((['zip', '-0', '-j', name, data]).flatten())
+ commandLine((['zip', '-0', '-j', name, data]).flatten())
}
}
def createObbAlignTask(type, rawObb, alignedObb) {
def sdkDir = "${android.getSdkDirectory().getAbsolutePath()}"
def zipalignPath = sdkDir + File.separator + "build-tools" + File.separator +
- propBuildToolsVersion + File.separator + "zipalign";
+ propBuildToolsVersion + File.separator + "zipalign";
return tasks.create(name: "obb${type}Align", dependsOn: "obb${type}Generate", type: Exec, description: 'Align obb files') {
commandLine zipalignPath, '-v', '8', rawObb, alignedObb
diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp
index 67412a3c7c..361dba42b5 100644
--- a/android/jni/com/mapswithme/maps/Framework.cpp
+++ b/android/jni/com/mapswithme/maps/Framework.cpp
@@ -476,7 +476,8 @@ void Framework::RequestBookingMinPrice(string const & hotelId, string const & cu
return m_work.GetBookingApi().GetMinPrice(hotelId, currencyCode, callback);
}
-void Framework::RequestBookingInfo(string const & hotelId, string const & lang, function<void(BookingApi::HotelInfo const &)> const & callback)
+void Framework::RequestBookingInfo(string const & hotelId, string const & lang,
+ function<void(BookingApi::HotelInfo const &)> const & callback)
{
return m_work.GetBookingApi().GetHotelInfo(hotelId, lang, callback);
}
diff --git a/android/jni/com/mapswithme/maps/Framework.hpp b/android/jni/com/mapswithme/maps/Framework.hpp
index b7962696c7..12fcdcd85d 100644
--- a/android/jni/com/mapswithme/maps/Framework.hpp
+++ b/android/jni/com/mapswithme/maps/Framework.hpp
@@ -155,7 +155,8 @@ namespace android
void SetPlacePageInfo(place_page::Info const & info);
place_page::Info & GetPlacePageInfo();
void RequestBookingMinPrice(string const & hotelId, string const & currency, function<void(string const &, string const &)> const & callback);
- void RequestBookingInfo(string const & hotelId, string const & lang, function<void(BookingApi::HotelInfo const &)> const & callback);
+ void RequestBookingInfo(string const & hotelId, string const & lang,
+ function<void(BookingApi::HotelInfo const &)> const & callback);
bool HasSpaceForMigration();
storage::TCountryId PreMigrate(ms::LatLon const & position, storage::Storage::TChangeCountryFunction const & statusChangeListener,
diff --git a/android/jni/com/mapswithme/maps/SponsoredHotel.cpp b/android/jni/com/mapswithme/maps/SponsoredHotel.cpp
index 86291b6113..1eb94e0e1b 100644
--- a/android/jni/com/mapswithme/maps/SponsoredHotel.cpp
+++ b/android/jni/com/mapswithme/maps/SponsoredHotel.cpp
@@ -2,14 +2,15 @@
#include "../core/jni_helper.hpp"
#include "../platform/Platform.hpp"
-#include "map/place_page_info.hpp"
#include "map/booking_api.hpp"
+#include "map/place_page_info.hpp"
#include "std/bind.hpp"
+using namespace std::chrono;
+
namespace
{
-
jclass g_hotelClass;
jclass g_facilityTypeClass;
jclass g_nearbyObjectClass;
@@ -21,7 +22,7 @@ jmethodID g_nearbyConstructor;
jmethodID g_imageConstructor;
jmethodID g_reviewConstructor;
jmethodID g_hotelInfoConstructor;
-jmethodID g_hotelClassCtor;
+jmethodID g_hotelClassConstructor;
jmethodID g_priceCallback;
jmethodID g_infoCallback;
@@ -31,34 +32,51 @@ void PrepareClassRefs(JNIEnv * env, jclass hotelClass)
return;
g_hotelClass = static_cast<jclass>(env->NewGlobalRef(hotelClass));
- g_hotelInfoClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/widget/placepage/SponsoredHotel$HotelInfo");
- g_facilityTypeClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/widget/placepage/SponsoredHotel$FacilityType");
- g_nearbyObjectClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/widget/placepage/SponsoredHotel$NearbyObject");
+ g_hotelInfoClass =
+ jni::GetGlobalClassRef(env, "com/mapswithme/maps/widget/placepage/SponsoredHotel$HotelInfo");
+ g_facilityTypeClass = jni::GetGlobalClassRef(
+ env, "com/mapswithme/maps/widget/placepage/SponsoredHotel$FacilityType");
+ g_nearbyObjectClass = jni::GetGlobalClassRef(
+ env, "com/mapswithme/maps/widget/placepage/SponsoredHotel$NearbyObject");
g_reviewClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/review/Review");
g_imageClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/gallery/Image");
- g_facilityConstructor = jni::GetConstructorID(env, g_facilityTypeClass, "(Ljava/lang/String;Ljava/lang/String;)V");
- g_nearbyConstructor = jni::GetConstructorID(env, g_nearbyObjectClass, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;DD)V");
- g_imageConstructor = jni::GetConstructorID(env, g_imageClass, "(Ljava/lang/String;Ljava/lang/String;)V");
- g_reviewConstructor = jni::GetConstructorID(env, g_reviewClass, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;FJ)V");
- g_hotelInfoConstructor = jni::GetConstructorID(env, g_hotelInfoClass, "(Ljava/lang/String;[Lcom/mapswithme/maps/gallery/Image;[Lcom/mapswithme/maps/widget/placepage/SponsoredHotel$FacilityType;[Lcom/mapswithme/maps/review/Review;[Lcom/mapswithme/maps/widget/placepage/SponsoredHotel$NearbyObject;)V");
+ g_facilityConstructor =
+ jni::GetConstructorID(env, g_facilityTypeClass, "(Ljava/lang/String;Ljava/lang/String;)V");
+ g_nearbyConstructor = jni::GetConstructorID(
+ env, g_nearbyObjectClass, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;DD)V");
+ g_imageConstructor =
+ jni::GetConstructorID(env, g_imageClass, "(Ljava/lang/String;Ljava/lang/String;)V");
+ g_reviewConstructor = jni::GetConstructorID(env, g_reviewClass,
+ "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/"
+ "String;Ljava/lang/String;Ljava/lang/String;FJ)V");
+ g_hotelInfoConstructor = jni::GetConstructorID(
+ env, g_hotelInfoClass,
+ "(Ljava/lang/String;[Lcom/mapswithme/maps/gallery/Image;[Lcom/mapswithme/maps/widget/"
+ "placepage/SponsoredHotel$FacilityType;[Lcom/mapswithme/maps/review/Review;[Lcom/mapswithme/"
+ "maps/widget/placepage/SponsoredHotel$NearbyObject;)V");
// 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");
+ g_hotelClassConstructor = 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");
+ g_priceCallback =
+ jni::GetStaticMethodID(env, g_hotelClass, "onPriceReceived",
+ "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
// static void onDescriptionReceived(final String id, final String description)
- g_infoCallback = jni::GetStaticMethodID(env, g_hotelClass, "onInfoReceived", "(Ljava/lang/String;Lcom/mapswithme/maps/widget/placepage/SponsoredHotel$HotelInfo;)V");
+ g_infoCallback = jni::GetStaticMethodID(
+ env, g_hotelClass, "onInfoReceived",
+ "(Ljava/lang/String;Lcom/mapswithme/maps/widget/placepage/SponsoredHotel$HotelInfo;)V");
}
-} // namespace
+} // namespace
-extern "C"
-{
+extern "C" {
// static SponsoredHotel nativeGetCurrent();
-JNIEXPORT jobject JNICALL
-Java_com_mapswithme_maps_widget_placepage_SponsoredHotel_nativeGetCurrent(JNIEnv * env, jclass clazz)
+JNIEXPORT jobject JNICALL Java_com_mapswithme_maps_widget_placepage_SponsoredHotel_nativeGetCurrent(
+ JNIEnv * env, jclass clazz)
{
PrepareClassRefs(env, clazz);
@@ -66,80 +84,79 @@ Java_com_mapswithme_maps_widget_placepage_SponsoredHotel_nativeGetCurrent(JNIEnv
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()));
+ return env->NewObject(g_hotelClass, g_hotelClassConstructor,
+ 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)
+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([=]()
- {
+ 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));
+ jni::ToJavaString(env, price), jni::ToJavaString(env, currency));
});
});
}
// static void nativeRequestInfo(String id, String locale);
-JNIEXPORT void JNICALL
-Java_com_mapswithme_maps_widget_placepage_SponsoredHotel_nativeRequestInfo(JNIEnv * env, jclass clazz, jstring id, jstring locale)
+JNIEXPORT void JNICALL Java_com_mapswithme_maps_widget_placepage_SponsoredHotel_nativeRequestInfo(
+ JNIEnv * env, jclass clazz, jstring id, jstring locale)
{
PrepareClassRefs(env, clazz);
string const hotelId = jni::ToNativeString(env, id);
string const code = jni::ToNativeString(env, locale);
- g_framework->RequestBookingInfo(hotelId, code, [hotelId](BookingApi::HotelInfo const & hotelInfo)
- {
- GetPlatform().RunOnGuiThread([=]()
- {
+ g_framework->RequestBookingInfo(hotelId, code, [hotelId](
+ BookingApi::HotelInfo const & hotelInfo) {
+ GetPlatform().RunOnGuiThread([=]() {
JNIEnv * env = jni::GetEnv();
+ auto description = jni::ToJavaString(env, hotelInfo.m_description);
+ auto photos =
+ jni::ToJavaArray(env, g_imageClass, hotelInfo.m_photos,
+ [](JNIEnv * env, BookingApi::HotelPhotoUrls const & item) {
+ return env->NewObject(g_imageClass, g_imageConstructor,
+ jni::ToJavaString(env, item.m_original),
+ jni::ToJavaString(env, item.m_small));
+ });
+ auto facilities =
+ jni::ToJavaArray(env, g_facilityTypeClass, hotelInfo.m_facilities,
+ [](JNIEnv * env, BookingApi::Facility const & item) {
+ return env->NewObject(g_facilityTypeClass, g_facilityConstructor,
+ jni::ToJavaString(env, item.m_id),
+ jni::ToJavaString(env, item.m_localizedName));
+ });
+ auto reviews = jni::ToJavaArray(
+ env, g_reviewClass, hotelInfo.m_reviews,
+ [](JNIEnv * env, BookingApi::HotelReview const & item) {
+ return env->NewObject(
+ g_reviewClass, g_reviewConstructor, jni::ToJavaString(env, item.m_reviewNeutral),
+ jni::ToJavaString(env, item.m_reviewPositive),
+ jni::ToJavaString(env, item.m_reviewNegative),
+ jni::ToJavaString(env, item.m_author), jni::ToJavaString(env, item.m_authorPictUrl),
+ item.m_rating,
+ time_point_cast<milliseconds>(item.m_date).time_since_epoch().count());
+ });
+ auto nearby = env->NewObjectArray(0, g_nearbyObjectClass, 0);
+
env->CallStaticVoidMethod(g_hotelClass, g_infoCallback, jni::ToJavaString(env, hotelId),
- env->NewObject(g_hotelInfoClass, g_hotelInfoConstructor,
- jni::ToJavaString(env, hotelInfo.m_description),
- jni::ToJavaArray(env, g_imageClass, hotelInfo.m_photos,
- [](JNIEnv * env, BookingApi::HotelPhotoUrls const & item)
- {
- return env->NewObject(g_imageClass, g_imageConstructor,
- jni::ToJavaString(env, item.m_original),
- jni::ToJavaString(env, item.m_small));
- }),
- jni::ToJavaArray(env, g_facilityTypeClass, hotelInfo.m_facilities,
- [](JNIEnv * env, BookingApi::Facility const & item)
- {
- return env->NewObject(g_facilityTypeClass, g_facilityConstructor,
- jni::ToJavaString(env, item.m_id),
- jni::ToJavaString(env, item.m_localizedName));
- }),
- jni::ToJavaArray(env, g_reviewClass, hotelInfo.m_reviews,
- [](JNIEnv * env, BookingApi::HotelReview const & item)
- {
- return env->NewObject(g_reviewClass, g_reviewConstructor,
- jni::ToJavaString(env, item.m_reviewNeutral),
- jni::ToJavaString(env, item.m_reviewPositive),
- jni::ToJavaString(env, item.m_reviewNegative),
- jni::ToJavaString(env, item.m_author),
- jni::ToJavaString(env, item.m_authorPictUrl),
- item.m_rating,
- std::chrono::time_point_cast<std::chrono::milliseconds>(item.m_date).time_since_epoch().count());
- }),
- env->NewObjectArray(0, g_nearbyObjectClass, 0)));
+ env->NewObject(g_hotelInfoClass, g_hotelInfoConstructor,
+ description, photos, facilities, reviews, nearby));
});
});
}
-} // extern "C"
+} // extern "C"
diff --git a/android/res/drawable/bg_circle_green.xml b/android/res/drawable/bg_circle_green.xml
index 8d3ca03796..24f254e751 100644
--- a/android/res/drawable/bg_circle_green.xml
+++ b/android/res/drawable/bg_circle_green.xml
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
<solid android:color="@color/bg_placepage_rating_positive"/>
<size
- android:height="@dimen/placepage_margin_rating"
- android:width="@dimen/placepage_margin_rating"/>
-</shape> \ No newline at end of file
+ android:height="@dimen/placepage_margin_rating"
+ android:width="@dimen/placepage_margin_rating"/>
+</shape>
diff --git a/android/res/drawable/bg_circle_red.xml b/android/res/drawable/bg_circle_red.xml
index a3c80e6627..c5a44a59a0 100644
--- a/android/res/drawable/bg_circle_red.xml
+++ b/android/res/drawable/bg_circle_red.xml
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
<solid android:color="@color/bg_placepage_rating_negative"/>
<size
- android:height="@dimen/placepage_margin_rating"
- android:width="@dimen/placepage_margin_rating"/>
-</shape> \ No newline at end of file
+ android:height="@dimen/placepage_margin_rating"
+ android:width="@dimen/placepage_margin_rating"/>
+</shape>
diff --git a/android/res/drawable/divider_transparent.xml b/android/res/drawable/divider_transparent.xml
index 1719475d7f..377b4d7e12 100644
--- a/android/res/drawable/divider_transparent.xml
+++ b/android/res/drawable/divider_transparent.xml
@@ -3,4 +3,4 @@
<size android:width="@dimen/margin_quarter"
android:height="@dimen/margin_quarter"/>
<solid android:color="@android:color/transparent"/>
-</shape> \ No newline at end of file
+</shape>
diff --git a/android/res/drawable/ic_chevron_right_white.xml b/android/res/drawable/ic_chevron_right_white.xml
index 490d31b048..0563f22f11 100644
--- a/android/res/drawable/ic_chevron_right_white.xml
+++ b/android/res/drawable/ic_chevron_right_white.xml
@@ -3,7 +3,7 @@
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
- <path
- android:fillColor="#FFF"
- android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"/>
+ <path
+ android:fillColor="#FFF"
+ android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"/>
</vector>
diff --git a/android/res/drawable/ic_minus_red.xml b/android/res/drawable/ic_minus_red.xml
index 411438dca0..b108146e81 100644
--- a/android/res/drawable/ic_minus_red.xml
+++ b/android/res/drawable/ic_minus_red.xml
@@ -1,4 +1,8 @@
-<vector android:height="10dp" android:viewportHeight="24.0"
- android:viewportWidth="24.0" android:width="10dp" xmlns:android="http://schemas.android.com/apk/res/android">
- <path android:fillColor="#FFF44336" android:pathData="M19,13H5v-2h14v2z"/>
+<vector android:height="10dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0"
+ android:width="10dp"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FFF44336"
+ android:pathData="M19,13H5v-2h14v2z"/>
</vector>
diff --git a/android/res/drawable/ic_negative_review.xml b/android/res/drawable/ic_negative_review.xml
index 7d75805c7d..a28a8a5646 100644
--- a/android/res/drawable/ic_negative_review.xml
+++ b/android/res/drawable/ic_negative_review.xml
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
- android:drawable="@drawable/bg_circle_red"
- android:left="@dimen/margin_eighth"
- android:right="@dimen/margin_eighth"
- android:bottom="@dimen/margin_eighth"
- android:top="@dimen/margin_eighth"/>
+ android:drawable="@drawable/bg_circle_red"
+ android:left="@dimen/margin_eighth"
+ android:right="@dimen/margin_eighth"
+ android:bottom="@dimen/margin_eighth"
+ android:top="@dimen/margin_eighth"/>
<item
- android:drawable="@drawable/ic_minus_red"
- android:left="@dimen/margin_eighth"
- android:right="@dimen/margin_eighth"
- android:bottom="@dimen/margin_eighth"
- android:top="@dimen/margin_eighth"/>
-</layer-list> \ No newline at end of file
+ android:drawable="@drawable/ic_minus_red"
+ android:left="@dimen/margin_eighth"
+ android:right="@dimen/margin_eighth"
+ android:bottom="@dimen/margin_eighth"
+ android:top="@dimen/margin_eighth"/>
+</layer-list>
diff --git a/android/res/drawable/ic_plus_green.xml b/android/res/drawable/ic_plus_green.xml
index 10385ed4eb..d8e49364af 100644
--- a/android/res/drawable/ic_plus_green.xml
+++ b/android/res/drawable/ic_plus_green.xml
@@ -1,4 +1,8 @@
-<vector android:height="10dp" android:viewportHeight="24.0"
- android:viewportWidth="24.0" android:width="10dp" xmlns:android="http://schemas.android.com/apk/res/android">
- <path android:fillColor="#FF578B2D" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
+<vector android:height="10dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0"
+ android:width="10dp"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FF578B2D"
+ android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>
diff --git a/android/res/drawable/ic_positive_review.xml b/android/res/drawable/ic_positive_review.xml
index 8d0948109f..e3fc607c73 100644
--- a/android/res/drawable/ic_positive_review.xml
+++ b/android/res/drawable/ic_positive_review.xml
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
- android:drawable="@drawable/bg_circle_green"
- android:left="@dimen/margin_eighth"
- android:right="@dimen/margin_eighth"
- android:bottom="@dimen/margin_eighth"
- android:top="@dimen/margin_eighth"/>
+ android:drawable="@drawable/bg_circle_green"
+ android:left="@dimen/margin_eighth"
+ android:right="@dimen/margin_eighth"
+ android:bottom="@dimen/margin_eighth"
+ android:top="@dimen/margin_eighth"/>
<item
- android:drawable="@drawable/ic_plus_green"
- android:left="@dimen/margin_eighth"
- android:right="@dimen/margin_eighth"
- android:bottom="@dimen/margin_eighth"
- android:top="@dimen/margin_eighth"/>
-</layer-list> \ No newline at end of file
+ android:drawable="@drawable/ic_plus_green"
+ android:left="@dimen/margin_eighth"
+ android:right="@dimen/margin_eighth"
+ android:bottom="@dimen/margin_eighth"
+ android:top="@dimen/margin_eighth"/>
+</layer-list>
diff --git a/android/res/layout/activity_full_screen_gallery.xml b/android/res/layout/activity_full_screen_gallery.xml
new file mode 100644
index 0000000000..69411ca818
--- /dev/null
+++ b/android/res/layout/activity_full_screen_gallery.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/black">
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/vp__image"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
+
+ <include
+ layout="@layout/toolbar_transparent"/>
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/margin_half"
+ android:layout_marginEnd="@dimen/margin_base"
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginRight="@dimen/margin_base"
+ android:layout_marginStart="@dimen/margin_base"
+ android:layout_marginTop="@dimen/margin_base"
+ android:layout_gravity="bottom">
+
+ <TextView
+ android:id="@+id/tv__description"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/margin_half"
+ android:textColor="@color/white_primary"
+ android:textAppearance="@style/MwmTextAppearance.Body1"
+ android:maxLines="1"
+ tools:text="Staff, rooftop view, location, free bike…"/>
+
+ <RelativeLayout
+ android:id="@+id/rl__user_block"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+ <View
+ android:id="@+id/divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="@color/divider_gallery"/>
+ <ImageView
+ android:id="@+id/iv__avatar"
+ android:layout_width="@dimen/track_circle_size"
+ android:layout_height="@dimen/track_circle_size"
+ android:layout_marginTop="@dimen/margin_half"
+ android:layout_below="@id/divider"
+ android:layout_marginRight="@dimen/margin_half"
+ android:layout_marginEnd="@dimen/margin_half"
+ tools:src="@drawable/img_editor_medal"/>
+ <TextView
+ android:id="@+id/tv__name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_half"
+ android:layout_toRightOf="@id/iv__avatar"
+ android:layout_toEndOf="@id/iv__avatar"
+ android:layout_below="@id/divider"
+ android:maxLines="1"
+ android:textColor="@color/white_primary"
+ android:textAppearance="@style/MwmTextAppearance.Body1"
+ tools:text="Polina"/>
+ <TextView
+ android:id="@+id/tv__source"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@id/iv__avatar"
+ android:layout_toEndOf="@id/iv__avatar"
+ android:layout_below="@id/tv__name"
+ android:maxLines="1"
+ android:textColor="@color/white_primary"
+ android:textAppearance="@style/MwmTextAppearance.Body4"
+ tools:text="via Booking"/>
+ <TextView
+ android:id="@+id/tv__date"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@id/tv__source"
+ android:layout_toEndOf="@id/tv__source"
+ android:layout_alignBaseline="@id/tv__source"
+ android:gravity="end"
+ android:maxLines="1"
+ android:textColor="@color/white_primary"
+ android:textAppearance="@style/MwmTextAppearance.Body4"
+ tools:text="Jule 8, 2016"/>
+ </RelativeLayout>
+ </LinearLayout>
+</FrameLayout>
diff --git a/android/res/layout/activity_viewpager_transparent_toolbar.xml b/android/res/layout/activity_viewpager_transparent_toolbar.xml
deleted file mode 100644
index 8abdb88b0f..0000000000
--- a/android/res/layout/activity_viewpager_transparent_toolbar.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@android:color/black">
-
- <android.support.v4.view.ViewPager
- android:id="@+id/vp__image"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
-
- <include
- layout="@layout/toolbar_transparent"/>
-
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/margin_half"
- android:layout_marginEnd="@dimen/margin_base"
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginRight="@dimen/margin_base"
- android:layout_marginStart="@dimen/margin_base"
- android:layout_marginTop="@dimen/margin_base"
- android:layout_gravity="bottom">
-
- <TextView
- android:id="@+id/tv__description"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/margin_half"
- android:textColor="@color/white_primary"
- android:textAppearance="@style/MwmTextAppearance.Body1"
- android:maxLines="1"
- tools:text="Staff, rooftop view, location, free bike…"/>
-
- <RelativeLayout
- android:id="@+id/rl__user_block"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
- <View
- android:id="@+id/divider"
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="@color/divider_gallery"/>
- <ImageView
- android:id="@+id/iv__avatar"
- android:layout_width="@dimen/track_circle_size"
- android:layout_height="@dimen/track_circle_size"
- android:layout_marginTop="@dimen/margin_half"
- android:layout_below="@id/divider"
- android:layout_marginRight="@dimen/margin_half"
- android:layout_marginEnd="@dimen/margin_half"
- tools:src="@drawable/img_editor_medal"/>
- <TextView
- android:id="@+id/tv__name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/margin_half"
- android:layout_toRightOf="@id/iv__avatar"
- android:layout_toEndOf="@id/iv__avatar"
- android:layout_below="@id/divider"
- android:maxLines="1"
- android:textColor="@color/white_primary"
- android:textAppearance="@style/MwmTextAppearance.Body1"
- tools:text="Polina"/>
- <TextView
- android:id="@+id/tv__source"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@id/iv__avatar"
- android:layout_toEndOf="@id/iv__avatar"
- android:layout_below="@id/tv__name"
- android:maxLines="1"
- android:textColor="@color/white_primary"
- android:textAppearance="@style/MwmTextAppearance.Body4"
- tools:text="via Booking"/>
- <TextView
- android:id="@+id/tv__date"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@id/tv__source"
- android:layout_toEndOf="@id/tv__source"
- android:layout_alignBaseline="@id/tv__source"
- android:gravity="end"
- android:maxLines="1"
- android:textColor="@color/white_primary"
- android:textAppearance="@style/MwmTextAppearance.Body4"
- tools:text="Jule 8, 2016"/>
- </RelativeLayout>
- </LinearLayout>
-</FrameLayout> \ No newline at end of file
diff --git a/android/res/layout/fragment_fullscreen_image.xml b/android/res/layout/fragment_fullscreen_image.xml
index bd7207d7b4..2894f973c2 100644
--- a/android/res/layout/fragment_fullscreen_image.xml
+++ b/android/res/layout/fragment_fullscreen_image.xml
@@ -6,8 +6,8 @@
android:background="@android:color/black">
<ImageView
- android:id="@+id/iv__image"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
+ android:id="@+id/iv__image"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
diff --git a/android/res/layout/fragment_gallery.xml b/android/res/layout/fragment_gallery.xml
index ebb841f3ec..840069a296 100644
--- a/android/res/layout/fragment_gallery.xml
+++ b/android/res/layout/fragment_gallery.xml
@@ -6,12 +6,12 @@
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
- android:id="@+id/rv__gallery"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingLeft="@dimen/margin_half"
- android:paddingRight="@dimen/margin_half"
- android:paddingTop="@dimen/margin_half_plus"
- tools:listitem="@layout/item_image"/>
+ android:id="@+id/rv__gallery"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingLeft="@dimen/margin_half"
+ android:paddingRight="@dimen/margin_half"
+ android:paddingTop="@dimen/margin_half_plus"
+ tools:listitem="@layout/item_image"/>
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
diff --git a/android/res/layout/fragment_review.xml b/android/res/layout/fragment_review.xml
index 1cf112d06e..a8d0336aee 100644
--- a/android/res/layout/fragment_review.xml
+++ b/android/res/layout/fragment_review.xml
@@ -6,8 +6,8 @@
android:layout_height="match_parent"
android:background="?cardBackground">
<android.support.v7.widget.RecyclerView
- android:id="@+id/rv__review"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:listitem="@layout/item_comment"/>
-</LinearLayout> \ No newline at end of file
+ android:id="@+id/rv__review"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:listitem="@layout/item_comment"/>
+</LinearLayout>
diff --git a/android/res/layout/item_comment.xml b/android/res/layout/item_comment.xml
index 5d193788a8..7497d9c945 100644
--- a/android/res/layout/item_comment.xml
+++ b/android/res/layout/item_comment.xml
@@ -5,70 +5,70 @@
android:layout_height="wrap_content">
<View
- android:id="@+id/v__divider"
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginRight="@dimen/margin_base"
- android:background="?dividerHorizontal"/>
+ android:id="@+id/v__divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginRight="@dimen/margin_base"
+ android:background="?dividerHorizontal"/>
<TextView
- android:id="@+id/tv__user_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginStart="@dimen/margin_base"
- android:layout_marginTop="@dimen/margin_base"
- android:layout_toLeftOf="@+id/tv__user_rating"
- android:layout_toStartOf="@+id/tv__user_rating"
- android:layout_below="@id/v__divider"
- android:textAppearance="@style/MwmTextAppearance.Body1"
- tools:text="Аleksey"/>
+ android:id="@+id/tv__user_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginStart="@dimen/margin_base"
+ android:layout_marginTop="@dimen/margin_base"
+ android:layout_toLeftOf="@+id/tv__user_rating"
+ android:layout_toStartOf="@+id/tv__user_rating"
+ android:layout_below="@id/v__divider"
+ android:textAppearance="@style/MwmTextAppearance.Body1"
+ tools:text="Аleksey"/>
<TextView
- android:id="@+id/tv__comment_date"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginStart="@dimen/margin_base"
- android:layout_marginBottom="@dimen/margin_base"
- android:layout_below="@id/tv__user_name"
- android:textAppearance="@style/MwmTextAppearance.Body4"
- tools:text="March 29, 2016"/>
+ android:id="@+id/tv__comment_date"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginStart="@dimen/margin_base"
+ android:layout_marginBottom="@dimen/margin_base"
+ android:layout_below="@id/tv__user_name"
+ android:textAppearance="@style/MwmTextAppearance.Body4"
+ tools:text="March 29, 2016"/>
<TextView
- android:id="@+id/tv__user_rating"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="@dimen/margin_base"
- android:layout_marginEnd="@dimen/margin_base"
- android:layout_marginTop="@dimen/margin_base"
- android:layout_alignParentRight="true"
- android:layout_alignParentEnd="true"
- android:layout_below="@id/v__divider"
- android:textAppearance="@style/MwmTextAppearance.Headline"
- tools:text="9.2"/>
+ android:id="@+id/tv__user_rating"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="@dimen/margin_base"
+ android:layout_marginEnd="@dimen/margin_base"
+ android:layout_marginTop="@dimen/margin_base"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ android:layout_below="@id/v__divider"
+ android:textAppearance="@style/MwmTextAppearance.Headline"
+ tools:text="9.2"/>
<TextView
- android:id="@+id/tv__review"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginStart="@dimen/margin_base"
- android:layout_marginRight="@dimen/margin_base"
- android:layout_marginEnd="@dimen/margin_base"
- android:layout_marginBottom="@dimen/margin_base"
- android:layout_below="@id/tv__comment_date"
- android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
- android:visibility="gone"
- tools:text="Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly."/>
+ android:id="@+id/tv__review"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginStart="@dimen/margin_base"
+ android:layout_marginRight="@dimen/margin_base"
+ android:layout_marginEnd="@dimen/margin_base"
+ android:layout_marginBottom="@dimen/margin_base"
+ android:layout_below="@id/tv__comment_date"
+ android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
+ android:visibility="gone"
+ tools:text="Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly."/>
<LinearLayout
- android:id="@+id/ll__positive_review"
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/tv__comment_date">
+ android:id="@+id/ll__positive_review"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/tv__comment_date">
<ImageView
android:layout_width="@dimen/margin_base_plus"
android:layout_height="@dimen/margin_base_plus"
@@ -77,25 +77,25 @@
android:src="?ppPositive"/>
<TextView
- android:id="@+id/tv__positive_review"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_double"
- android:layout_marginStart="@dimen/margin_double"
- android:layout_marginRight="@dimen/margin_base"
- android:layout_marginEnd="@dimen/margin_base"
- android:layout_marginBottom="@dimen/margin_base"
- android:paddingTop="@dimen/margin_eighth"
- android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
- tools:text="Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly."/>
+ android:id="@+id/tv__positive_review"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/margin_double"
+ android:layout_marginStart="@dimen/margin_double"
+ android:layout_marginRight="@dimen/margin_base"
+ android:layout_marginEnd="@dimen/margin_base"
+ android:layout_marginBottom="@dimen/margin_base"
+ android:paddingTop="@dimen/margin_eighth"
+ android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
+ tools:text="Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly."/>
</LinearLayout>
<LinearLayout
- android:id="@+id/ll__negative_review"
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/ll__positive_review">
+ android:id="@+id/ll__negative_review"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/ll__positive_review">
<ImageView
android:id="@+id/iv__negative_review"
android:layout_width="@dimen/margin_base_plus"
@@ -106,17 +106,17 @@
android:src="?ppNegative"/>
<TextView
- android:id="@+id/tv__negative_review"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_double"
- android:layout_marginStart="@dimen/margin_double"
- android:layout_marginRight="@dimen/margin_base"
- android:layout_marginEnd="@dimen/margin_base"
- android:layout_marginBottom="@dimen/margin_base"
- android:paddingTop="@dimen/margin_eighth"
- android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
- tools:text="Little bit noise from outsideLittle bit noise from outside"/>
+ android:id="@+id/tv__negative_review"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/margin_double"
+ android:layout_marginStart="@dimen/margin_double"
+ android:layout_marginRight="@dimen/margin_base"
+ android:layout_marginEnd="@dimen/margin_base"
+ android:layout_marginBottom="@dimen/margin_base"
+ android:paddingTop="@dimen/margin_eighth"
+ android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
+ tools:text="Little bit noise from outsideLittle bit noise from outside"/>
</LinearLayout>
</RelativeLayout>
diff --git a/android/res/layout/item_facility.xml b/android/res/layout/item_facility.xml
index aabc553c69..69790a57e5 100644
--- a/android/res/layout/item_facility.xml
+++ b/android/res/layout/item_facility.xml
@@ -11,14 +11,14 @@
tools:visibility="visible">
<ImageView
- android:id="@+id/iv__icon"
- style="@style/PlacePageMetadataIcon"
- android:src="@drawable/ic_entrance"/>
+ android:id="@+id/iv__icon"
+ style="@style/PlacePageMetadataIcon"
+ android:src="@drawable/ic_entrance"/>
<TextView
- android:id="@+id/tv__facility"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
- tools:text="Pets are allowed on request"/>
-</LinearLayout> \ No newline at end of file
+ android:id="@+id/tv__facility"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
+ tools:text="Pets are allowed on request"/>
+</LinearLayout>
diff --git a/android/res/layout/item_gallery.xml b/android/res/layout/item_gallery.xml
index 3712672871..ae725d082b 100644
--- a/android/res/layout/item_gallery.xml
+++ b/android/res/layout/item_gallery.xml
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="@dimen/placepage_hotel_gallery_width"
- android:layout_height="@dimen/placepage_hotel_gallery_height"
- android:clickable="true"
- android:focusable="true"
- android:foreground="?attr/selectableItemBackground">
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="@dimen/placepage_hotel_gallery_width"
+ android:layout_height="@dimen/placepage_hotel_gallery_height"
+ android:clickable="true"
+ android:focusable="true"
+ android:foreground="?attr/selectableItemBackground">
<ImageView
- android:id="@+id/iv__image"
- android:layout_width="@dimen/placepage_hotel_gallery_width"
- android:layout_height="@dimen/placepage_hotel_gallery_height"
- tools:src="@color/base_green"/>
+ android:id="@+id/iv__image"
+ android:layout_width="@dimen/placepage_hotel_gallery_width"
+ android:layout_height="@dimen/placepage_hotel_gallery_height"
+ tools:src="@color/base_green"/>
<TextView
- android:id="@+id/tv__more"
- style="@style/PlacePageGalleryText"
- android:text="@string/placepage_more_button"
- android:visibility="gone"
- tools:visibility="visible"/>
-</FrameLayout> \ No newline at end of file
+ android:id="@+id/tv__more"
+ style="@style/PlacePageGalleryText"
+ android:text="@string/placepage_more_button"
+ android:visibility="gone"
+ tools:visibility="visible"/>
+</FrameLayout>
diff --git a/android/res/layout/item_image.xml b/android/res/layout/item_image.xml
index 5c3443e5c1..9cc9280539 100644
--- a/android/res/layout/item_image.xml
+++ b/android/res/layout/item_image.xml
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="@dimen/gallery_image_height"
- android:clickable="true"
- android:focusable="true"
- android:foreground="?attr/selectableItemBackground">
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/gallery_image_height"
+ android:clickable="true"
+ android:focusable="true"
+ android:foreground="?attr/selectableItemBackground">
<ImageView
- android:id="@+id/iv__image"
- android:layout_width="match_parent"
- android:layout_height="@dimen/gallery_image_height"
- tools:src="@color/base_green"/>
-</FrameLayout> \ No newline at end of file
+ android:id="@+id/iv__image"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/gallery_image_height"
+ tools:src="@color/base_green"/>
+</FrameLayout>
diff --git a/android/res/layout/item_more_button.xml b/android/res/layout/item_more_button.xml
index e4e113952d..8854ec9750 100644
--- a/android/res/layout/item_more_button.xml
+++ b/android/res/layout/item_more_button.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
- xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/PlacePageMetadataText.Button"
- android:height="@dimen/height_block_base"
- android:background="?clickableBackground"
- android:gravity="center"
- android:text="@string/placepage_more_reviews_button"/> \ No newline at end of file
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/PlacePageMetadataText.Button"
+ android:height="@dimen/height_block_base"
+ android:background="?clickableBackground"
+ android:gravity="center"
+ android:text="@string/placepage_more_reviews_button"/>
diff --git a/android/res/layout/item_nearby.xml b/android/res/layout/item_nearby.xml
index 4b5a28003a..da838d14bf 100644
--- a/android/res/layout/item_nearby.xml
+++ b/android/res/layout/item_nearby.xml
@@ -15,52 +15,52 @@
tools:background="#4000FFFF">
<ImageView
- android:id="@+id/iv__icon"
- android:layout_width="@dimen/placepage_hotel_nearby_icon_size"
- android:layout_height="@dimen/placepage_hotel_nearby_icon_size"
- android:layout_centerVertical="true"
- tools:src="@color/base_green"/>
+ android:id="@+id/iv__icon"
+ android:layout_width="@dimen/placepage_hotel_nearby_icon_size"
+ android:layout_height="@dimen/placepage_hotel_nearby_icon_size"
+ android:layout_centerVertical="true"
+ tools:src="@color/base_green"/>
<LinearLayout
- android:id="@+id/ll__info"
- android:orientation="vertical"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_double"
- android:layout_marginStart="@dimen/margin_double"
- android:layout_centerVertical="true"
- android:layout_toRightOf="@id/iv__icon"
- android:layout_toEndOf="@id/iv__icon"
- android:gravity="center_vertical">
+ android:id="@+id/ll__info"
+ android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/margin_double"
+ android:layout_marginStart="@dimen/margin_double"
+ android:layout_centerVertical="true"
+ android:layout_toRightOf="@id/iv__icon"
+ android:layout_toEndOf="@id/iv__icon"
+ android:gravity="center_vertical">
<TextView
- android:id="@+id/tv__title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:maxLines="1"
- android:textAppearance="@style/MwmTextAppearance.Body1"
- tools:text="Bowery"/>
+ android:id="@+id/tv__title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:maxLines="1"
+ android:textAppearance="@style/MwmTextAppearance.Body1"
+ tools:text="Bowery"/>
<TextView
- android:id="@+id/tv__type"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/margin_quarter"
- android:maxLines="1"
- android:textAppearance="@style/MwmTextAppearance.Body3"
- tools:text="Subway Station"/>
+ android:id="@+id/tv__type"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_quarter"
+ android:maxLines="1"
+ android:textAppearance="@style/MwmTextAppearance.Body3"
+ tools:text="Subway Station"/>
</LinearLayout>
<TextView
- android:id="@+id/tv__distance"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignParentEnd="true"
- android:layout_centerVertical="true"
- android:layout_toRightOf="@id/ll__info"
- android:layout_toEndOf="@id/ll__info"
- android:maxLines="1"
- android:textAppearance="@style/MwmTextAppearance.PlacePage.Accent"
- android:gravity="end"
- tools:text="800 ft"/>
-</RelativeLayout> \ No newline at end of file
+ android:id="@+id/tv__distance"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ android:layout_centerVertical="true"
+ android:layout_toRightOf="@id/ll__info"
+ android:layout_toEndOf="@id/ll__info"
+ android:maxLines="1"
+ android:textAppearance="@style/MwmTextAppearance.PlacePage.Accent"
+ android:gravity="end"
+ tools:text="800 ft"/>
+</RelativeLayout>
diff --git a/android/res/layout/item_rating.xml b/android/res/layout/item_rating.xml
index f426782160..b079ce2110 100644
--- a/android/res/layout/item_rating.xml
+++ b/android/res/layout/item_rating.xml
@@ -20,10 +20,10 @@
tools:text="Rating: 8.7 (Excellent)"/>
<TextView
- android:id="@+id/tv__place_hotel_rating_base"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/margin_half"
- android:textAppearance="@style/MwmTextAppearance.Body3"
- tools:text="Based on 848 hotel reviews"/>
+ android:id="@+id/tv__place_hotel_rating_base"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_half"
+ android:textAppearance="@style/MwmTextAppearance.Body3"
+ tools:text="Based on 848 hotel reviews"/>
</LinearLayout>
diff --git a/android/res/layout/place_page_hotel_description.xml b/android/res/layout/place_page_hotel_description.xml
index db3e442da1..9cd23bdf12 100644
--- a/android/res/layout/place_page_hotel_description.xml
+++ b/android/res/layout/place_page_hotel_description.xml
@@ -11,33 +11,33 @@
tools:visibility="visible">
<TextView
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginRight="@dimen/margin_base"
- android:layout_marginTop="@dimen/margin_base"
- style="@style/PlacePageTitleText"
- android:text="@string/details"/>
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginRight="@dimen/margin_base"
+ android:layout_marginTop="@dimen/margin_base"
+ style="@style/PlacePageTitleText"
+ android:text="@string/details"/>
<com.mapswithme.maps.widget.LineCountTextView
- android:id="@+id/tv__place_hotel_details"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginRight="@dimen/margin_base"
- android:layout_marginTop="@dimen/margin_half_plus"
- android:layout_marginBottom="@dimen/margin_half_plus"
- android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
- android:maxLines="5"
- tools:text="One of our top picks in New York City. This boutique hotel in the Manhattan neighborhood of Nolita features a private rooftop and rooms with free WiFi. The Bowery subway station is 1 block from this New York hotel."/>
+ android:id="@+id/tv__place_hotel_details"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginRight="@dimen/margin_base"
+ android:layout_marginTop="@dimen/margin_half_plus"
+ android:layout_marginBottom="@dimen/margin_half_plus"
+ android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
+ android:maxLines="@integer/pp_hotel_description_lines"
+ tools:text="One of our top picks in New York City. This boutique hotel in the Manhattan neighborhood of Nolita features a private rooftop and rooms with free WiFi. The Bowery subway station is 1 block from this New York hotel."/>
<TextView
- android:id="@+id/tv__place_hotel_more"
- style="@style/PlacePageMetadataText.Button"
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginRight="@dimen/margin_base"
- android:height="@dimen/height_block_base"
- android:background="?clickableBackground"
- android:gravity="center"
- android:text="@string/placepage_more_button"/>
+ android:id="@+id/tv__place_hotel_more"
+ style="@style/PlacePageMetadataText.Button"
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginRight="@dimen/margin_base"
+ android:height="@dimen/height_block_base"
+ android:background="?clickableBackground"
+ android:gravity="center"
+ android:text="@string/placepage_more_button"/>
<include layout="@layout/divider_horizontal"/>
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
diff --git a/android/res/layout/place_page_hotel_facilities.xml b/android/res/layout/place_page_hotel_facilities.xml
index a8bab592f9..d126cbbe70 100644
--- a/android/res/layout/place_page_hotel_facilities.xml
+++ b/android/res/layout/place_page_hotel_facilities.xml
@@ -11,32 +11,32 @@
tools:visibility="visible">
<TextView
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginRight="@dimen/margin_base"
- android:layout_marginTop="@dimen/margin_base"
- style="@style/PlacePageTitleText"
- android:text="@string/placepage_hotel_facilities"/>
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginRight="@dimen/margin_base"
+ android:layout_marginTop="@dimen/margin_base"
+ style="@style/PlacePageTitleText"
+ android:text="@string/placepage_hotel_facilities"/>
<com.mapswithme.maps.widget.StaticGridView
- android:id="@+id/gv__place_hotel_facilities"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginRight="@dimen/margin_base"
- android:layout_marginTop="@dimen/margin_base"
- android:layout_marginBottom="@dimen/margin_base"
- android:numColumns="2"
- tools:listitem="@layout/item_facility"/>
+ android:id="@+id/gv__place_hotel_facilities"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginRight="@dimen/margin_base"
+ android:layout_marginTop="@dimen/margin_base"
+ android:layout_marginBottom="@dimen/margin_base"
+ android:numColumns="2"
+ tools:listitem="@layout/item_facility"/>
<TextView
- android:id="@+id/tv__place_hotel_facilities_more"
- style="@style/PlacePageMetadataText.Button"
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginRight="@dimen/margin_base"
- android:height="@dimen/height_block_base"
- android:background="?clickableBackground"
- android:gravity="center"
- android:text="@string/placepage_more_button"/>
+ android:id="@+id/tv__place_hotel_facilities_more"
+ style="@style/PlacePageMetadataText.Button"
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginRight="@dimen/margin_base"
+ android:height="@dimen/height_block_base"
+ android:background="?clickableBackground"
+ android:gravity="center"
+ android:text="@string/placepage_more_button"/>
<include layout="@layout/divider_horizontal"/>
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
diff --git a/android/res/layout/place_page_hotel_gallery.xml b/android/res/layout/place_page_hotel_gallery.xml
index 11b81db657..3b964ea024 100644
--- a/android/res/layout/place_page_hotel_gallery.xml
+++ b/android/res/layout/place_page_hotel_gallery.xml
@@ -10,8 +10,8 @@
tools:visibility="visible">
<android.support.v7.widget.RecyclerView
- android:id="@+id/rv__place_hotel_gallery"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:listitem="@layout/item_gallery"/>
-</LinearLayout> \ No newline at end of file
+ android:id="@+id/rv__place_hotel_gallery"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:listitem="@layout/item_gallery"/>
+</LinearLayout>
diff --git a/android/res/layout/place_page_hotel_nearby.xml b/android/res/layout/place_page_hotel_nearby.xml
index 13810b7db2..ea675113cb 100644
--- a/android/res/layout/place_page_hotel_nearby.xml
+++ b/android/res/layout/place_page_hotel_nearby.xml
@@ -13,17 +13,17 @@
<include layout="@layout/divider_horizontal"/>
<TextView
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginRight="@dimen/margin_base"
- android:layout_marginTop="@dimen/margin_base"
- style="@style/PlacePageTitleText"
- android:text="@string/placepage_hotel_nearby"/>
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginRight="@dimen/margin_base"
+ android:layout_marginTop="@dimen/margin_base"
+ style="@style/PlacePageTitleText"
+ android:text="@string/placepage_hotel_nearby"/>
<com.mapswithme.maps.widget.StaticGridView
- android:id="@+id/gv__place_hotel_nearby"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/margin_quarter"
- android:numColumns="1"
- tools:listitem="@layout/item_nearby"/>
-</LinearLayout> \ No newline at end of file
+ android:id="@+id/gv__place_hotel_nearby"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_quarter"
+ android:numColumns="1"
+ tools:listitem="@layout/item_nearby"/>
+</LinearLayout>
diff --git a/android/res/layout/place_page_hotel_rating.xml b/android/res/layout/place_page_hotel_rating.xml
index be2c248f85..864e64538d 100644
--- a/android/res/layout/place_page_hotel_rating.xml
+++ b/android/res/layout/place_page_hotel_rating.xml
@@ -27,32 +27,32 @@
tools:text="Rating: 8.7 (Excellent)"/>
<TextView
- android:id="@+id/tv__place_hotel_rating_base"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/margin_half"
- android:textAppearance="@style/MwmTextAppearance.Body3"
- tools:text="Based on 848 hotel reviews"/>
+ android:id="@+id/tv__place_hotel_rating_base"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/margin_half"
+ android:textAppearance="@style/MwmTextAppearance.Body3"
+ tools:text="Based on 848 hotel reviews"/>
</LinearLayout>
<com.mapswithme.maps.widget.StaticGridView
- android:id="@+id/gv__place_hotel_review"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:numColumns="1"
- tools:listitem="@layout/item_comment"/>
+ android:id="@+id/gv__place_hotel_review"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:numColumns="1"
+ tools:listitem="@layout/item_comment"/>
<View
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:layout_marginLeft="@dimen/margin_base"
- android:layout_marginRight="@dimen/margin_base"
- android:background="?dividerHorizontal"/>
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginLeft="@dimen/margin_base"
+ android:layout_marginRight="@dimen/margin_base"
+ android:background="?dividerHorizontal"/>
<TextView
- android:id="@+id/tv__place_hotel_reviews_more"
- style="@style/PlacePageMetadataText.Button"
- android:height="@dimen/height_block_base"
- android:background="?clickableBackground"
- android:gravity="center"
- android:text="@string/placepage_more_reviews_button"/>
+ android:id="@+id/tv__place_hotel_reviews_more"
+ style="@style/PlacePageMetadataText.Button"
+ android:height="@dimen/height_block_base"
+ android:background="?clickableBackground"
+ android:gravity="center"
+ android:text="@string/placepage_more_reviews_button"/>
</LinearLayout>
diff --git a/android/res/layout/toolbar_transparent.xml b/android/res/layout/toolbar_transparent.xml
index 7eb9e7d32f..9a18440d8d 100644
--- a/android/res/layout/toolbar_transparent.xml
+++ b/android/res/layout/toolbar_transparent.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/toolbar"
- style="@style/MwmWidget.ToolbarStyle"
- android:layout_width="match_parent"
- android:layout_height="?attr/actionBarSize"
- android:theme="@style/MwmWidget.ToolbarTheme.Transparent"/> \ No newline at end of file
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/toolbar"
+ style="@style/MwmWidget.ToolbarStyle"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ android:theme="@style/MwmWidget.ToolbarTheme.Transparent"/>
diff --git a/android/res/values-v16/styles-text.xml b/android/res/values-v16/styles-text.xml
index a9ba1ab5b2..03e6be2368 100644
--- a/android/res/values-v16/styles-text.xml
+++ b/android/res/values-v16/styles-text.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <style name="MwmTextAppearance.PlacePage.Title"
- parent="MwmTextAppearance.Body3">
- <item name="android:fontFamily">sans-serif-medium</item>
- </style>
-</resources> \ No newline at end of file
+ <style name="MwmTextAppearance.PlacePage.Title"
+ parent="MwmTextAppearance.Body3">
+ <item name="android:fontFamily">sans-serif-medium</item>
+ </style>
+</resources>
diff --git a/android/res/values/integer.xml b/android/res/values/integer.xml
index 1eb091d22b..cebfdf8b74 100644
--- a/android/res/values/integer.xml
+++ b/android/res/values/integer.xml
@@ -2,6 +2,7 @@
<resources>
<integer name="pp_title_lines">5</integer>
<integer name="pp_buttons_max">4</integer>
+ <integer name="pp_hotel_description_lines">5</integer>
<integer name="sharing_initial_rows">2</integer>
-</resources> \ No newline at end of file
+</resources>
diff --git a/android/res/values/plurals.xml b/android/res/values/plurals.xml
new file mode 100644
index 0000000000..92249cb081
--- /dev/null
+++ b/android/res/values/plurals.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <plurals name="place_page_booking_rating_base">
+ <item quantity="zero">Based on %d hotel reviews</item>
+ <item quantity="one">Based on %d hotel reviews</item>
+ <item quantity="two">Based on %d hotel reviews</item>
+ <item quantity="few">Based on %d hotel reviews</item>
+ <item quantity="many">Based on %d hotel reviews</item>
+ <item quantity="other">Based on %d hotel reviews</item>
+ </plurals>
+</resources>
diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml
index 39fb5359bf..e19925317d 100644
--- a/android/res/values/strings.xml
+++ b/android/res/values/strings.xml
@@ -3,614 +3,614 @@
<!-- Generated by Twine 0.6.0 -->
<!-- Language: en -->
<resources>
- <!-- SECTION: Strings -->
- <!-- About button text (should be short) -->
- <string name="about">About</string>
- <!-- Button text (should be short) -->
- <string name="back">Back</string>
- <!-- Button text (should be short) -->
- <string name="cancel">Cancel</string>
- <!-- Button which interrupts country download -->
- <string name="cancel_download">Cancel Download</string>
- <!-- Button which deletes downloaded country -->
- <string name="delete">Delete</string>
- <!-- Button to dismiss dialog forever -->
- <string name="do_not_ask_me_again">Do not ask me again</string>
- <!-- Button "do not interrupt download" if user touched actively downloading country -->
- <string name="do_nothing">Continue</string>
- <string name="download_maps">Download Maps</string>
- <!-- Settings/Downloader - Download confirmation button -->
- <string name="download_x_kb">Download %qu kB</string>
- <!-- Settings/Downloader - Download confirmation button -->
- <string name="download_x_mb">Download %qu MB</string>
- <!-- Settings/Downloader - info for country when download fails -->
- <string name="download_has_failed">Download has failed, touch again for one more try</string>
- <!-- Settings/Downloader - info for downloaded country -->
- <string name="downloaded_x_y_touch_to_delete">Downloaded (%1$qu %2$s), touch to delete</string>
- <!-- Settings/Downloader - country info current download progress -->
- <string name="downloading_x_touch_to_cancel">Downloading %qu%%, touch to cancel</string>
- <!-- Settings/Downloader - info for country which started downloading -->
- <string name="downloading">Downloading…</string>
- <string name="get_it_now">Get it now</string>
- <!-- Text to show occasionaly with a proposal to Like our program on Facebook -->
- <string name="share_on_facebook_text">Thank you for using MAPS.ME! Do you like the app? Tell your friends about it! This is the best thanks you could give us.</string>
- <!-- Settings/Downloader - size string, only strings different from English should be translated -->
- <string name="kb">kB</string>
- <!-- Choose measurement on first launch alert - choose metric system button -->
- <string name="kilometres">Kilometers</string>
- <!-- Leave Review dialog - Review button -->
- <string name="leave_a_review">Leave a Review</string>
- <!-- View and button titles for accessibility -->
- <string name="maps">Maps</string>
- <!-- View and button titles for accessibility -->
- <string name="downloader_maps">Maps:</string>
- <!-- Settings/Downloader - info for country in the download queue -->
- <string name="marked_for_downloading">Marked for downloading, touch to cancel</string>
- <!-- Settings/Downloader - size string, only strings different from English should be translated -->
- <string name="mb">MB</string>
- <string name="gb">GB</string>
- <!-- Choose measurement on first launch alert - choose imperial system button -->
- <string name="miles">Miles</string>
- <!-- View and button titles for accessibility -->
- <string name="my_position">My Position</string>
- <string name="ok">OK</string>
- <!-- Settings/Downloader - No free space dialog message -->
- <string name="free_disk_space_for_country_x">Please free some space on your device first in order to download %s</string>
- <!-- Leave Review dialog - Not now button (remind me later) -->
- <string name="remind_me_later">Remind me later</string>
- <!-- Update maps later/Buy pro version later button text -->
- <string name="later">Later</string>
- <!-- Don't show some dialog any more -->
- <string name="never">Never</string>
- <!-- Leave Review dialog - Complain button (goes to support site) -->
- <string name="report_an_issue">Report an issue</string>
- <!-- View and button titles for accessibility -->
- <string name="search">Search</string>
- <!-- Search box placeholder text -->
- <string name="search_map">Search Map</string>
- <!-- Settings/Downloader - info for not downloaded country -->
- <string name="touch_to_download">Touch to download</string>
- <!-- Settings/Downloader - 3G download warning dialog confirm button -->
- <string name="use_cellular_data">Yes</string>
- <!-- Settings/Downloader - No internet connection dialog message -->
- <string name="use_wifi_recommendation_text">We recommend using WiFi to download large maps</string>
- <!-- Choose measurement on first launch alert - title -->
- <string name="which_measurement_system">Which measurement system do you prefer?</string>
- <!-- Location services are disabled by user alert - message -->
- <string name="location_is_disabled_long_text">You currently have all Location Services for this device or application disabled. Please enable them in Settings.</string>
- <!-- Location Services are not available on the device alert - message -->
- <string name="device_doesnot_support_location_services">Your device doesn\&#39;t support Location Services</string>
- <!-- View and button titles for accessibility -->
- <string name="zoom_to_country">Show on the map</string>
- <!-- Message to display at the center of the screen when the country is added to the downloading queue -->
- <string name="country_status_added_to_queue">^\nis added to the downloading queue.</string>
- <!-- Message to display at the center of the screen when the country is downloading -->
- <string name="country_status_downloading">Downloading\n^\n^</string>
- <!-- Button text for the button at the center of the screen when the country is not downloaded -->
- <string name="country_status_download">Download Map\n(^ ^)</string>
- <!-- Button text for the button at the center of the screen when the country is not downloaded and the size should not be shown -->
- <string name="country_status_download_without_size">Download Map</string>
- <!-- Button text for the button at the center of the screen when the country is not downloaded -->
- <string name="country_status_download_without_routing">Download map\nwithout routing (^ ^)</string>
- <!-- Message to display at the center of the screen when the country download has failed -->
- <string name="country_status_download_failed">Downloading has failed</string>
- <!-- Button text for the button under the country_status_download_failed message -->
- <string name="try_again">Try Again</string>
- <string name="app_name">MAPS.ME</string>
- <string name="about_menu_title">About MAPS.ME</string>
- <string name="downloading_touch_to_cancel">Downloading %d%%, touch to cancel</string>
- <string name="downloaded_touch_to_delete">Downloaded (%s), touch to delete</string>
- <string name="connection_settings">Connection Settings</string>
- <string name="download_mb_or_kb">Download %s</string>
- <string name="close">Close</string>
- <string name="unsupported_phone">A hardware accelerated OpenGL is required. Unfortunately, your device is not supported.</string>
- <string name="download">Download</string>
- <string name="external_storage_is_not_available">SD card/USB storage with downloaded maps is not available</string>
- <string name="disconnect_usb_cable">Please disconnect USB cable or insert memory card to use MAPS.ME</string>
- <string name="not_enough_free_space_on_sdcard">Please free some space on SD card/USB storage first in order to use the app</string>
- <string name="not_enough_memory">Not enough memory to launch app</string>
- <string name="free_space_for_country">Please free %1$s on your device first in order to download %2$s</string>
- <string name="download_resources">Before you start let us download general world map into your device.\nIt needs %s of data.</string>
- <string name="getting_position">Getting current position</string>
- <string name="download_resources_continue">Go to Map</string>
- <string name="downloading_country_can_proceed">Downloading %s. You can now\nproceed to the map.</string>
- <string name="download_country_ask">Download %s?</string>
- <string name="update_country_ask">Update %s?</string>
- <!-- REMOVE THIS STRING AFTER REFACTORING -->
- <string name="download_location_map_proposal">You can download the map\nof your current location.</string>
- <!-- REMOVE THIS_STRING AFTER REFACTORING -->
- <string name="download_location_update_map_proposal">You can update the map\nof your current location.</string>
- <!-- REMOVE THIS STRING AFTER REFACTORING -->
- <string name="download_location_map_up_to_date">The map of your current\nlocation (%s) is up-to-date</string>
- <!-- REMOVE THIS STRING AFTER REFACTORING -->
- <string name="pause">Pause</string>
- <!-- REMOVE THIS STRING AFTER REFACTORING -->
- <string name="continue_download">Continue</string>
- <string name="downloaded_touch_to_update">Downloaded (%s), touch to update or delete</string>
- <string name="update_mb_or_kb">Update %s</string>
- <!-- Show popup notification when we have downloaded countries without search (from Lite version) -->
- <string name="search_update_maps">You need updated maps for search function:</string>
- <!-- Show popup notification on app start when we have out-of-date maps -->
- <string name="advise_update_maps">Update available for these maps:</string>
- <!-- Show popup notification in Pro version that Lite can be deleted -->
- <string name="suggest_uninstall_lite">You don\&#39;t need MAPS.ME Lite any more, so you can uninstall it.</string>
- <!-- Show popup notification on top of the map when country was downloaded. -->
- <string name="download_country_success">%s downloaded successfully</string>
- <!-- Show popup notification on top of the map when country download has failed. -->
- <string name="download_country_failed">%s download has failed</string>
- <!-- Add New Bookmark Set dialog title -->
- <string name="add_new_set">Add New Set</string>
- <!-- Place Page - Add To Bookmarks button -->
- <string name="add_to_bookmarks">Add to Bookmarks</string>
- <!-- Bookmark Color dialog title -->
- <string name="bookmark_color">Bookmark Color</string>
- <!-- Add Bookmark Set dialog - hint when set name is empty -->
- <string name="bookmark_set_name">Bookmark Set Name</string>
- <!-- Bookmark Sets dialog title -->
- <string name="bookmark_sets">Bookmark Sets</string>
- <!-- Bookmarks - dialog title -->
- <string name="bookmarks">Bookmarks</string>
- <!-- Add bookmark dialog - bookmark color -->
- <string name="color">Color</string>
- <!-- Default bookmarks set name -->
- <string name="my_places">My Places</string>
- <!-- Add bookmark dialog - bookmark name -->
- <string name="name">Name</string>
- <!-- Editor title above street and house number -->
- <string name="address">Address</string>
- <!-- Place Page - Remove Pin button -->
- <string name="remove_pin">Remove Pin</string>
- <!-- Add bookmark dialog - bookmark set, Bookmarks dialog - Bookmark set cell -->
- <string name="set">Set</string>
- <!-- Text hint in Bookmarks dialog when no any bookmarks are added -->
- <string name="bookmarks_usage_hint">You have no bookmarks yet.\nTap on any place on the map to add a bookmark.\nBookmarks from other sources can also be imported and displayed in MAPS.ME. Open KML/KMZ file with saved bookmarks from email, Dropbox or weblink.</string>
- <!-- Text hint in Bookmarks dialog when at least one bookmark is added -->
- <string name="bookmarks_usage_hint_import_only">Bookmarks from other sources can be imported and displayed in MAPS.ME. Open KML/KMZ file with saved bookmarks from mail, Dropbox or weblink.</string>
- <!-- Settings button in system menu -->
- <string name="settings">Settings</string>
- <!-- Header of settings activity where user defines storage path -->
- <string name="maps_storage">Maps storage</string>
- <!-- Detailed description of Maps Storage settings button -->
- <string name="maps_storage_summary">Select the place where maps should be downloaded to</string>
- <!-- Question dialog for transferring maps from one storage to another -->
- <string name="move_maps">Move maps?</string>
- <!-- Ask to wait user several minutes (some long process in modal dialog). -->
- <string name="wait_several_minutes">This can take several minutes.\nPlease wait…</string>
- <!-- Show bookmarks from this category on a map or not -->
- <string name="visible">Visible</string>
- <!-- Toast which is displayed when GPS has been deactivated -->
- <string name="gps_is_disabled_long_text">GPS is disabled. Please enable it in Settings.</string>
- <!-- Measurement units title in settings activity -->
- <string name="measurement_units">Measurement units</string>
- <!-- Detailed description of Measurement Units settings button -->
- <string name="measurement_units_summary">Choose between miles and kilometers</string>
- <!-- Do search in all sources -->
- <string name="search_mode_all">Everywhere</string>
- <!-- Do search near my position only -->
- <string name="search_mode_nearme">Near Me</string>
- <!-- Do search in current viewport only -->
- <string name="search_mode_viewport">On the Screen</string>
- <!-- Search Suggestion -->
- <string name="food">Food</string>
- <!-- Search Suggestion -->
- <string name="transport">Transport</string>
- <!-- Search Suggestion -->
- <string name="fuel">Gas</string>
- <!-- Search Suggestion -->
- <string name="parking">Parking</string>
- <!-- Search Suggestion -->
- <string name="shop">Shop</string>
- <!-- Search Suggestion -->
- <string name="hotel">Hotel</string>
- <!-- Search Suggestion -->
- <string name="tourism">Sights</string>
- <!-- Search Suggestion -->
- <string name="entertainment">Entertainment</string>
- <!-- Search Suggestion -->
- <string name="atm">ATM</string>
- <!-- Search Suggestion -->
- <string name="bank">Bank</string>
- <!-- Search Suggestion -->
- <string name="pharmacy">Pharmacy</string>
- <!-- Search Suggestion -->
- <string name="hospital">Hospital</string>
- <!-- Search Suggestion -->
- <string name="toilet">Toilet</string>
- <!-- Search Suggestion -->
- <string name="post">Post</string>
- <!-- Search Suggestion -->
- <string name="police">Police</string>
- <!-- String in search result list, when nothing found -->
- <string name="no_search_results_found">No results found</string>
- <!-- Notes field in Bookmarks view -->
- <string name="description">Notes</string>
- <!-- Button text -->
- <string name="share_by_email">Share by email</string>
- <!-- Email Subject when sharing bookmarks category -->
- <string name="share_bookmarks_email_subject">Shared MAPS.ME bookmarks</string>
- <!-- Email text when sharing bookmarks category -->
- <string name="share_bookmarks_email_body">Greetings,\n\nAttached are my bookmarks from MAPS.ME offline maps. Please open it if you have MAPS.ME installed. If not, download the app for your iOS or Android device following this link: http://maps.me/get?kmz\n\nEnjoy traveling with MAPS.ME!</string>
- <!-- message title of loading file -->
- <string name="load_kmz_title">Loading Bookmarks</string>
- <!-- Kmz file successful loading -->
- <string name="load_kmz_successful">Bookmarks loaded successfully! You can find them on the map or on the Bookmarks Manager screen.</string>
- <!-- Kml file loading failed -->
- <string name="load_kmz_failed">Bookmarks upload failed. The file may be corrupted or defective.</string>
- <!-- resource for context menu -->
- <string name="edit">Edit</string>
- <!-- Warning message when doing search around current position -->
- <string name="unknown_current_position">Your location hasn\&#39;t been determined yet</string>
- <!-- Warning message when location country isn't downloaded during search (see also download_location_map_proposal). -->
- <string name="download_location_country">Download the country of your current location (%s)</string>
- <!-- Warning message when viewport country isn't downloaded during search -->
- <string name="download_viewport_country_to_search">Download the country you are searching on (%s)</string>
- <!-- Alert message that we can't run Map Storage settings due to some reasons. -->
- <string name="cant_change_this_setting">Sorry, Map Storage settings are currently disabled.</string>
- <!-- Alert message that downloading is in progress. -->
- <string name="downloading_is_active">Country download is in progress now.</string>
- <!-- Message that will be shown in alert view, when we ask user to leave review on App Store -->
- <string name="appStore_message">Hope you enjoy using MAPS.ME! If so, please rate or review the app at the App Store. It takes less than a minute but can really help us. Thanks for your support!</string>
- <!-- No, thanks -->
- <string name="no_thanks">No, thanks</string>
- <!-- Share one specific bookmark using SMS, %1$@ contains ge0:// and %2$@ http://ge0.me link. @NOTE non-ascii symbols in the link will make 70 bytes sms instead of 140 -->
- <string name="bookmark_share_sms">Hey, check out my pin at MAPS.ME! %1$s or %2$s Don\&#39;t have offline maps installed? Download here: http://maps.me/get</string>
- <!-- Share my position using SMS, %1$@ contains ge0:// and %2$@ http://ge0.me link WITHOUT NAME. @NOTE non-ascii symbols in the link will make 70 bytes sms instead of 140 -->
- <string name="my_position_share_sms">Hey, check out my current location at MAPS.ME! %1$s or %2$s Don\&#39;t have offline maps? Download here: http://maps.me/get</string>
- <!-- Subject for emailed bookmark -->
- <string name="bookmark_share_email_subject">Hey, check out my pin at MAPS.ME map!</string>
- <!-- Share one specific bookmark using EMail, %1$@ is bookmark's name, %2$@ is ge0:// link and %3$@ http://ge0.me -->
- <string name="bookmark_share_email">Hi,\n\nI pinned: %1$s at MAPS.ME, world offline maps. Click this link %2$s or this one %3$s to see the place on the map.\n\nThanks.</string>
- <!-- Subject for emailed position -->
- <string name="my_position_share_email_subject">Hey, check out my current location at MAPS.ME map!</string>
- <!-- Share my position using EMail, %1$@ is ge0:// and %2$@ is http://ge0.me link WITHOUT NAME -->
- <string name="my_position_share_email">Hi,\n\nI\&#39;m here now: %1$s. Click this link %2$s or this one %3$s to see the place on the map.\n\nThanks.</string>
- <!-- Android share by Message/SMS button text (including SMS) -->
- <string name="share_by_message">Share by message</string>
- <!-- Share button text which opens menu with more buttons, like Message, EMail, Facebook etc. -->
- <string name="share">Share</string>
- <!-- iOS share by Message button text (including SMS) -->
- <string name="message">Message</string>
- <!-- Share by email button text, also used in editor. -->
- <string name="email">Email</string>
- <!-- Copy Link -->
- <string name="copy_link">Copy Link</string>
- <!-- Text for the button that returns to caller application -->
- <string name="more_info">Show More Info</string>
- <!-- Text for message when used successfully copied something -->
- <string name="copied_to_clipboard">Copied to Clipboard: %1$s</string>
- <!-- Setting label for statistics turn on/off -->
- <string name="allow_statistics">Send Statistics</string>
- <!-- place preview title -->
- <string name="info">Info</string>
- <!-- Used for bookmark editing -->
- <string name="done">Done</string>
- <!-- Summary for preferences in MWM -->
- <string name="yopme_pref_summary">Choose Back Screen settings</string>
- <!-- Title for yopme preferences in MWM -->
- <string name="yopme_pref_title">Back Screen Settings</string>
- <!-- Hint for upper-right icon p2b -->
- <string name="show_on_backscreen">Show on Back screen</string>
- <!-- Prints version number in About dialog -->
- <string name="version">Version: %s</string>
- <!-- Data version in «About» screen -->
- <string name="data_version">Data version: %d</string>
- <!-- Confirmation in downloading countries dialog -->
- <string name="are_you_sure">Are you sure you want to continue?</string>
- <!-- Title for tracks category in bookmarks manager -->
- <string name="tracks">Tracks</string>
- <!-- Length of track in cell that describes route -->
- <string name="length">Length</string>
- <string name="share_my_location">Share My Location</string>
- <string name="menu_search">Search</string>
- <!-- Settings screen: "Map" category title -->
- <string name="prefs_group_map">Map</string>
- <!-- Settings screen: "Miscellaneous" category title -->
- <string name="prefs_group_misc">Miscellaneous</string>
- <string name="prefs_group_route">Navigation</string>
- <string name="pref_zoom_title">Zoom buttons</string>
- <string name="pref_zoom_summary">Display on the screen</string>
- <!-- Settings «Map» category: «Night style» title -->
- <string name="pref_map_style_title">Night Mode</string>
- <!-- «Map style» entry value -->
- <string name="pref_map_style_default">Off</string>
- <!-- «Map style» entry value -->
- <string name="pref_map_style_night">On</string>
- <!-- «Map style» entry value -->
- <string name="pref_map_style_auto">Auto</string>
- <!-- Settings «Map» category: «Perspective view» title -->
- <string name="pref_map_3d_title">Perspective view</string>
- <!-- Settings «Map» category: «3D buildings» title -->
- <string name="pref_map_3d_buildings_title">3D buildings</string>
- <!-- Settings «Map» category: «3D buildings» summary -->
- <string name="pref_map_3d_buildings_subtitle">Affects battery life</string>
- <!-- Settings «Route» category: «Tts enabled» title -->
- <string name="pref_tts_enable_title">Voice Instructions</string>
- <!-- Settings «Route» category: «Tts language» title -->
- <string name="pref_tts_language_title">Voice Language</string>
- <!-- Settings «Route» category: «Tts unavailable» subtitle -->
- <string name="pref_tts_unavailable">Not Available</string>
- <!-- Title for "Other" section in TTS settings. -->
- <string name="pref_tts_other_section_title">Other</string>
- <string name="pref_tts_how_to_set_up_voice">How to set up voice</string>
- <!-- Settings «Map» category: «Record track» title -->
- <string name="pref_track_record_title">Recent track</string>
- <string name="pref_map_auto_zoom">Auto zoom</string>
- <string name="duration_disabled">Off</string>
- <string name="duration_1_hour">1 hour</string>
- <string name="duration_2_hours">2 hours</string>
- <string name="duration_6_hours">6 hours</string>
- <string name="duration_12_hours">12 hours</string>
- <string name="duration_1_day">1 day</string>
- <string name="recent_track_help_text">Please note: activation of this function causes increased battery usage.</string>
- <string name="pref_track_ios_caption">Recent track shows your traveled path.</string>
- <string name="pref_track_ios_subcaption">Please select the time range of saving the track.</string>
- <string name="placepage_distance">Distance</string>
- <string name="placepage_coordinates">Coordinates</string>
- <string name="placepage_unsorted">Unsorted</string>
- <string name="search_show_on_map">View on map</string>
- <!-- Used to warn user when fixing KitKat issue -->
- <string name="kitkat_migrate_ok">Map data storage has been optimized. Please restart the app.\n\nMapsWithMe folder in the root of SD card is not needed anymore, you can delete it.</string>
- <!-- Used to warn user when fixing KitKat issue -->
- <string name="kitkat_migrate_failed">Due to changes in Android 4.4, we need to optimize map data storage, but there is no enough space to copy map data.\n\nPlease free up the memory, otherwise maps will be available in read-only mode.</string>
- <!-- Used to warn user when fixing KitKat issue -->
- <string name="bookmark_move_fail">We need to move your bookmarks to internal memory, but there is no available space for them. Please free up the memory, otherwise bookmarks won’t be available.</string>
- <!-- Used to warn user when fixing KitKat issue -->
- <string name="kitkat_optimization_in_progress">Your map storage is being optimized now. Please wait, it may take a few minutes.</string>
- <!-- Used in More Apps menu -->
- <string name="free">Free</string>
- <!-- Used in More Apps menu -->
- <string name="buy">Buy</string>
- <!-- 1st search button-like result -->
- <string name="search_on_map">Search on map</string>
- <!-- toast with an error -->
- <string name="no_route_found">No route found</string>
- <!-- route title -->
- <string name="route">Route</string>
- <!-- category title -->
- <string name="routes">Routes</string>
- <!-- Show on first launch. -->
- <string name="maps_licence_info">This applications uses geographical data (including maps, business listings, points of interest, borders of countries and regions, etc.) taken from the OpenStreetMap project. We do not warrant any consistency, accuracy, completeness or applicability of the OpenStreetMap data.</string>
- <!-- Show on first launch. -->
- <string name="agree">I agree</string>
- <!-- Show on first launch -->
- <string name="disagree">I disagree</string>
- <!-- text of notification -->
- <string name="download_map_notification">Download the map of the place where you are</string>
- <!-- text of notification -->
- <string name="pro_version_is_free_today">Full version of MAPS.ME is free today! Download now and tell your friends.</string>
- <!-- Dialog for transferring maps from lite to pro. -->
- <string name="move_lite_maps_to_pro">We are transferring your downloaded maps from MAPS.ME Lite to MAPS.ME. It may take a few minutes.</string>
- <!-- Message to display when maps moved. -->
- <string name="move_lite_maps_to_pro_ok">Your downloaded maps are successfully transferred to MAPS.ME.</string>
- <!-- Message to display when maps move failed. -->
- <string name="move_lite_maps_to_pro_failed">Your maps failed to transfer. Please delete MAPS.ME Lite and download the maps again.</string>
- <!-- Text in menu -->
- <string name="settings_and_more">Settings &amp; More</string>
- <!-- Text in menu -->
- <string name="website">Website</string>
- <!-- Text in menu -->
- <string name="maps_me_community">MAPS.ME Community</string>
- <!-- Text in menu -->
- <string name="like_on_facebook">Like on Facebook</string>
- <!-- Text in menu -->
- <string name="follow_on_twitter">Follow on Twitter</string>
- <!-- Text in menu -->
- <string name="contact_us">Contact us</string>
- <!-- Settings: Send feedback button and dialog title -->
- <string name="feedback">Feedback</string>
- <!-- Settings: "Send general feedback" button -->
- <string name="feedback_general">General feedback</string>
- <!-- Text in menu -->
- <string name="subscribe_to_news">Subscribe to our news</string>
- <!-- Text in menu -->
- <string name="rate_the_app">Rate the app</string>
- <!-- Text in menu -->
- <string name="help">Help</string>
- <!-- Text in menu -->
- <string name="copyright">Copyright</string>
- <!-- Text in menu -->
- <string name="report_a_bug">Report a bug</string>
- <!-- Email subject -->
- <string name="subscribe_me_subject">Please subscribe me to the MAPS.ME newsletter</string>
- <!-- Email body -->
- <string name="subscribe_me_body">I want to be the first to learn about latest news updates and promotions. I can cancel my subscription at any time.</string>
- <!-- About text -->
- <string name="about_text">MAPS.ME offers the fastest offline maps of all the cities, all countries of the world. Travel with full confidence: wherever you are, MAPS.ME helps to locate yourself on the map, find the nearest restaurant, hotel, bank, gas station etc. It doesn’t require internet connection.\n\nWe are always working on new features and would love to hear from you on how you think we could improve MAPS.ME. If you have any problems with the app, don\&#39;t hesitate to contact us at support@maps.me. We respond to every request!\n\nDo you like MAPS.ME and want to support us? There are some simple and absolutely free ways:\n\n- post a review at your App Market\n- like our Facebook page http://www.facebook.com/mapswithme\n- or just tell about MAPS.ME to your mom, friends and colleagues :)\n\nThank you for being with us. We appreciate your support very much!\n\nP.S. We take map data from OpenStreetMap, a mapping project similar to Wikipedia, which allows users to create and edit maps. If you see something is missing or wrong on the map, you can correct the maps directly at http://openstreetmap.org, and your changes will appear in MAPS.ME app with the next version release.</string>
- <!-- Alert text -->
- <string name="email_error_body">The email client has not been set up. Please configure it or use any other way to contact us at %s</string>
- <!-- Alert title -->
- <string name="email_error_title">Mail sending error</string>
- <!-- Settings item title -->
- <string name="pref_calibration_title">Compass calibration</string>
- <!-- Search Suggestion -->
- <string name="wifi">WiFi</string>
- <!-- Update map suggestion -->
- <string name="routing_map_outdated">Please update the map to create a route</string>
- <!-- Update maps suggestion -->
- <string name="routing_update_maps">The new version of MAPS.ME allows creating routes from your current position to a destination point. Please update maps to use this feature.</string>
- <!-- Update all button text -->
- <string name="downloader_update_all_button">Update All</string>
- <!-- Cancel all button text -->
- <string name="downloader_cancel_all">Cancel All</string>
- <!-- Downloaded maps category -->
- <string name="downloader_downloaded_subtitle">Downloaded</string>
- <!-- Downloaded maps category -->
- <string name="downloader_available_maps">Available</string>
- <!-- Country queued for download -->
- <string name="downloader_queued">queued</string>
- <string name="downloader_near_me_subtitle">Near me</string>
- <string name="downloader_status_maps">Maps</string>
- <string name="downloader_download_all_button">Download All</string>
- <string name="downloader_downloading">Downloading:</string>
- <string name="downloader_search_results">Found</string>
- <!-- Disclaimer message -->
- <string name="routing_disclaimer">Creating routes in MAPS.ME app, please keep in mind the following:\n\n - Suggested routes can be considered as recommendations only.\n - Road conditions, traffic rules and signs have higher priority than navigation advice.\n - The map may be incorrect or outdated, and routes may not be created the best possible way.\n\n Be safe on roads and take care of yourself!</string>
- <!-- Outdated maps category -->
- <string name="downloader_outdated_maps">Outdated</string>
- <!-- Up to date maps category -->
- <string name="downloader_uptodate_maps">Up-to-date</string>
- <!-- Status of outdated country in the list -->
- <string name="downloader_status_outdated">Update</string>
- <!-- Status of failed country in the list -->
- <string name="downloader_status_failed">Failed</string>
- <!-- Displayed in a dialog that appears when a user tries to delete a map while the app is in the follow route mode -->
- <string name="downloader_delete_map_while_routing_dialog">To delete map please stop navigation.</string>
- <!-- Show when user try build route, but we don't know where he -->
- <string name="routing_failed_unknown_my_position">Current location is undefined. Please specify location to create route.</string>
- <!-- Show if use has not routing file, or InconsistentMWMandRoute -->
- <string name="routing_failed_has_no_routing_file">Additional data is required to create the route. Download data now?</string>
- <!-- StartPointNotFound -->
- <string name="routing_failed_start_point_not_found">Cannot calculate the route. No roads near your starting point.</string>
- <!-- EndPointNotFound -->
- <string name="routing_failed_dst_point_not_found">Cannot calculate the route. No roads near your destination.</string>
- <!-- PointsInDifferentMWM -->
- <string name="routing_failed_cross_mwm_building">Routes can only be created that are fully contained within a single map.</string>
- <!-- RouteNotFound -->
- <string name="routing_failed_route_not_found">There is no route found between the selected origin and destination. Please select a different start or end point.</string>
- <!-- InternalError -->
- <string name="routing_failed_internal_error">Internal error occurred. Please try to delete and download the map again. If problem persist please contact us at support@maps.me.</string>
- <!-- Context menu item for downloader. -->
- <string name="downloader_download_map_and_routing">Download Map + Routing</string>
- <!-- Context menu item for downloader. -->
- <string name="downloader_download_routing">Download Routing</string>
- <!-- Context menu item for downloader. -->
- <string name="downloader_delete_routing">Delete Routing</string>
- <!-- Context menu item for downloader. -->
- <string name="downloader_download_map">Download map</string>
- <string name="downloader_download_map_no_routing">Download map without routing</string>
- <!-- Button for routing. -->
- <string name="routing_go">Go!</string>
- <!-- Item status in downloader. -->
- <string name="downloader_retry">Retry</string>
- <!-- Item in context menu. -->
- <string name="downloader_map_and_routing">Map + Routing</string>
- <!-- Item in context menu. -->
- <string name="downloader_delete_map">Delete Map</string>
- <!-- Item in context menu. -->
- <string name="downloader_update_map">Update Map</string>
- <!-- Item in context menu. -->
- <string name="downloader_update_map_and_routing">Update Map + Routing</string>
- <!-- Item in context menu. -->
- <string name="downloader_map_only">Map Only</string>
- <!-- Toolbar title -->
- <string name="toolbar_application_menu">Application menu</string>
- <!-- Preference text -->
- <string name="pref_use_google_play">Use Google Play Services to get your current location</string>
- <!-- Text for rating dialog -->
- <string name="rating_just_rated">I’ve just rated your app</string>
- <!-- Text for rating dialog -->
- <string name="rating_user_since">I’ve been MAPS.ME user since %s</string>
- <!-- Text for rating dialog -->
- <string name="rating_do_like_maps">Do you like MAPS.ME?</string>
- <!-- Text for rating dialog -->
- <string name="rating_tap_star">Tap a star to rate our app.</string>
- <!-- Text for rating dialog -->
- <string name="rating_thanks">Thank you!</string>
- <!-- Text for rating dialog -->
- <string name="rating_share_ideas">Share any ideas or issues so we can improve the app for you.</string>
- <!-- Text for rating dialog -->
- <string name="rating_send_feedback">Send feedback</string>
- <!-- Text for g+ dialog -->
- <string name="rating_google_plus">Click g+ to tell your friends about the app.</string>
- <!-- Text for routing error dialog -->
- <string name="routing_download_maps_along">Download maps along route</string>
- <!-- Text for routing error dialog -->
- <string name="routing_download_map">Get map</string>
- <!-- Text for routing error dialog -->
- <string name="routing_download_map_and_routing">Download updated map and routing data to get all MAPS.ME features.</string>
- <!-- Text for routing error dialog -->
- <string name="routing_get_routing_data">Get routing data</string>
- <!-- Text for routing error dialog -->
- <string name="routing_get_additional_data">Additional data required to create routes from your location.</string>
- <!-- Text for routing error dialog -->
- <string name="routing_requires_all_map">Creating a route requires all the maps from your location to destination downloaded and updated.</string>
- <!-- Text for routing error dialog -->
- <string name="routing_not_enough_space">Not enough space</string>
- <!-- Text for routing error dialog -->
- <string name="routing_download_more_than_avail">You need to download %1$s MB, but only %2$s MB are available.</string>
- <!-- Text for routing error dialog -->
- <string name="routing_download_roaming">You are going to download %s MB using Mobile Data (in Roaming). This may result in additional charges, depending on your operator mobile data plan.</string>
- <!-- bookmark button text -->
- <string name="bookmark">bookmark</string>
- <!-- map is not downloaded -->
- <string name="not_found_map">The map for your location is not downloaded</string>
- <!-- location service disabled -->
- <string name="enable_location_services">Please enable Location Services</string>
- <!-- download map -->
- <string name="download_map">Download the map for your location</string>
- <!-- download map on iPhone -->
- <string name="download_map_iphone">Download a current location map on your iPhone</string>
- <!-- clear pin -->
- <string name="nearby">Nearby</string>
- <!-- clear pin -->
- <string name="clear_pin">Clear Pin</string>
- <!-- location is undefined -->
- <string name="undefined_location">Current location is undefined.</string>
- <!-- download country of your location -->
- <string name="download_country">Download the country of your current location</string>
- <!-- download failed -->
- <string name="download_failed">download has failed</string>
- <!-- get the map -->
- <string name="get_the_map">Get the map</string>
- <string name="save">Save</string>
- <string name="edit_description_hint">Your descriptions (text or html)</string>
- <string name="new_group">new group</string>
- <string name="create">create</string>
- <!-- red color -->
- <string name="red">Red</string>
- <!-- yellow color -->
- <string name="yellow">Yellow</string>
- <!-- blue color -->
- <string name="blue">Blue</string>
- <!-- green color -->
- <string name="green">Green</string>
- <!-- purple color -->
- <string name="purple">Purple</string>
- <!-- orange color -->
- <string name="orange">Orange</string>
- <!-- brown color -->
- <string name="brown">Brown</string>
- <!-- pink color -->
- <string name="pink">Pink</string>
- <!-- Wi-Fi available -->
- <string name="WiFi_available">Yes</string>
+ <!-- SECTION: Strings -->
+ <!-- About button text (should be short) -->
+ <string name="about">About</string>
+ <!-- Button text (should be short) -->
+ <string name="back">Back</string>
+ <!-- Button text (should be short) -->
+ <string name="cancel">Cancel</string>
+ <!-- Button which interrupts country download -->
+ <string name="cancel_download">Cancel Download</string>
+ <!-- Button which deletes downloaded country -->
+ <string name="delete">Delete</string>
+ <!-- Button to dismiss dialog forever -->
+ <string name="do_not_ask_me_again">Do not ask me again</string>
+ <!-- Button "do not interrupt download" if user touched actively downloading country -->
+ <string name="do_nothing">Continue</string>
+ <string name="download_maps">Download Maps</string>
+ <!-- Settings/Downloader - Download confirmation button -->
+ <string name="download_x_kb">Download %qu kB</string>
+ <!-- Settings/Downloader - Download confirmation button -->
+ <string name="download_x_mb">Download %qu MB</string>
+ <!-- Settings/Downloader - info for country when download fails -->
+ <string name="download_has_failed">Download has failed, touch again for one more try</string>
+ <!-- Settings/Downloader - info for downloaded country -->
+ <string name="downloaded_x_y_touch_to_delete">Downloaded (%1$qu %2$s), touch to delete</string>
+ <!-- Settings/Downloader - country info current download progress -->
+ <string name="downloading_x_touch_to_cancel">Downloading %qu%%, touch to cancel</string>
+ <!-- Settings/Downloader - info for country which started downloading -->
+ <string name="downloading">Downloading…</string>
+ <string name="get_it_now">Get it now</string>
+ <!-- Text to show occasionaly with a proposal to Like our program on Facebook -->
+ <string name="share_on_facebook_text">Thank you for using MAPS.ME! Do you like the app? Tell your friends about it! This is the best thanks you could give us.</string>
+ <!-- Settings/Downloader - size string, only strings different from English should be translated -->
+ <string name="kb">kB</string>
+ <!-- Choose measurement on first launch alert - choose metric system button -->
+ <string name="kilometres">Kilometers</string>
+ <!-- Leave Review dialog - Review button -->
+ <string name="leave_a_review">Leave a Review</string>
+ <!-- View and button titles for accessibility -->
+ <string name="maps">Maps</string>
+ <!-- View and button titles for accessibility -->
+ <string name="downloader_maps">Maps:</string>
+ <!-- Settings/Downloader - info for country in the download queue -->
+ <string name="marked_for_downloading">Marked for downloading, touch to cancel</string>
+ <!-- Settings/Downloader - size string, only strings different from English should be translated -->
+ <string name="mb">MB</string>
+ <string name="gb">GB</string>
+ <!-- Choose measurement on first launch alert - choose imperial system button -->
+ <string name="miles">Miles</string>
+ <!-- View and button titles for accessibility -->
+ <string name="my_position">My Position</string>
+ <string name="ok">OK</string>
+ <!-- Settings/Downloader - No free space dialog message -->
+ <string name="free_disk_space_for_country_x">Please free some space on your device first in order to download %s</string>
+ <!-- Leave Review dialog - Not now button (remind me later) -->
+ <string name="remind_me_later">Remind me later</string>
+ <!-- Update maps later/Buy pro version later button text -->
+ <string name="later">Later</string>
+ <!-- Don't show some dialog any more -->
+ <string name="never">Never</string>
+ <!-- Leave Review dialog - Complain button (goes to support site) -->
+ <string name="report_an_issue">Report an issue</string>
+ <!-- View and button titles for accessibility -->
+ <string name="search">Search</string>
+ <!-- Search box placeholder text -->
+ <string name="search_map">Search Map</string>
+ <!-- Settings/Downloader - info for not downloaded country -->
+ <string name="touch_to_download">Touch to download</string>
+ <!-- Settings/Downloader - 3G download warning dialog confirm button -->
+ <string name="use_cellular_data">Yes</string>
+ <!-- Settings/Downloader - No internet connection dialog message -->
+ <string name="use_wifi_recommendation_text">We recommend using WiFi to download large maps</string>
+ <!-- Choose measurement on first launch alert - title -->
+ <string name="which_measurement_system">Which measurement system do you prefer?</string>
+ <!-- Location services are disabled by user alert - message -->
+ <string name="location_is_disabled_long_text">You currently have all Location Services for this device or application disabled. Please enable them in Settings.</string>
+ <!-- Location Services are not available on the device alert - message -->
+ <string name="device_doesnot_support_location_services">Your device doesn\&#39;t support Location Services</string>
+ <!-- View and button titles for accessibility -->
+ <string name="zoom_to_country">Show on the map</string>
+ <!-- Message to display at the center of the screen when the country is added to the downloading queue -->
+ <string name="country_status_added_to_queue">^\nis added to the downloading queue.</string>
+ <!-- Message to display at the center of the screen when the country is downloading -->
+ <string name="country_status_downloading">Downloading\n^\n^</string>
+ <!-- Button text for the button at the center of the screen when the country is not downloaded -->
+ <string name="country_status_download">Download Map\n(^ ^)</string>
+ <!-- Button text for the button at the center of the screen when the country is not downloaded and the size should not be shown -->
+ <string name="country_status_download_without_size">Download Map</string>
+ <!-- Button text for the button at the center of the screen when the country is not downloaded -->
+ <string name="country_status_download_without_routing">Download map\nwithout routing (^ ^)</string>
+ <!-- Message to display at the center of the screen when the country download has failed -->
+ <string name="country_status_download_failed">Downloading has failed</string>
+ <!-- Button text for the button under the country_status_download_failed message -->
+ <string name="try_again">Try Again</string>
+ <string name="app_name">MAPS.ME</string>
+ <string name="about_menu_title">About MAPS.ME</string>
+ <string name="downloading_touch_to_cancel">Downloading %d%%, touch to cancel</string>
+ <string name="downloaded_touch_to_delete">Downloaded (%s), touch to delete</string>
+ <string name="connection_settings">Connection Settings</string>
+ <string name="download_mb_or_kb">Download %s</string>
+ <string name="close">Close</string>
+ <string name="unsupported_phone">A hardware accelerated OpenGL is required. Unfortunately, your device is not supported.</string>
+ <string name="download">Download</string>
+ <string name="external_storage_is_not_available">SD card/USB storage with downloaded maps is not available</string>
+ <string name="disconnect_usb_cable">Please disconnect USB cable or insert memory card to use MAPS.ME</string>
+ <string name="not_enough_free_space_on_sdcard">Please free some space on SD card/USB storage first in order to use the app</string>
+ <string name="not_enough_memory">Not enough memory to launch app</string>
+ <string name="free_space_for_country">Please free %1$s on your device first in order to download %2$s</string>
+ <string name="download_resources">Before you start let us download general world map into your device.\nIt needs %s of data.</string>
+ <string name="getting_position">Getting current position</string>
+ <string name="download_resources_continue">Go to Map</string>
+ <string name="downloading_country_can_proceed">Downloading %s. You can now\nproceed to the map.</string>
+ <string name="download_country_ask">Download %s?</string>
+ <string name="update_country_ask">Update %s?</string>
+ <!-- REMOVE THIS STRING AFTER REFACTORING -->
+ <string name="download_location_map_proposal">You can download the map\nof your current location.</string>
+ <!-- REMOVE THIS_STRING AFTER REFACTORING -->
+ <string name="download_location_update_map_proposal">You can update the map\nof your current location.</string>
+ <!-- REMOVE THIS STRING AFTER REFACTORING -->
+ <string name="download_location_map_up_to_date">The map of your current\nlocation (%s) is up-to-date</string>
+ <!-- REMOVE THIS STRING AFTER REFACTORING -->
+ <string name="pause">Pause</string>
+ <!-- REMOVE THIS STRING AFTER REFACTORING -->
+ <string name="continue_download">Continue</string>
+ <string name="downloaded_touch_to_update">Downloaded (%s), touch to update or delete</string>
+ <string name="update_mb_or_kb">Update %s</string>
+ <!-- Show popup notification when we have downloaded countries without search (from Lite version) -->
+ <string name="search_update_maps">You need updated maps for search function:</string>
+ <!-- Show popup notification on app start when we have out-of-date maps -->
+ <string name="advise_update_maps">Update available for these maps:</string>
+ <!-- Show popup notification in Pro version that Lite can be deleted -->
+ <string name="suggest_uninstall_lite">You don\&#39;t need MAPS.ME Lite any more, so you can uninstall it.</string>
+ <!-- Show popup notification on top of the map when country was downloaded. -->
+ <string name="download_country_success">%s downloaded successfully</string>
+ <!-- Show popup notification on top of the map when country download has failed. -->
+ <string name="download_country_failed">%s download has failed</string>
+ <!-- Add New Bookmark Set dialog title -->
+ <string name="add_new_set">Add New Set</string>
+ <!-- Place Page - Add To Bookmarks button -->
+ <string name="add_to_bookmarks">Add to Bookmarks</string>
+ <!-- Bookmark Color dialog title -->
+ <string name="bookmark_color">Bookmark Color</string>
+ <!-- Add Bookmark Set dialog - hint when set name is empty -->
+ <string name="bookmark_set_name">Bookmark Set Name</string>
+ <!-- Bookmark Sets dialog title -->
+ <string name="bookmark_sets">Bookmark Sets</string>
+ <!-- Bookmarks - dialog title -->
+ <string name="bookmarks">Bookmarks</string>
+ <!-- Add bookmark dialog - bookmark color -->
+ <string name="color">Color</string>
+ <!-- Default bookmarks set name -->
+ <string name="my_places">My Places</string>
+ <!-- Add bookmark dialog - bookmark name -->
+ <string name="name">Name</string>
+ <!-- Editor title above street and house number -->
+ <string name="address">Address</string>
+ <!-- Place Page - Remove Pin button -->
+ <string name="remove_pin">Remove Pin</string>
+ <!-- Add bookmark dialog - bookmark set, Bookmarks dialog - Bookmark set cell -->
+ <string name="set">Set</string>
+ <!-- Text hint in Bookmarks dialog when no any bookmarks are added -->
+ <string name="bookmarks_usage_hint">You have no bookmarks yet.\nTap on any place on the map to add a bookmark.\nBookmarks from other sources can also be imported and displayed in MAPS.ME. Open KML/KMZ file with saved bookmarks from email, Dropbox or weblink.</string>
+ <!-- Text hint in Bookmarks dialog when at least one bookmark is added -->
+ <string name="bookmarks_usage_hint_import_only">Bookmarks from other sources can be imported and displayed in MAPS.ME. Open KML/KMZ file with saved bookmarks from mail, Dropbox or weblink.</string>
+ <!-- Settings button in system menu -->
+ <string name="settings">Settings</string>
+ <!-- Header of settings activity where user defines storage path -->
+ <string name="maps_storage">Maps storage</string>
+ <!-- Detailed description of Maps Storage settings button -->
+ <string name="maps_storage_summary">Select the place where maps should be downloaded to</string>
+ <!-- Question dialog for transferring maps from one storage to another -->
+ <string name="move_maps">Move maps?</string>
+ <!-- Ask to wait user several minutes (some long process in modal dialog). -->
+ <string name="wait_several_minutes">This can take several minutes.\nPlease wait…</string>
+ <!-- Show bookmarks from this category on a map or not -->
+ <string name="visible">Visible</string>
+ <!-- Toast which is displayed when GPS has been deactivated -->
+ <string name="gps_is_disabled_long_text">GPS is disabled. Please enable it in Settings.</string>
+ <!-- Measurement units title in settings activity -->
+ <string name="measurement_units">Measurement units</string>
+ <!-- Detailed description of Measurement Units settings button -->
+ <string name="measurement_units_summary">Choose between miles and kilometers</string>
+ <!-- Do search in all sources -->
+ <string name="search_mode_all">Everywhere</string>
+ <!-- Do search near my position only -->
+ <string name="search_mode_nearme">Near Me</string>
+ <!-- Do search in current viewport only -->
+ <string name="search_mode_viewport">On the Screen</string>
+ <!-- Search Suggestion -->
+ <string name="food">Food</string>
+ <!-- Search Suggestion -->
+ <string name="transport">Transport</string>
+ <!-- Search Suggestion -->
+ <string name="fuel">Gas</string>
+ <!-- Search Suggestion -->
+ <string name="parking">Parking</string>
+ <!-- Search Suggestion -->
+ <string name="shop">Shop</string>
+ <!-- Search Suggestion -->
+ <string name="hotel">Hotel</string>
+ <!-- Search Suggestion -->
+ <string name="tourism">Sights</string>
+ <!-- Search Suggestion -->
+ <string name="entertainment">Entertainment</string>
+ <!-- Search Suggestion -->
+ <string name="atm">ATM</string>
+ <!-- Search Suggestion -->
+ <string name="bank">Bank</string>
+ <!-- Search Suggestion -->
+ <string name="pharmacy">Pharmacy</string>
+ <!-- Search Suggestion -->
+ <string name="hospital">Hospital</string>
+ <!-- Search Suggestion -->
+ <string name="toilet">Toilet</string>
+ <!-- Search Suggestion -->
+ <string name="post">Post</string>
+ <!-- Search Suggestion -->
+ <string name="police">Police</string>
+ <!-- String in search result list, when nothing found -->
+ <string name="no_search_results_found">No results found</string>
+ <!-- Notes field in Bookmarks view -->
+ <string name="description">Notes</string>
+ <!-- Button text -->
+ <string name="share_by_email">Share by email</string>
+ <!-- Email Subject when sharing bookmarks category -->
+ <string name="share_bookmarks_email_subject">Shared MAPS.ME bookmarks</string>
+ <!-- Email text when sharing bookmarks category -->
+ <string name="share_bookmarks_email_body">Greetings,\n\nAttached are my bookmarks from MAPS.ME offline maps. Please open it if you have MAPS.ME installed. If not, download the app for your iOS or Android device following this link: http://maps.me/get?kmz\n\nEnjoy traveling with MAPS.ME!</string>
+ <!-- message title of loading file -->
+ <string name="load_kmz_title">Loading Bookmarks</string>
+ <!-- Kmz file successful loading -->
+ <string name="load_kmz_successful">Bookmarks loaded successfully! You can find them on the map or on the Bookmarks Manager screen.</string>
+ <!-- Kml file loading failed -->
+ <string name="load_kmz_failed">Bookmarks upload failed. The file may be corrupted or defective.</string>
+ <!-- resource for context menu -->
+ <string name="edit">Edit</string>
+ <!-- Warning message when doing search around current position -->
+ <string name="unknown_current_position">Your location hasn\&#39;t been determined yet</string>
+ <!-- Warning message when location country isn't downloaded during search (see also download_location_map_proposal). -->
+ <string name="download_location_country">Download the country of your current location (%s)</string>
+ <!-- Warning message when viewport country isn't downloaded during search -->
+ <string name="download_viewport_country_to_search">Download the country you are searching on (%s)</string>
+ <!-- Alert message that we can't run Map Storage settings due to some reasons. -->
+ <string name="cant_change_this_setting">Sorry, Map Storage settings are currently disabled.</string>
+ <!-- Alert message that downloading is in progress. -->
+ <string name="downloading_is_active">Country download is in progress now.</string>
+ <!-- Message that will be shown in alert view, when we ask user to leave review on App Store -->
+ <string name="appStore_message">Hope you enjoy using MAPS.ME! If so, please rate or review the app at the App Store. It takes less than a minute but can really help us. Thanks for your support!</string>
+ <!-- No, thanks -->
+ <string name="no_thanks">No, thanks</string>
+ <!-- Share one specific bookmark using SMS, %1$@ contains ge0:// and %2$@ http://ge0.me link. @NOTE non-ascii symbols in the link will make 70 bytes sms instead of 140 -->
+ <string name="bookmark_share_sms">Hey, check out my pin at MAPS.ME! %1$s or %2$s Don\&#39;t have offline maps installed? Download here: http://maps.me/get</string>
+ <!-- Share my position using SMS, %1$@ contains ge0:// and %2$@ http://ge0.me link WITHOUT NAME. @NOTE non-ascii symbols in the link will make 70 bytes sms instead of 140 -->
+ <string name="my_position_share_sms">Hey, check out my current location at MAPS.ME! %1$s or %2$s Don\&#39;t have offline maps? Download here: http://maps.me/get</string>
+ <!-- Subject for emailed bookmark -->
+ <string name="bookmark_share_email_subject">Hey, check out my pin at MAPS.ME map!</string>
+ <!-- Share one specific bookmark using EMail, %1$@ is bookmark's name, %2$@ is ge0:// link and %3$@ http://ge0.me -->
+ <string name="bookmark_share_email">Hi,\n\nI pinned: %1$s at MAPS.ME, world offline maps. Click this link %2$s or this one %3$s to see the place on the map.\n\nThanks.</string>
+ <!-- Subject for emailed position -->
+ <string name="my_position_share_email_subject">Hey, check out my current location at MAPS.ME map!</string>
+ <!-- Share my position using EMail, %1$@ is ge0:// and %2$@ is http://ge0.me link WITHOUT NAME -->
+ <string name="my_position_share_email">Hi,\n\nI\&#39;m here now: %1$s. Click this link %2$s or this one %3$s to see the place on the map.\n\nThanks.</string>
+ <!-- Android share by Message/SMS button text (including SMS) -->
+ <string name="share_by_message">Share by message</string>
+ <!-- Share button text which opens menu with more buttons, like Message, EMail, Facebook etc. -->
+ <string name="share">Share</string>
+ <!-- iOS share by Message button text (including SMS) -->
+ <string name="message">Message</string>
+ <!-- Share by email button text, also used in editor. -->
+ <string name="email">Email</string>
+ <!-- Copy Link -->
+ <string name="copy_link">Copy Link</string>
+ <!-- Text for the button that returns to caller application -->
+ <string name="more_info">Show More Info</string>
+ <!-- Text for message when used successfully copied something -->
+ <string name="copied_to_clipboard">Copied to Clipboard: %1$s</string>
+ <!-- Setting label for statistics turn on/off -->
+ <string name="allow_statistics">Send Statistics</string>
+ <!-- place preview title -->
+ <string name="info">Info</string>
+ <!-- Used for bookmark editing -->
+ <string name="done">Done</string>
+ <!-- Summary for preferences in MWM -->
+ <string name="yopme_pref_summary">Choose Back Screen settings</string>
+ <!-- Title for yopme preferences in MWM -->
+ <string name="yopme_pref_title">Back Screen Settings</string>
+ <!-- Hint for upper-right icon p2b -->
+ <string name="show_on_backscreen">Show on Back screen</string>
+ <!-- Prints version number in About dialog -->
+ <string name="version">Version: %s</string>
+ <!-- Data version in «About» screen -->
+ <string name="data_version">Data version: %d</string>
+ <!-- Confirmation in downloading countries dialog -->
+ <string name="are_you_sure">Are you sure you want to continue?</string>
+ <!-- Title for tracks category in bookmarks manager -->
+ <string name="tracks">Tracks</string>
+ <!-- Length of track in cell that describes route -->
+ <string name="length">Length</string>
+ <string name="share_my_location">Share My Location</string>
+ <string name="menu_search">Search</string>
+ <!-- Settings screen: "Map" category title -->
+ <string name="prefs_group_map">Map</string>
+ <!-- Settings screen: "Miscellaneous" category title -->
+ <string name="prefs_group_misc">Miscellaneous</string>
+ <string name="prefs_group_route">Navigation</string>
+ <string name="pref_zoom_title">Zoom buttons</string>
+ <string name="pref_zoom_summary">Display on the screen</string>
+ <!-- Settings «Map» category: «Night style» title -->
+ <string name="pref_map_style_title">Night Mode</string>
+ <!-- «Map style» entry value -->
+ <string name="pref_map_style_default">Off</string>
+ <!-- «Map style» entry value -->
+ <string name="pref_map_style_night">On</string>
+ <!-- «Map style» entry value -->
+ <string name="pref_map_style_auto">Auto</string>
+ <!-- Settings «Map» category: «Perspective view» title -->
+ <string name="pref_map_3d_title">Perspective view</string>
+ <!-- Settings «Map» category: «3D buildings» title -->
+ <string name="pref_map_3d_buildings_title">3D buildings</string>
+ <!-- Settings «Map» category: «3D buildings» summary -->
+ <string name="pref_map_3d_buildings_subtitle">Affects battery life</string>
+ <!-- Settings «Route» category: «Tts enabled» title -->
+ <string name="pref_tts_enable_title">Voice Instructions</string>
+ <!-- Settings «Route» category: «Tts language» title -->
+ <string name="pref_tts_language_title">Voice Language</string>
+ <!-- Settings «Route» category: «Tts unavailable» subtitle -->
+ <string name="pref_tts_unavailable">Not Available</string>
+ <!-- Title for "Other" section in TTS settings. -->
+ <string name="pref_tts_other_section_title">Other</string>
+ <string name="pref_tts_how_to_set_up_voice">How to set up voice</string>
+ <!-- Settings «Map» category: «Record track» title -->
+ <string name="pref_track_record_title">Recent track</string>
+ <string name="pref_map_auto_zoom">Auto zoom</string>
+ <string name="duration_disabled">Off</string>
+ <string name="duration_1_hour">1 hour</string>
+ <string name="duration_2_hours">2 hours</string>
+ <string name="duration_6_hours">6 hours</string>
+ <string name="duration_12_hours">12 hours</string>
+ <string name="duration_1_day">1 day</string>
+ <string name="recent_track_help_text">Please note: activation of this function causes increased battery usage.</string>
+ <string name="pref_track_ios_caption">Recent track shows your traveled path.</string>
+ <string name="pref_track_ios_subcaption">Please select the time range of saving the track.</string>
+ <string name="placepage_distance">Distance</string>
+ <string name="placepage_coordinates">Coordinates</string>
+ <string name="placepage_unsorted">Unsorted</string>
+ <string name="search_show_on_map">View on map</string>
+ <!-- Used to warn user when fixing KitKat issue -->
+ <string name="kitkat_migrate_ok">Map data storage has been optimized. Please restart the app.\n\nMapsWithMe folder in the root of SD card is not needed anymore, you can delete it.</string>
+ <!-- Used to warn user when fixing KitKat issue -->
+ <string name="kitkat_migrate_failed">Due to changes in Android 4.4, we need to optimize map data storage, but there is no enough space to copy map data.\n\nPlease free up the memory, otherwise maps will be available in read-only mode.</string>
+ <!-- Used to warn user when fixing KitKat issue -->
+ <string name="bookmark_move_fail">We need to move your bookmarks to internal memory, but there is no available space for them. Please free up the memory, otherwise bookmarks won’t be available.</string>
+ <!-- Used to warn user when fixing KitKat issue -->
+ <string name="kitkat_optimization_in_progress">Your map storage is being optimized now. Please wait, it may take a few minutes.</string>
+ <!-- Used in More Apps menu -->
+ <string name="free">Free</string>
+ <!-- Used in More Apps menu -->
+ <string name="buy">Buy</string>
+ <!-- 1st search button-like result -->
+ <string name="search_on_map">Search on map</string>
+ <!-- toast with an error -->
+ <string name="no_route_found">No route found</string>
+ <!-- route title -->
+ <string name="route">Route</string>
+ <!-- category title -->
+ <string name="routes">Routes</string>
+ <!-- Show on first launch. -->
+ <string name="maps_licence_info">This applications uses geographical data (including maps, business listings, points of interest, borders of countries and regions, etc.) taken from the OpenStreetMap project. We do not warrant any consistency, accuracy, completeness or applicability of the OpenStreetMap data.</string>
+ <!-- Show on first launch. -->
+ <string name="agree">I agree</string>
+ <!-- Show on first launch -->
+ <string name="disagree">I disagree</string>
+ <!-- text of notification -->
+ <string name="download_map_notification">Download the map of the place where you are</string>
+ <!-- text of notification -->
+ <string name="pro_version_is_free_today">Full version of MAPS.ME is free today! Download now and tell your friends.</string>
+ <!-- Dialog for transferring maps from lite to pro. -->
+ <string name="move_lite_maps_to_pro">We are transferring your downloaded maps from MAPS.ME Lite to MAPS.ME. It may take a few minutes.</string>
+ <!-- Message to display when maps moved. -->
+ <string name="move_lite_maps_to_pro_ok">Your downloaded maps are successfully transferred to MAPS.ME.</string>
+ <!-- Message to display when maps move failed. -->
+ <string name="move_lite_maps_to_pro_failed">Your maps failed to transfer. Please delete MAPS.ME Lite and download the maps again.</string>
+ <!-- Text in menu -->
+ <string name="settings_and_more">Settings &amp; More</string>
+ <!-- Text in menu -->
+ <string name="website">Website</string>
+ <!-- Text in menu -->
+ <string name="maps_me_community">MAPS.ME Community</string>
+ <!-- Text in menu -->
+ <string name="like_on_facebook">Like on Facebook</string>
+ <!-- Text in menu -->
+ <string name="follow_on_twitter">Follow on Twitter</string>
+ <!-- Text in menu -->
+ <string name="contact_us">Contact us</string>
+ <!-- Settings: Send feedback button and dialog title -->
+ <string name="feedback">Feedback</string>
+ <!-- Settings: "Send general feedback" button -->
+ <string name="feedback_general">General feedback</string>
+ <!-- Text in menu -->
+ <string name="subscribe_to_news">Subscribe to our news</string>
+ <!-- Text in menu -->
+ <string name="rate_the_app">Rate the app</string>
+ <!-- Text in menu -->
+ <string name="help">Help</string>
+ <!-- Text in menu -->
+ <string name="copyright">Copyright</string>
+ <!-- Text in menu -->
+ <string name="report_a_bug">Report a bug</string>
+ <!-- Email subject -->
+ <string name="subscribe_me_subject">Please subscribe me to the MAPS.ME newsletter</string>
+ <!-- Email body -->
+ <string name="subscribe_me_body">I want to be the first to learn about latest news updates and promotions. I can cancel my subscription at any time.</string>
+ <!-- About text -->
+ <string name="about_text">MAPS.ME offers the fastest offline maps of all the cities, all countries of the world. Travel with full confidence: wherever you are, MAPS.ME helps to locate yourself on the map, find the nearest restaurant, hotel, bank, gas station etc. It doesn’t require internet connection.\n\nWe are always working on new features and would love to hear from you on how you think we could improve MAPS.ME. If you have any problems with the app, don\&#39;t hesitate to contact us at support@maps.me. We respond to every request!\n\nDo you like MAPS.ME and want to support us? There are some simple and absolutely free ways:\n\n- post a review at your App Market\n- like our Facebook page http://www.facebook.com/mapswithme\n- or just tell about MAPS.ME to your mom, friends and colleagues :)\n\nThank you for being with us. We appreciate your support very much!\n\nP.S. We take map data from OpenStreetMap, a mapping project similar to Wikipedia, which allows users to create and edit maps. If you see something is missing or wrong on the map, you can correct the maps directly at http://openstreetmap.org, and your changes will appear in MAPS.ME app with the next version release.</string>
+ <!-- Alert text -->
+ <string name="email_error_body">The email client has not been set up. Please configure it or use any other way to contact us at %s</string>
+ <!-- Alert title -->
+ <string name="email_error_title">Mail sending error</string>
+ <!-- Settings item title -->
+ <string name="pref_calibration_title">Compass calibration</string>
+ <!-- Search Suggestion -->
+ <string name="wifi">WiFi</string>
+ <!-- Update map suggestion -->
+ <string name="routing_map_outdated">Please update the map to create a route</string>
+ <!-- Update maps suggestion -->
+ <string name="routing_update_maps">The new version of MAPS.ME allows creating routes from your current position to a destination point. Please update maps to use this feature.</string>
+ <!-- Update all button text -->
+ <string name="downloader_update_all_button">Update All</string>
+ <!-- Cancel all button text -->
+ <string name="downloader_cancel_all">Cancel All</string>
+ <!-- Downloaded maps category -->
+ <string name="downloader_downloaded_subtitle">Downloaded</string>
+ <!-- Downloaded maps category -->
+ <string name="downloader_available_maps">Available</string>
+ <!-- Country queued for download -->
+ <string name="downloader_queued">queued</string>
+ <string name="downloader_near_me_subtitle">Near me</string>
+ <string name="downloader_status_maps">Maps</string>
+ <string name="downloader_download_all_button">Download All</string>
+ <string name="downloader_downloading">Downloading:</string>
+ <string name="downloader_search_results">Found</string>
+ <!-- Disclaimer message -->
+ <string name="routing_disclaimer">Creating routes in MAPS.ME app, please keep in mind the following:\n\n - Suggested routes can be considered as recommendations only.\n - Road conditions, traffic rules and signs have higher priority than navigation advice.\n - The map may be incorrect or outdated, and routes may not be created the best possible way.\n\n Be safe on roads and take care of yourself!</string>
+ <!-- Outdated maps category -->
+ <string name="downloader_outdated_maps">Outdated</string>
+ <!-- Up to date maps category -->
+ <string name="downloader_uptodate_maps">Up-to-date</string>
+ <!-- Status of outdated country in the list -->
+ <string name="downloader_status_outdated">Update</string>
+ <!-- Status of failed country in the list -->
+ <string name="downloader_status_failed">Failed</string>
+ <!-- Displayed in a dialog that appears when a user tries to delete a map while the app is in the follow route mode -->
+ <string name="downloader_delete_map_while_routing_dialog">To delete map please stop navigation.</string>
+ <!-- Show when user try build route, but we don't know where he -->
+ <string name="routing_failed_unknown_my_position">Current location is undefined. Please specify location to create route.</string>
+ <!-- Show if use has not routing file, or InconsistentMWMandRoute -->
+ <string name="routing_failed_has_no_routing_file">Additional data is required to create the route. Download data now?</string>
+ <!-- StartPointNotFound -->
+ <string name="routing_failed_start_point_not_found">Cannot calculate the route. No roads near your starting point.</string>
+ <!-- EndPointNotFound -->
+ <string name="routing_failed_dst_point_not_found">Cannot calculate the route. No roads near your destination.</string>
+ <!-- PointsInDifferentMWM -->
+ <string name="routing_failed_cross_mwm_building">Routes can only be created that are fully contained within a single map.</string>
+ <!-- RouteNotFound -->
+ <string name="routing_failed_route_not_found">There is no route found between the selected origin and destination. Please select a different start or end point.</string>
+ <!-- InternalError -->
+ <string name="routing_failed_internal_error">Internal error occurred. Please try to delete and download the map again. If problem persist please contact us at support@maps.me.</string>
+ <!-- Context menu item for downloader. -->
+ <string name="downloader_download_map_and_routing">Download Map + Routing</string>
+ <!-- Context menu item for downloader. -->
+ <string name="downloader_download_routing">Download Routing</string>
+ <!-- Context menu item for downloader. -->
+ <string name="downloader_delete_routing">Delete Routing</string>
+ <!-- Context menu item for downloader. -->
+ <string name="downloader_download_map">Download map</string>
+ <string name="downloader_download_map_no_routing">Download map without routing</string>
+ <!-- Button for routing. -->
+ <string name="routing_go">Go!</string>
+ <!-- Item status in downloader. -->
+ <string name="downloader_retry">Retry</string>
+ <!-- Item in context menu. -->
+ <string name="downloader_map_and_routing">Map + Routing</string>
+ <!-- Item in context menu. -->
+ <string name="downloader_delete_map">Delete Map</string>
+ <!-- Item in context menu. -->
+ <string name="downloader_update_map">Update Map</string>
+ <!-- Item in context menu. -->
+ <string name="downloader_update_map_and_routing">Update Map + Routing</string>
+ <!-- Item in context menu. -->
+ <string name="downloader_map_only">Map Only</string>
+ <!-- Toolbar title -->
+ <string name="toolbar_application_menu">Application menu</string>
+ <!-- Preference text -->
+ <string name="pref_use_google_play">Use Google Play Services to get your current location</string>
+ <!-- Text for rating dialog -->
+ <string name="rating_just_rated">I’ve just rated your app</string>
+ <!-- Text for rating dialog -->
+ <string name="rating_user_since">I’ve been MAPS.ME user since %s</string>
+ <!-- Text for rating dialog -->
+ <string name="rating_do_like_maps">Do you like MAPS.ME?</string>
+ <!-- Text for rating dialog -->
+ <string name="rating_tap_star">Tap a star to rate our app.</string>
+ <!-- Text for rating dialog -->
+ <string name="rating_thanks">Thank you!</string>
+ <!-- Text for rating dialog -->
+ <string name="rating_share_ideas">Share any ideas or issues so we can improve the app for you.</string>
+ <!-- Text for rating dialog -->
+ <string name="rating_send_feedback">Send feedback</string>
+ <!-- Text for g+ dialog -->
+ <string name="rating_google_plus">Click g+ to tell your friends about the app.</string>
+ <!-- Text for routing error dialog -->
+ <string name="routing_download_maps_along">Download maps along route</string>
+ <!-- Text for routing error dialog -->
+ <string name="routing_download_map">Get map</string>
+ <!-- Text for routing error dialog -->
+ <string name="routing_download_map_and_routing">Download updated map and routing data to get all MAPS.ME features.</string>
+ <!-- Text for routing error dialog -->
+ <string name="routing_get_routing_data">Get routing data</string>
+ <!-- Text for routing error dialog -->
+ <string name="routing_get_additional_data">Additional data required to create routes from your location.</string>
+ <!-- Text for routing error dialog -->
+ <string name="routing_requires_all_map">Creating a route requires all the maps from your location to destination downloaded and updated.</string>
+ <!-- Text for routing error dialog -->
+ <string name="routing_not_enough_space">Not enough space</string>
+ <!-- Text for routing error dialog -->
+ <string name="routing_download_more_than_avail">You need to download %1$s MB, but only %2$s MB are available.</string>
+ <!-- Text for routing error dialog -->
+ <string name="routing_download_roaming">You are going to download %s MB using Mobile Data (in Roaming). This may result in additional charges, depending on your operator mobile data plan.</string>
+ <!-- bookmark button text -->
+ <string name="bookmark">bookmark</string>
+ <!-- map is not downloaded -->
+ <string name="not_found_map">The map for your location is not downloaded</string>
+ <!-- location service disabled -->
+ <string name="enable_location_services">Please enable Location Services</string>
+ <!-- download map -->
+ <string name="download_map">Download the map for your location</string>
+ <!-- download map on iPhone -->
+ <string name="download_map_iphone">Download a current location map on your iPhone</string>
+ <!-- clear pin -->
+ <string name="nearby">Nearby</string>
+ <!-- clear pin -->
+ <string name="clear_pin">Clear Pin</string>
+ <!-- location is undefined -->
+ <string name="undefined_location">Current location is undefined.</string>
+ <!-- download country of your location -->
+ <string name="download_country">Download the country of your current location</string>
+ <!-- download failed -->
+ <string name="download_failed">download has failed</string>
+ <!-- get the map -->
+ <string name="get_the_map">Get the map</string>
+ <string name="save">Save</string>
+ <string name="edit_description_hint">Your descriptions (text or html)</string>
+ <string name="new_group">new group</string>
+ <string name="create">create</string>
+ <!-- red color -->
+ <string name="red">Red</string>
+ <!-- yellow color -->
+ <string name="yellow">Yellow</string>
+ <!-- blue color -->
+ <string name="blue">Blue</string>
+ <!-- green color -->
+ <string name="green">Green</string>
+ <!-- purple color -->
+ <string name="purple">Purple</string>
+ <!-- orange color -->
+ <string name="orange">Orange</string>
+ <!-- brown color -->
+ <string name="brown">Brown</string>
+ <!-- pink color -->
+ <string name="pink">Pink</string>
+ <!-- Wi-Fi available -->
+ <string name="WiFi_available">Yes</string>
- <!-- SECTION: Routing dialogs strings -->
- <string name="dialog_routing_disclaimer_title">When following the route, please keep in mind:</string>
- <string name="dialog_routing_disclaimer_priority">— Road conditions, traffic laws and road signs always take priority over the navigational advice;</string>
- <string name="dialog_routing_disclaimer_precision">— The map might be inaccurate and the suggested route might not always be the most optimal way to reach the destination;</string>
- <string name="dialog_routing_disclaimer_recommendations">— Suggested routes are to be taken only as recommendations;</string>
- <string name="dialog_routing_disclaimer_borders">— Exercise caution with routes in border zones: the routes created by our app may sometimes cross country borders in unauthorized places;</string>
- <string name="dialog_routing_disclaimer_beware">Please stay alert and safe on the roads!</string>
- <string name="dialog_routing_check_gps">Check GPS signal</string>
- <string name="dialog_routing_error_location_not_found">Unable to create route. Current GPS coordinates could not be identified.</string>
- <string name="dialog_routing_location_turn_wifi">Please check your GPS signal. Enabling Wi-Fi will improve your location accuracy.</string>
- <string name="dialog_routing_location_turn_on">Enable location services</string>
- <string name="dialog_routing_location_unknown_turn_on">Unable to locate current GPS coordinates. Enable location services to calculate route.</string>
- <string name="dialog_routing_location_unknown">Unable to locate current GPS coordinates.</string>
- <string name="dialog_routing_download_files">Download required files</string>
- <string name="dialog_routing_download_and_update_all">Download and update all map and routing information along the projected path to calculate route.</string>
- <string name="dialog_routing_routes_size">Routing information files</string>
- <string name="dialog_routing_unable_locate_route">Unable to locate route</string>
- <string name="dialog_routing_cant_build_route">Unable to create route.</string>
- <string name="dialog_routing_change_start_or_end">Please adjust your starting point or your destination.</string>
- <string name="dialog_routing_change_start">Adjust starting point</string>
- <string name="dialog_routing_start_not_determined">Route was not created. Unable to locate starting point.</string>
- <string name="dialog_routing_select_closer_start">Please select a starting point closer to a road.</string>
- <string name="dialog_routing_change_end">Adjust destination</string>
- <string name="dialog_routing_end_not_determined">Route was not created. Unable to locate the destination.</string>
- <string name="dialog_routing_select_closer_end">Please select a destination point located closer to a road.</string>
- <string name="dialog_routing_system_error">System error</string>
- <string name="dialog_routing_application_error">Unable to create route due to an application error.</string>
- <string name="dialog_routing_try_again">Please try again</string>
- <string name="dialog_routing_send_error">Report the Problem</string>
- <string name="dialog_routing_if_get_cross_route">Would you like to create a more direct route that spans more than one map?</string>
- <string name="dialog_routing_cross_route_is_optimal">A more optimal route that crosses the edge of this map is available.</string>
- <string name="not_now">Not Now</string>
- <string name="dialog_routing_build_route">Create</string>
- <string name="dialog_routing_download_and_build_cross_route">Would you like to download the map and create a more optimal route spanning more than one map?</string>
- <string name="dialog_routing_download_cross_route">Download the map to create a more optimal route that crosses the edge of this map.</string>
- <string name="dialog_routing_cross_route_always">Always cross this boundary</string>
+ <!-- SECTION: Routing dialogs strings -->
+ <string name="dialog_routing_disclaimer_title">When following the route, please keep in mind:</string>
+ <string name="dialog_routing_disclaimer_priority">— Road conditions, traffic laws and road signs always take priority over the navigational advice;</string>
+ <string name="dialog_routing_disclaimer_precision">— The map might be inaccurate and the suggested route might not always be the most optimal way to reach the destination;</string>
+ <string name="dialog_routing_disclaimer_recommendations">— Suggested routes are to be taken only as recommendations;</string>
+ <string name="dialog_routing_disclaimer_borders">— Exercise caution with routes in border zones: the routes created by our app may sometimes cross country borders in unauthorized places;</string>
+ <string name="dialog_routing_disclaimer_beware">Please stay alert and safe on the roads!</string>
+ <string name="dialog_routing_check_gps">Check GPS signal</string>
+ <string name="dialog_routing_error_location_not_found">Unable to create route. Current GPS coordinates could not be identified.</string>
+ <string name="dialog_routing_location_turn_wifi">Please check your GPS signal. Enabling Wi-Fi will improve your location accuracy.</string>
+ <string name="dialog_routing_location_turn_on">Enable location services</string>
+ <string name="dialog_routing_location_unknown_turn_on">Unable to locate current GPS coordinates. Enable location services to calculate route.</string>
+ <string name="dialog_routing_location_unknown">Unable to locate current GPS coordinates.</string>
+ <string name="dialog_routing_download_files">Download required files</string>
+ <string name="dialog_routing_download_and_update_all">Download and update all map and routing information along the projected path to calculate route.</string>
+ <string name="dialog_routing_routes_size">Routing information files</string>
+ <string name="dialog_routing_unable_locate_route">Unable to locate route</string>
+ <string name="dialog_routing_cant_build_route">Unable to create route.</string>
+ <string name="dialog_routing_change_start_or_end">Please adjust your starting point or your destination.</string>
+ <string name="dialog_routing_change_start">Adjust starting point</string>
+ <string name="dialog_routing_start_not_determined">Route was not created. Unable to locate starting point.</string>
+ <string name="dialog_routing_select_closer_start">Please select a starting point closer to a road.</string>
+ <string name="dialog_routing_change_end">Adjust destination</string>
+ <string name="dialog_routing_end_not_determined">Route was not created. Unable to locate the destination.</string>
+ <string name="dialog_routing_select_closer_end">Please select a destination point located closer to a road.</string>
+ <string name="dialog_routing_system_error">System error</string>
+ <string name="dialog_routing_application_error">Unable to create route due to an application error.</string>
+ <string name="dialog_routing_try_again">Please try again</string>
+ <string name="dialog_routing_send_error">Report the Problem</string>
+ <string name="dialog_routing_if_get_cross_route">Would you like to create a more direct route that spans more than one map?</string>
+ <string name="dialog_routing_cross_route_is_optimal">A more optimal route that crosses the edge of this map is available.</string>
+ <string name="not_now">Not Now</string>
+ <string name="dialog_routing_build_route">Create</string>
+ <string name="dialog_routing_download_and_build_cross_route">Would you like to download the map and create a more optimal route spanning more than one map?</string>
+ <string name="dialog_routing_download_cross_route">Download the map to create a more optimal route that crosses the edge of this map.</string>
+ <string name="dialog_routing_cross_route_always">Always cross this boundary</string>
<!-- SECTION: Strings for downloading map from search -->
<string name="search_without_internet_advertisement">To start searching and creating routes, please download the map, and you will not need Internet connection anymore.</string>
diff --git a/android/res/values/styles-place_page.xml b/android/res/values/styles-place_page.xml
index 013abc689f..6feb7dc81a 100644
--- a/android/res/values/styles-place_page.xml
+++ b/android/res/values/styles-place_page.xml
@@ -83,4 +83,4 @@
<item name="android:layout_marginEnd" tools:targetApi="jelly_bean_mr1">@dimen/margin_base</item>
<item name="android:layout_marginRight">@dimen/margin_base</item>
</style>
-</resources> \ No newline at end of file
+</resources>
diff --git a/android/res/values/styles-text.xml b/android/res/values/styles-text.xml
index 1f9607f975..dc016d2b54 100644
--- a/android/res/values/styles-text.xml
+++ b/android/res/values/styles-text.xml
@@ -121,6 +121,10 @@
<item name="android:textStyle">bold</item>
</style>
+ <style name="MwmTextAppearance.RoutingDimension.Inline" parent="MwmTextAppearance.RoutingNumber">
+ <item name="android:textSize">@dimen/text_size_routing_dimension_inline</item>
+ </style>
+
<style name="MwmTextAppearance.RoutingDetail">
<item name="android:textSize">@dimen/text_size_routing_plan_detail</item>
<item name="android:fontFamily" tools:ignore="NewApi">@string/robotoMedium</item>
@@ -148,15 +152,13 @@
<item name="android:textSize">@dimen/text_size_nav_circle_exit</item>
</style>
- <style name="MwmTextAppearance.PlacePage"
- parent="MwmTextAppearance.Body1"/>
+ <style name="MwmTextAppearance.PlacePage" parent="MwmTextAppearance.Body1"/>
<style name="MwmTextAppearance.PlacePage.Accent">
<item name="android:textColor">?colorAccent</item>
</style>
- <style name="MwmTextAppearance.PlacePage.Title"
- parent="MwmTextAppearance.Body3"/>
+ <style name="MwmTextAppearance.PlacePage.Title" parent="MwmTextAppearance.Body3"/>
<style name="MwmTextAppearance.Editor">
</style>
@@ -169,4 +171,4 @@
<style name="MwmTextAppearance.Editor.Buttons">
<item name="android:textSize">@dimen/text_size_body_3</item>
</style>
-</resources> \ No newline at end of file
+</resources>
diff --git a/android/res/values/styles.xml b/android/res/values/styles.xml
index d1df9725e6..56c21826f4 100644
--- a/android/res/values/styles.xml
+++ b/android/res/values/styles.xml
@@ -16,8 +16,7 @@
<item name="android:layout_marginLeft">0dp</item>
</style>
- <style name="MwmWidget.MapButton"
- parent="android:Widget.ImageButton">
+ <style name="MwmWidget.MapButton" parent="android:Widget.ImageButton">
<item name="android:scaleType">center</item>
<item name="android:layout_height">64dp</item>
<item name="android:layout_width">64dp</item>
@@ -53,66 +52,44 @@
</style>
<style name="MwmWidget.Floating">
- <item name="android:elevation"
- tools:ignore="NewApi">@dimen/appbar_elevation
- </item>
+ <item name="android:elevation" tools:ignore="NewApi">@dimen/appbar_elevation</item>
</style>
<style name="MwmWidget.Floating.Panel">
<item name="android:background">?panel</item>
</style>
- <style
- name="MwmWidget.PlacePage.EditText"
- parent="Widget.AppCompat.EditText">
+ <style name="MwmWidget.PlacePage.EditText" parent="Widget.AppCompat.EditText">
<item name="android:imeOptions">actionDone</item>
<item name="android:textAppearance">@style/MwmTextAppearance.PlacePage</item>
<item name="android:textColorHint">?secondary</item>
<item name="android:textCursorDrawable">@null</item>
- <item name="android:fontFamily"
- tools:ignore="NewApi">@string/robotoRegular
- </item>
+ <item name="android:fontFamily" tools:ignore="NewApi">@string/robotoRegular</item>
</style>
- <style
- name="MwmWidget.ToolbarStyle"
- parent="ThemeOverlay.AppCompat.Dark.ActionBar">
+ <style name="MwmWidget.ToolbarStyle" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:background">?colorPrimary</item>
- <item name="android:elevation"
- tools:ignore="NewApi">@dimen/appbar_elevation
- </item>
+ <item name="android:elevation" tools:ignore="NewApi">@dimen/appbar_elevation</item>
<item name="android:displayOptions">homeAsUp|showTitle</item>
<item name="contentInsetStart">72dp</item>
- <item name="android:titleTextAppearance"
- tools:ignore="NewApi">@style/MwmTextAppearance.Toolbar.Title
- </item>
+ <item name="android:titleTextAppearance" tools:ignore="NewApi">@style/MwmTextAppearance.Toolbar.Title</item>
<item name="titleTextAppearance">@style/MwmTextAppearance.Toolbar.Title</item>
<item name="contentInsetLeft">72dp</item>
- <item name="android:contentInsetStart"
- tools:ignore="NewApi">72dp
- </item>
- <item name="android:contentInsetLeft"
- tools:ignore="NewApi">72dp
- </item>
+ <item name="android:contentInsetStart" tools:ignore="NewApi">72dp</item>
+ <item name="android:contentInsetLeft" tools:ignore="NewApi">72dp</item>
</style>
<style name="MwmWidget.ToolbarStyle.Light">
- <item name="android:titleTextAppearance"
- tools:targetApi="lollipop">@style/MwmTextAppearance.Toolbar.Title.Light
- </item>
+ <item name="android:titleTextAppearance" tools:targetApi="lollipop">@style/MwmTextAppearance.Toolbar.Title.Light</item>
<item name="titleTextAppearance">@style/MwmTextAppearance.Toolbar.Title.Light</item>
</style>
- <style
- name="MwmWidget.ToolbarTheme"
- parent="ThemeOverlay.AppCompat.Dark.ActionBar">
+ <style name="MwmWidget.ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:gravity">center_vertical</item>
<item name="colorAccent">@android:color/white</item>
</style>
- <style
- name="MwmWidget.ToolbarTheme.Light"
- parent="ThemeOverlay.AppCompat.ActionBar">
+ <style name="MwmWidget.ToolbarTheme.Light" parent="ThemeOverlay.AppCompat.ActionBar">
<item name="android:gravity">center_vertical</item>
<item name="colorAccent">@color/bg_window_night</item>
</style>
@@ -124,9 +101,7 @@
<item name="windowActionBarOverlay">true</item>
</style>
- <style
- name="MwmWidget.ListView"
- parent="Widget.AppCompat.ListView">
+ <style name="MwmWidget.ListView" parent="Widget.AppCompat.ListView">
<item name="android:fadingEdge">none</item>
<item name="android:divider">@color/divider</item>
<item name="android:background">@null</item>
@@ -136,8 +111,7 @@
<item name="android:cacheColorHint">@android:color/transparent</item>
</style>
- <style name="MwmWidget.TextView"
- parent="android:Widget.TextView">
+ <style name="MwmWidget.TextView" parent="android:Widget.TextView">
<item name="android:background">@android:color/transparent</item>
</style>
@@ -210,8 +184,7 @@
<item name="android:foreground">@drawable/shadow_top</item>
</style>
- <style name="MwmWidget.RatingBar"
- parent="android:Widget.RatingBar">
+ <style name="MwmWidget.RatingBar" parent="android:Widget.RatingBar">
<item name="android:progressDrawable">@drawable/rating_bar</item>
<item name="android:indeterminateDrawable">@drawable/rating_bar</item>
</style>
@@ -247,9 +220,7 @@
<item name="android:textAppearance">@style/MwmTextAppearance.Toolbar.Title.Button</item>
</style>
- <style
- name="MwmWidget.SearchNavigationButton"
- parent="android:Widget.ImageButton">
+ <style name="MwmWidget.SearchNavigationButton" parent="android:Widget.ImageButton">
<item name="android:scaleType">center</item>
<item name="android:layout_height">44dp</item>
<item name="android:layout_width">44dp</item>
diff --git a/android/res/values/themes.xml b/android/res/values/themes.xml
index 570090f841..25c60b246b 100644
--- a/android/res/values/themes.xml
+++ b/android/res/values/themes.xml
@@ -173,4 +173,4 @@
<item name="android:windowActionBarOverlay">true</item>
</style>
-</resources> \ No newline at end of file
+</resources>
diff --git a/android/src/com/mapswithme/maps/base/BaseMwmExtraTitleActivity.java b/android/src/com/mapswithme/maps/base/BaseMwmExtraTitleActivity.java
new file mode 100644
index 0000000000..13b2fbbfb1
--- /dev/null
+++ b/android/src/com/mapswithme/maps/base/BaseMwmExtraTitleActivity.java
@@ -0,0 +1,43 @@
+package com.mapswithme.maps.base;
+
+import android.os.Bundle;
+import android.support.annotation.CallSuper;
+import android.support.v7.widget.Toolbar;
+
+import com.mapswithme.maps.R;
+import com.mapswithme.util.UiUtils;
+
+public class BaseMwmExtraTitleActivity extends BaseMwmFragmentActivity
+{
+ protected static final String EXTRA_TITLE = "activity_title";
+
+ @Override
+ @CallSuper
+ protected void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+
+ String title = "";
+ Bundle bundle = getIntent().getExtras();
+ if (bundle != null)
+ {
+ title = bundle.getString(EXTRA_TITLE);
+ }
+ Toolbar toolbar = getToolbar();
+ toolbar.setTitle(title);
+ UiUtils.showHomeUpButton(toolbar);
+ displayToolbarAsActionBar();
+ }
+
+ @Override
+ protected int getContentLayoutResId()
+ {
+ return R.layout.activity_fragment_and_toolbar;
+ }
+
+ @Override
+ protected int getFragmentContentResId()
+ {
+ return R.id.fragment_container;
+ }
+}
diff --git a/android/src/com/mapswithme/maps/gallery/FullScreenGalleryActivity.java b/android/src/com/mapswithme/maps/gallery/FullScreenGalleryActivity.java
index 592ba34c10..bfba3eb345 100644
--- a/android/src/com/mapswithme/maps/gallery/FullScreenGalleryActivity.java
+++ b/android/src/com/mapswithme/maps/gallery/FullScreenGalleryActivity.java
@@ -1,17 +1,11 @@
package com.mapswithme.maps.gallery;
-import com.bumptech.glide.Glide;
-import com.bumptech.glide.request.target.BitmapImageViewTarget;
-import com.mapswithme.maps.R;
-import com.mapswithme.maps.base.BaseMwmFragmentActivity;
-import com.mapswithme.util.ThemeUtils;
-import com.mapswithme.util.UiUtils;
-
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
+import android.support.annotation.NonNull;
import android.support.v4.graphics.drawable.RoundedBitmapDrawable;
import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory;
import android.support.v4.view.ViewPager;
@@ -24,12 +18,20 @@ import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.request.target.BitmapImageViewTarget;
+import com.mapswithme.maps.R;
+import com.mapswithme.maps.base.BaseMwmFragmentActivity;
+import com.mapswithme.util.ThemeUtils;
+import com.mapswithme.util.UiUtils;
+
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class FullScreenGalleryActivity extends BaseMwmFragmentActivity
- implements ViewPager.OnPageChangeListener {
+ implements ViewPager.OnPageChangeListener
+{
public static final String EXTRA_IMAGES = "gallery_images";
public static final String EXTRA_POSITION = "gallery_position";
@@ -53,7 +55,8 @@ public class FullScreenGalleryActivity extends BaseMwmFragmentActivity
}
@Override
- protected void onCreate(Bundle savedInstanceState) {
+ protected void onCreate(Bundle savedInstanceState)
+ {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
@@ -62,9 +65,8 @@ public class FullScreenGalleryActivity extends BaseMwmFragmentActivity
toolbar.setTitle("");
UiUtils.showHomeUpButton(toolbar);
displayToolbarAsActionBar();
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- }
mUserBlock = findViewById(R.id.rl__user_block);
mDescription = (TextView) findViewById(R.id.tv__description);
@@ -74,19 +76,22 @@ public class FullScreenGalleryActivity extends BaseMwmFragmentActivity
mAvatar = (ImageView) findViewById(R.id.iv__avatar);
readParameters();
- mGalleryPageAdapter = new GalleryPageAdapter(getSupportFragmentManager(), mImages);
- final ViewPager viewPager = (ViewPager) findViewById(R.id.vp__image);
- viewPager.addOnPageChangeListener(this);
- viewPager.setAdapter(mGalleryPageAdapter);
- viewPager.setCurrentItem(mPosition);
- viewPager.post(new Runnable()
+ if (mImages != null)
{
- @Override
- public void run()
+ mGalleryPageAdapter = new GalleryPageAdapter(getSupportFragmentManager(), mImages);
+ final ViewPager viewPager = (ViewPager) findViewById(R.id.vp__image);
+ viewPager.addOnPageChangeListener(this);
+ viewPager.setAdapter(mGalleryPageAdapter);
+ viewPager.setCurrentItem(mPosition);
+ viewPager.post(new Runnable()
{
- onPageSelected(viewPager.getCurrentItem());
- }
- });
+ @Override
+ public void run()
+ {
+ onPageSelected(viewPager.getCurrentItem());
+ }
+ });
+ }
}
@Override
@@ -101,71 +106,93 @@ public class FullScreenGalleryActivity extends BaseMwmFragmentActivity
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
}
-
@Override
- protected int getContentLayoutResId() {
- return R.layout.activity_viewpager_transparent_toolbar;
+ protected int getContentLayoutResId()
+ {
+ return R.layout.activity_full_screen_gallery;
}
@Override
- public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
-
+ public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
+ {
}
@Override
- public void onPageSelected(int position) {
+ public void onPageSelected(int position)
+ {
updateInformation(mGalleryPageAdapter.getImage(position));
}
@Override
- public void onPageScrollStateChanged(int state) {
-
+ public void onPageScrollStateChanged(int state)
+ {
}
- private void readParameters() {
+ private void readParameters()
+ {
Bundle extras = getIntent().getExtras();
- if (extras != null) {
+ if (extras != null)
+ {
mImages = extras.getParcelableArrayList(EXTRA_IMAGES);
mPosition = extras.getInt(EXTRA_POSITION);
}
}
- private void updateInformation(Image image) {
+ private void updateInformation(@NonNull Image image)
+ {
UiUtils.setTextAndHideIfEmpty(mDescription, image.getDescription());
UiUtils.setTextAndHideIfEmpty(mUserName, image.getUserName());
UiUtils.setTextAndHideIfEmpty(mSource, image.getSource());
- if (image.getDate() != null) {
+ updateDate(image);
+ updateUserAvatar(image);
+ updateUserBlock();
+ }
+
+ private void updateDate(Image image)
+ {
+ if (image.getDate() != null)
+ {
Date date = new Date(image.getDate());
mDate.setText(DateFormat.getMediumDateFormat(this).format(date));
UiUtils.show(mDate);
- } else {
- UiUtils.hide(mDate);
}
- if (!TextUtils.isEmpty(image.getUserAvatar())) {
+ else
+ UiUtils.hide(mDate);
+ }
+
+ private void updateUserAvatar(Image image)
+ {
+ if (!TextUtils.isEmpty(image.getUserAvatar()))
+ {
UiUtils.show(mAvatar);
Glide.with(this)
- .load(image.getUserAvatar())
- .asBitmap()
- .centerCrop()
- .into(new BitmapImageViewTarget(mAvatar) {
- @Override
- protected void setResource(Bitmap resource) {
- RoundedBitmapDrawable circularBitmapDrawable =
- RoundedBitmapDrawableFactory.create(getResources(), resource);
- circularBitmapDrawable.setCircular(true);
- mAvatar.setImageDrawable(circularBitmapDrawable);
- }
- });
- } else {
- UiUtils.hide(mAvatar);
+ .load(image.getUserAvatar())
+ .asBitmap()
+ .centerCrop()
+ .into(new BitmapImageViewTarget(mAvatar)
+ {
+ @Override
+ protected void setResource(Bitmap resource)
+ {
+ RoundedBitmapDrawable circularBitmapDrawable =
+ RoundedBitmapDrawableFactory.create(getResources(), resource);
+ circularBitmapDrawable.setCircular(true);
+ mAvatar.setImageDrawable(circularBitmapDrawable);
+ }
+ });
}
+ else
+ UiUtils.hide(mAvatar);
+ }
+
+ private void updateUserBlock()
+ {
if (UiUtils.isHidden(mUserName)
- && UiUtils.isHidden(mSource)
- && UiUtils.isHidden(mDate)
- && UiUtils.isHidden(mAvatar)) {
+ && UiUtils.isHidden(mSource)
+ && UiUtils.isHidden(mDate)
+ && UiUtils.isHidden(mAvatar))
UiUtils.hide(mUserBlock);
- } else {
+ else
UiUtils.show(mUserBlock);
- }
}
}
diff --git a/android/src/com/mapswithme/maps/gallery/FullScreenGalleryFragment.java b/android/src/com/mapswithme/maps/gallery/FullScreenGalleryFragment.java
index 15c2a3b8b3..465ff4f515 100644
--- a/android/src/com/mapswithme/maps/gallery/FullScreenGalleryFragment.java
+++ b/android/src/com/mapswithme/maps/gallery/FullScreenGalleryFragment.java
@@ -1,9 +1,5 @@
package com.mapswithme.maps.gallery;
-import com.bumptech.glide.Glide;
-import com.mapswithme.maps.R;
-import com.mapswithme.maps.base.BaseMwmFragment;
-
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
@@ -11,35 +7,44 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
-public class FullScreenGalleryFragment extends BaseMwmFragment {
+import com.bumptech.glide.Glide;
+import com.mapswithme.maps.R;
+import com.mapswithme.maps.base.BaseMwmFragment;
+
+public class FullScreenGalleryFragment extends BaseMwmFragment
+{
static final String ARGUMENT_IMAGE = "argument_image";
+ @Nullable
private Image mImage;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
- @Nullable Bundle savedInstanceState) {
+ @Nullable Bundle savedInstanceState)
+ {
return inflater.inflate(R.layout.fragment_fullscreen_image, container, false);
}
@Override
- public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
+ {
super.onViewCreated(view, savedInstanceState);
readArguments();
- if (mImage != null) {
+ if (mImage != null)
+ {
ImageView imageView = (ImageView) view.findViewById(R.id.iv__image);
Glide.with(view.getContext())
- .load(mImage.getUrl())
- .into(imageView);
+ .load(mImage.getUrl())
+ .into(imageView);
}
}
- private void readArguments() {
+ private void readArguments()
+ {
Bundle args = getArguments();
- if (args != null) {
+ if (args != null)
mImage = args.getParcelable(ARGUMENT_IMAGE);
- }
}
}
diff --git a/android/src/com/mapswithme/maps/gallery/GalleryActivity.java b/android/src/com/mapswithme/maps/gallery/GalleryActivity.java
index 27c19cbdcc..bd9b7b6805 100644
--- a/android/src/com/mapswithme/maps/gallery/GalleryActivity.java
+++ b/android/src/com/mapswithme/maps/gallery/GalleryActivity.java
@@ -1,22 +1,19 @@
package com.mapswithme.maps.gallery;
-import com.mapswithme.maps.R;
-import com.mapswithme.maps.base.BaseMwmFragmentActivity;
-import com.mapswithme.util.UiUtils;
-
import android.content.Context;
import android.content.Intent;
-import android.os.Bundle;
+import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
-import android.support.v7.widget.Toolbar;
+
+import com.mapswithme.maps.base.BaseMwmExtraTitleActivity;
import java.util.ArrayList;
-public class GalleryActivity extends BaseMwmFragmentActivity {
+public class GalleryActivity extends BaseMwmExtraTitleActivity
+{
public static final String EXTRA_IMAGES = "gallery_images";
- public static final String EXTRA_TITLE = "gallery_title";
- public static void start(Context context, ArrayList<Image> images, String title)
+ public static void start(Context context, @NonNull ArrayList<Image> images, @NonNull String title)
{
final Intent i = new Intent(context, GalleryActivity.class);
i.putParcelableArrayListExtra(EXTRA_IMAGES, images);
@@ -25,32 +22,8 @@ public class GalleryActivity extends BaseMwmFragmentActivity {
}
@Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- String title = "";
- Bundle bundle = getIntent().getExtras();
- if (bundle != null) {
- title = bundle.getString(EXTRA_TITLE);
- }
- Toolbar toolbar = getToolbar();
- toolbar.setTitle(title);
- UiUtils.showHomeUpButton(toolbar);
- displayToolbarAsActionBar();
- }
-
- @Override
- protected Class<? extends Fragment> getFragmentClass() {
+ protected Class<? extends Fragment> getFragmentClass()
+ {
return GalleryFragment.class;
}
-
- @Override
- protected int getContentLayoutResId() {
- return R.layout.activity_fragment_and_toolbar;
- }
-
- @Override
- protected int getFragmentContentResId() {
- return R.id.fragment_container;
- }
}
diff --git a/android/src/com/mapswithme/maps/gallery/GalleryFragment.java b/android/src/com/mapswithme/maps/gallery/GalleryFragment.java
index 9be54ce3dc..c1c02c8f5d 100644
--- a/android/src/com/mapswithme/maps/gallery/GalleryFragment.java
+++ b/android/src/com/mapswithme/maps/gallery/GalleryFragment.java
@@ -1,10 +1,5 @@
package com.mapswithme.maps.gallery;
-import com.mapswithme.maps.R;
-import com.mapswithme.maps.base.BaseMwmFragment;
-import com.mapswithme.maps.widget.recycler.GridDividerItemDecoration;
-import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
-
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
@@ -15,29 +10,42 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import com.mapswithme.maps.R;
+import com.mapswithme.maps.base.BaseMwmFragment;
+import com.mapswithme.maps.widget.recycler.GridDividerItemDecoration;
+import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
+
import java.util.ArrayList;
-public class GalleryFragment extends BaseMwmFragment implements RecyclerClickListener {
+public class GalleryFragment extends BaseMwmFragment implements RecyclerClickListener
+{
+ private static final int NUM_COLUMNS = 3;
+ @Nullable
private ArrayList<Image> mImages;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
- @Nullable Bundle savedInstanceState) {
+ @Nullable Bundle savedInstanceState)
+ {
return inflater.inflate(R.layout.fragment_gallery, container, false);
}
@Override
- public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
+ {
super.onViewCreated(view, savedInstanceState);
readArguments();
- RecyclerView rvGallery = (RecyclerView) view.findViewById(R.id.rv__gallery);
- rvGallery.setLayoutManager(new GridLayoutManager(getContext(), 3));
- rvGallery.setAdapter(new ImageAdapter(mImages, this));
- Drawable divider = ContextCompat.getDrawable(getContext(), R.drawable.divider_transparent);
- rvGallery.addItemDecoration(new GridDividerItemDecoration(divider, divider, 3));
+ if (mImages != null)
+ {
+ RecyclerView rvGallery = (RecyclerView) view.findViewById(R.id.rv__gallery);
+ rvGallery.setLayoutManager(new GridLayoutManager(getContext(), NUM_COLUMNS));
+ rvGallery.setAdapter(new ImageAdapter(mImages, this));
+ Drawable divider = ContextCompat.getDrawable(getContext(), R.drawable.divider_transparent);
+ rvGallery.addItemDecoration(new GridDividerItemDecoration(divider, divider, NUM_COLUMNS));
+ }
}
private void readArguments()
@@ -50,7 +58,8 @@ public class GalleryFragment extends BaseMwmFragment implements RecyclerClickLis
}
@Override
- public void onItemClick(View v, int position) {
+ public void onItemClick(View v, int position)
+ {
FullScreenGalleryActivity.start(getContext(), mImages, position);
}
}
diff --git a/android/src/com/mapswithme/maps/gallery/GalleryPageAdapter.java b/android/src/com/mapswithme/maps/gallery/GalleryPageAdapter.java
index 12ed1a1120..14724038d5 100644
--- a/android/src/com/mapswithme/maps/gallery/GalleryPageAdapter.java
+++ b/android/src/com/mapswithme/maps/gallery/GalleryPageAdapter.java
@@ -1,23 +1,28 @@
package com.mapswithme.maps.gallery;
import android.os.Bundle;
+import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import java.util.List;
-class GalleryPageAdapter extends FragmentStatePagerAdapter {
+class GalleryPageAdapter extends FragmentStatePagerAdapter
+{
+ @NonNull
private final List<Image> mImages;
- GalleryPageAdapter(FragmentManager fm, List<Image> images) {
+ GalleryPageAdapter(@NonNull FragmentManager fm, @NonNull List<Image> images)
+ {
super(fm);
mImages = images;
}
@Override
- public Fragment getItem(int position) {
+ public Fragment getItem(int position)
+ {
Bundle args = new Bundle();
args.putParcelable(FullScreenGalleryFragment.ARGUMENT_IMAGE, mImages.get(position));
FullScreenGalleryFragment fragment = new FullScreenGalleryFragment();
@@ -26,11 +31,14 @@ class GalleryPageAdapter extends FragmentStatePagerAdapter {
}
@Override
- public int getCount() {
+ public int getCount()
+ {
return mImages.size();
}
- Image getImage(int position) {
+ @NonNull
+ Image getImage(int position)
+ {
return mImages.get(position);
}
}
diff --git a/android/src/com/mapswithme/maps/gallery/Image.java b/android/src/com/mapswithme/maps/gallery/Image.java
index 38c67d321f..8812814779 100644
--- a/android/src/com/mapswithme/maps/gallery/Image.java
+++ b/android/src/com/mapswithme/maps/gallery/Image.java
@@ -2,107 +2,143 @@ package com.mapswithme.maps.gallery;
import android.os.Parcel;
import android.os.Parcelable;
-
-public class Image implements Parcelable {
- private final String url;
- private final String smallUrl;
- private String description;
- private String userName;
- private String userAvatar;
- private String source;
- private Long date;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+
+public class Image implements Parcelable
+{
+ @NonNull
+ private final String mUrl;
+ @NonNull
+ private final String mSmallUrl;
+ @Nullable
+ private String mDescription;
+ @Nullable
+ private String mUserName;
+ @Nullable
+ private String mUserAvatar;
+ @Nullable
+ private String mSource;
+ @Nullable
+ private Long mDate;
@SuppressWarnings("unused")
- public Image(String url, String smallUrl) {
- this.url = url;
- this.smallUrl = smallUrl;
+ public Image(@NonNull String url, @NonNull String smallUrl)
+ {
+ this.mUrl = url;
+ this.mSmallUrl = smallUrl;
}
- protected Image(Parcel in) {
- url = in.readString();
- smallUrl = in.readString();
- description = in.readString();
- userName = in.readString();
- userAvatar = in.readString();
- source = in.readString();
- date = (Long) in.readValue(Long.class.getClassLoader());
+ protected Image(Parcel in)
+ {
+ mUrl = in.readString();
+ mSmallUrl = in.readString();
+ mDescription = in.readString();
+ mUserName = in.readString();
+ mUserAvatar = in.readString();
+ mSource = in.readString();
+ mDate = (Long) in.readValue(Long.class.getClassLoader());
}
@Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(url);
- dest.writeString(smallUrl);
- dest.writeString(description);
- dest.writeString(userName);
- dest.writeString(userAvatar);
- dest.writeString(source);
- dest.writeValue(date);
+ public void writeToParcel(Parcel dest, int flags)
+ {
+ dest.writeString(mUrl);
+ dest.writeString(mSmallUrl);
+ dest.writeString(mDescription);
+ dest.writeString(mUserName);
+ dest.writeString(mUserAvatar);
+ dest.writeString(mSource);
+ dest.writeValue(mDate);
}
@Override
- public int describeContents() {
+ public int describeContents()
+ {
return 0;
}
- public static final Creator<Image> CREATOR = new Creator<Image>() {
+ public static final Creator<Image> CREATOR = new Creator<Image>()
+ {
@Override
- public Image createFromParcel(Parcel in) {
+ public Image createFromParcel(Parcel in)
+ {
return new Image(in);
}
@Override
- public Image[] newArray(int size) {
+ public Image[] newArray(int size)
+ {
return new Image[size];
}
};
- public String getUrl() {
- return url;
+ @NonNull
+ public String getUrl()
+ {
+ return mUrl;
}
- public String getSmallUrl() {
- return smallUrl;
+ @NonNull
+ public String getSmallUrl()
+ {
+ return mSmallUrl;
}
- public String getDescription() {
- return description;
+ @Nullable
+ public String getDescription()
+ {
+ return mDescription;
}
- public void setDescription(String description) {
- this.description = description;
+ public void setDescription(@Nullable String description)
+ {
+ this.mDescription = description;
}
- String getUserName() {
- return userName;
+ @Nullable
+ String getUserName()
+ {
+ return mUserName;
}
@SuppressWarnings("unused")
- public void setUserName(String userName) {
- this.userName = userName;
+ public void setUserName(@Nullable String userName)
+ {
+ this.mUserName = userName;
}
- String getUserAvatar() {
- return userAvatar;
+ @Nullable
+ String getUserAvatar()
+ {
+ return mUserAvatar;
}
@SuppressWarnings("unused")
- public void setUserAvatar(String userAvatar) {
- this.userAvatar = userAvatar;
+ public void setUserAvatar(@Nullable String userAvatar)
+ {
+ this.mUserAvatar = userAvatar;
}
- public String getSource() {
- return source;
+ @Nullable
+ public String getSource()
+ {
+ return mSource;
}
- public void setSource(String source) {
- this.source = source;
+ public void setSource(@Nullable String source)
+ {
+ this.mSource = source;
}
- public Long getDate() {
- return date;
+ @Nullable
+ public Long getDate()
+ {
+ return mDate;
}
- public void setDate(Long date) {
- this.date = date;
+ public void setDate(@Nullable Long date)
+ {
+ this.mDate = date;
}
}
diff --git a/android/src/com/mapswithme/maps/gallery/ImageAdapter.java b/android/src/com/mapswithme/maps/gallery/ImageAdapter.java
index b1b7ab4a34..ff0d977ac8 100644
--- a/android/src/com/mapswithme/maps/gallery/ImageAdapter.java
+++ b/android/src/com/mapswithme/maps/gallery/ImageAdapter.java
@@ -1,51 +1,59 @@
package com.mapswithme.maps.gallery;
-import com.bumptech.glide.Glide;
-import com.mapswithme.maps.R;
-import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
-
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
+import com.bumptech.glide.Glide;
+import com.mapswithme.maps.R;
+import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
+
import java.util.ArrayList;
-class ImageAdapter extends RecyclerView.Adapter<ImageAdapter.ViewHolder> {
+class ImageAdapter extends RecyclerView.Adapter<ImageAdapter.ViewHolder>
+{
+ @NonNull
private final ArrayList<Image> mItems;
+ @Nullable
private final RecyclerClickListener mListener;
- ImageAdapter(ArrayList<Image> images, RecyclerClickListener listener) {
+ ImageAdapter(@NonNull ArrayList<Image> images, @Nullable RecyclerClickListener listener)
+ {
mItems = images;
mListener = listener;
}
@Override
- public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
+ {
return new ViewHolder(LayoutInflater.from(parent.getContext())
- .inflate(R.layout.item_image, parent, false), mListener);
+ .inflate(R.layout.item_image, parent, false), mListener);
}
@Override
- public void onBindViewHolder(ViewHolder holder, int position) {
+ public void onBindViewHolder(ViewHolder holder, int position)
+ {
holder.bind(mItems.get(position), position);
}
@Override
- public int getItemCount() {
- if (mItems == null) {
- return 0;
- }
+ public int getItemCount()
+ {
return mItems.size();
}
- static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
+ static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener
+ {
private ImageView mImage;
private final RecyclerClickListener mListener;
private int mPosition;
- public ViewHolder(View itemView, RecyclerClickListener listener) {
+ public ViewHolder(View itemView, RecyclerClickListener listener)
+ {
super(itemView);
mListener = listener;
itemView.setOnClickListener(this);
@@ -53,18 +61,19 @@ class ImageAdapter extends RecyclerView.Adapter<ImageAdapter.ViewHolder> {
}
@Override
- public void onClick(View v) {
- if (mListener != null) {
+ public void onClick(View v)
+ {
+ if (mListener != null)
mListener.onItemClick(v, mPosition);
- }
}
- public void bind(Image image, int position) {
+ public void bind(Image image, int position)
+ {
mPosition = position;
Glide.with(mImage.getContext())
- .load(image.getSmallUrl())
- .centerCrop()
- .into(mImage);
+ .load(image.getSmallUrl())
+ .centerCrop()
+ .into(mImage);
}
}
}
diff --git a/android/src/com/mapswithme/maps/review/Review.java b/android/src/com/mapswithme/maps/review/Review.java
index f7cb7ae5ab..11b3b22d77 100644
--- a/android/src/com/mapswithme/maps/review/Review.java
+++ b/android/src/com/mapswithme/maps/review/Review.java
@@ -2,26 +2,30 @@ package com.mapswithme.maps.review;
import android.os.Parcel;
import android.os.Parcelable;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
-public class Review implements Parcelable {
+public class Review implements Parcelable
+{
+ @Nullable
private final String mReview;
-
+ @Nullable
private final String mReviewPositive;
-
+ @Nullable
private final String mReviewNegative;
-
+ @NonNull
private final String mAuthor;
-
+ @NonNull
private final String mAuthorAvatar;
-
private final float mRating;
-
private final long mDate;
- public Review(String review, String reviewPositive, String reviewNegative, String author,
- String authorAvatar,
- float rating, long date) {
+ public Review(@Nullable String review, @Nullable String reviewPositive,
+ @Nullable String reviewNegative, @NonNull String author,
+ @NonNull String authorAvatar,
+ float rating, long date)
+ {
mReview = review;
mReviewPositive = reviewPositive;
mReviewNegative = reviewNegative;
@@ -31,7 +35,8 @@ public class Review implements Parcelable {
mDate = date;
}
- protected Review(Parcel in) {
+ protected Review(Parcel in)
+ {
mReview = in.readString();
mReviewPositive = in.readString();
mReviewNegative = in.readString();
@@ -42,7 +47,8 @@ public class Review implements Parcelable {
}
@Override
- public void writeToParcel(Parcel dest, int flags) {
+ public void writeToParcel(Parcel dest, int flags)
+ {
dest.writeString(mReview);
dest.writeString(mReviewPositive);
dest.writeString(mReviewNegative);
@@ -53,48 +59,64 @@ public class Review implements Parcelable {
}
@Override
- public int describeContents() {
+ public int describeContents()
+ {
return 0;
}
- public static final Creator<Review> CREATOR = new Creator<Review>() {
+ public static final Creator<Review> CREATOR = new Creator<Review>()
+ {
@Override
- public Review createFromParcel(Parcel in) {
+ public Review createFromParcel(Parcel in)
+ {
return new Review(in);
}
@Override
- public Review[] newArray(int size) {
+ public Review[] newArray(int size)
+ {
return new Review[size];
}
};
- public String getReview() {
+ @Nullable
+ public String getReview()
+ {
return mReview;
}
- public String getReviewPositive() {
+ @Nullable
+ public String getReviewPositive()
+ {
return mReviewPositive;
}
- public String getReviewNegative() {
+ @Nullable
+ public String getReviewNegative()
+ {
return mReviewNegative;
}
- public String getAuthor() {
+ @NonNull
+ public String getAuthor()
+ {
return mAuthor;
}
@SuppressWarnings("unused")
- public String getAuthorAvatar() {
+ @NonNull
+ public String getAuthorAvatar()
+ {
return mAuthorAvatar;
}
- public float getRating() {
+ public float getRating()
+ {
return mRating;
}
- public long getDate() {
+ public long getDate()
+ {
return mDate;
}
}
diff --git a/android/src/com/mapswithme/maps/review/ReviewActivity.java b/android/src/com/mapswithme/maps/review/ReviewActivity.java
index d0ee0e0517..588580a961 100644
--- a/android/src/com/mapswithme/maps/review/ReviewActivity.java
+++ b/android/src/com/mapswithme/maps/review/ReviewActivity.java
@@ -1,26 +1,24 @@
package com.mapswithme.maps.review;
-import com.mapswithme.maps.R;
-import com.mapswithme.maps.base.BaseMwmFragmentActivity;
-import com.mapswithme.util.UiUtils;
-
import android.content.Context;
import android.content.Intent;
-import android.os.Bundle;
+import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
-import android.support.v7.widget.Toolbar;
+
+import com.mapswithme.maps.base.BaseMwmExtraTitleActivity;
import java.util.ArrayList;
-public class ReviewActivity extends BaseMwmFragmentActivity {
+public class ReviewActivity extends BaseMwmExtraTitleActivity
+{
static final String EXTRA_REVIEWS = "review_items";
- static final String EXTRA_TITLE = "review_title";
static final String EXTRA_RATING = "review_rating";
static final String EXTRA_RATING_BASE = "review_rating_base";
static final String EXTRA_RATING_URL = "review_rating_url";
- public static void start(Context context, ArrayList<Review> items, String title,
- String rating, int ratingBase, String url)
+ public static void start(Context context, @NonNull ArrayList<Review> items,
+ @NonNull String title, @NonNull String rating, int ratingBase,
+ @NonNull String url)
{
final Intent i = new Intent(context, ReviewActivity.class);
i.putParcelableArrayListExtra(EXTRA_REVIEWS, items);
@@ -32,32 +30,8 @@ public class ReviewActivity extends BaseMwmFragmentActivity {
}
@Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- String title = "";
- Bundle bundle = getIntent().getExtras();
- if (bundle != null) {
- title = bundle.getString(EXTRA_TITLE);
- }
- Toolbar toolbar = getToolbar();
- toolbar.setTitle(title);
- UiUtils.showHomeUpButton(toolbar);
- displayToolbarAsActionBar();
- }
-
- @Override
- protected Class<? extends Fragment> getFragmentClass() {
+ protected Class<? extends Fragment> getFragmentClass()
+ {
return ReviewFragment.class;
}
-
- @Override
- protected int getContentLayoutResId() {
- return R.layout.activity_fragment_and_toolbar;
- }
-
- @Override
- protected int getFragmentContentResId() {
- return R.id.fragment_container;
- }
}
diff --git a/android/src/com/mapswithme/maps/review/ReviewAdapter.java b/android/src/com/mapswithme/maps/review/ReviewAdapter.java
index 130b2ea9f5..151c4e3ccd 100644
--- a/android/src/com/mapswithme/maps/review/ReviewAdapter.java
+++ b/android/src/com/mapswithme/maps/review/ReviewAdapter.java
@@ -1,10 +1,8 @@
package com.mapswithme.maps.review;
-import com.mapswithme.maps.R;
-import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
-import com.mapswithme.util.UiUtils;
-
import android.support.annotation.CallSuper;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.text.format.DateFormat;
@@ -13,23 +11,33 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
+import com.mapswithme.maps.R;
+import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
+import com.mapswithme.util.UiUtils;
+
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;
-class ReviewAdapter extends RecyclerView.Adapter<ReviewAdapter.BaseViewHolder> {
+class ReviewAdapter extends RecyclerView.Adapter<ReviewAdapter.BaseViewHolder>
+{
private static final int MAX_COUNT = 15;
private static final int VIEW_TYPE_REVIEW = 0;
private static final int VIEW_TYPE_MORE = 1;
private static final int VIEW_TYPE_RATING = 2;
+ @NonNull
private final ArrayList<Review> mItems;
+ @Nullable
private final RecyclerClickListener mListener;
+ @NonNull
private final String mRating;
private final int mRatingBase;
- ReviewAdapter(ArrayList<Review> images, RecyclerClickListener listener, String rating,
- int ratingBase) {
+ ReviewAdapter(@NonNull ArrayList<Review> images, @Nullable RecyclerClickListener listener,
+ @NonNull String rating,
+ int ratingBase)
+ {
mItems = images;
mListener = listener;
mRating = rating;
@@ -37,82 +45,84 @@ class ReviewAdapter extends RecyclerView.Adapter<ReviewAdapter.BaseViewHolder> {
}
@Override
- public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- if (viewType == VIEW_TYPE_REVIEW) {
+ public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
+ {
+ if (viewType == VIEW_TYPE_REVIEW)
return new ReviewHolder(LayoutInflater.from(parent.getContext())
- .inflate(R.layout.item_comment, parent, false), mListener);
- }
+ .inflate(R.layout.item_comment, parent, false), mListener);
- if (viewType == VIEW_TYPE_MORE) {
+ if (viewType == VIEW_TYPE_MORE)
return new MoreHolder(LayoutInflater.from(parent.getContext())
- .inflate(R.layout.item_more_button, parent, false), mListener);
- }
+ .inflate(R.layout.item_more_button, parent, false), mListener);
return new RatingHolder(LayoutInflater.from(parent.getContext())
- .inflate(R.layout.item_rating, parent, false), mListener);
+ .inflate(R.layout.item_rating, parent, false), mListener);
}
@Override
- public void onBindViewHolder(BaseViewHolder holder, int position) {
+ public void onBindViewHolder(BaseViewHolder holder, int position)
+ {
int positionNoHeader = position - 1;
- if (position == 0) {
- ((RatingHolder)holder).bind(mRating, mRatingBase);
- } else if (positionNoHeader < mItems.size()) {
+ if (position == 0)
+ ((RatingHolder) holder).bind(mRating, mRatingBase);
+ else if (positionNoHeader < mItems.size())
holder.bind(mItems.get(positionNoHeader), positionNoHeader);
- } else {
+ else
holder.bind(null, positionNoHeader);
- }
}
@Override
- public int getItemCount() {
- if (mItems == null) {
- return 1;
- }
- if (mItems.size() > MAX_COUNT) {
+ public int getItemCount()
+ {
+ if (mItems.size() > MAX_COUNT)
+ // 1 overall rating item + MAX_COUNT user reviews + 1 "more reviews" item
return MAX_COUNT + 2;
- }
+
+ // 1 overall rating item + count of user reviews + 1 "more reviews" item
return mItems.size() + 2;
}
@Override
- public int getItemViewType(int position) {
+ public int getItemViewType(int position)
+ {
int positionNoHeader = position - 1;
- if (position == 0) {
+ if (position == 0)
return VIEW_TYPE_RATING;
- }
- if (positionNoHeader == mItems.size()) {
+ if (positionNoHeader == mItems.size())
return VIEW_TYPE_MORE;
- }
return VIEW_TYPE_REVIEW;
}
- static abstract class BaseViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
+ static abstract class BaseViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener
+ {
private final RecyclerClickListener mListener;
private int mPosition;
- BaseViewHolder(View itemView, RecyclerClickListener listener) {
+ BaseViewHolder(View itemView, RecyclerClickListener listener)
+ {
super(itemView);
mListener = listener;
}
@Override
- public void onClick(View v) {
- if (mListener != null) {
+ public void onClick(View v)
+ {
+ if (mListener != null)
mListener.onItemClick(v, mPosition);
- }
}
@CallSuper
- public void bind(Review item, int position) {
+ public void bind(Review item, int position)
+ {
mPosition = position;
}
}
- private static class ReviewHolder extends BaseViewHolder {
+ private static class ReviewHolder extends BaseViewHolder
+ {
final View mDivider;
final TextView mUserName;
final TextView mCommentDate;
@@ -123,7 +133,8 @@ class ReviewAdapter extends RecyclerView.Adapter<ReviewAdapter.BaseViewHolder> {
final View mNegativeReview;
final TextView mTvNegativeReview;
- ReviewHolder(View itemView, RecyclerClickListener listener) {
+ ReviewHolder(View itemView, RecyclerClickListener listener)
+ {
super(itemView, listener);
mDivider = itemView.findViewById(R.id.v__divider);
mUserName = (TextView) itemView.findViewById(R.id.tv__user_name);
@@ -137,56 +148,65 @@ class ReviewAdapter extends RecyclerView.Adapter<ReviewAdapter.BaseViewHolder> {
}
@Override
- public void bind(Review item, int position) {
+ public void bind(Review item, int position)
+ {
super.bind(item, position);
UiUtils.showIf(position > 0, mDivider);
mUserName.setText(item.getAuthor());
Date date = new Date(item.getDate());
mCommentDate.setText(DateFormat.getMediumDateFormat(mCommentDate.getContext()).format(date));
mRating.setText(String.format(Locale.getDefault(), "%.1f", item.getRating()));
- if (TextUtils.isEmpty(item.getReviewPositive())) {
+ if (TextUtils.isEmpty(item.getReviewPositive()))
UiUtils.hide(mPositiveReview);
- } else {
+ else
+ {
UiUtils.show(mPositiveReview);
mTvPositiveReview.setText(item.getReviewPositive());
}
- if (TextUtils.isEmpty(item.getReviewNegative())) {
+ if (TextUtils.isEmpty(item.getReviewNegative()))
UiUtils.hide(mNegativeReview);
- } else {
+ else
+ {
UiUtils.show(mNegativeReview);
mTvNegativeReview.setText(item.getReviewNegative());
}
- if (UiUtils.isHidden(mNegativeReview) && UiUtils.isHidden(mPositiveReview)) {
+ if (UiUtils.isHidden(mNegativeReview) && UiUtils.isHidden(mPositiveReview))
UiUtils.showIf(!TextUtils.isEmpty(item.getReview()), mReview);
- } else {
+ else
+ {
UiUtils.hide(mReview);
}
}
}
- private static class MoreHolder extends BaseViewHolder {
+ private static class MoreHolder extends BaseViewHolder
+ {
- MoreHolder(View itemView, RecyclerClickListener listener) {
+ MoreHolder(View itemView, RecyclerClickListener listener)
+ {
super(itemView, listener);
itemView.setOnClickListener(this);
}
}
- private static class RatingHolder extends BaseViewHolder {
+ private static class RatingHolder extends BaseViewHolder
+ {
final TextView mHotelRating;
final TextView mHotelRatingBase;
- RatingHolder(View itemView, RecyclerClickListener listener) {
+ RatingHolder(View itemView, RecyclerClickListener listener)
+ {
super(itemView, listener);
mHotelRating = (TextView) itemView.findViewById(R.id.tv__place_hotel_rating);
mHotelRatingBase = (TextView) itemView.findViewById(R.id.tv__place_hotel_rating_base);
}
- public void bind(String rating, int ratingBase) {
+ public void bind(String rating, int ratingBase)
+ {
mHotelRating.setText(rating);
mHotelRatingBase.setText(mHotelRatingBase.getContext().getResources()
- .getQuantityString(R.plurals.place_page_booking_rating_base,
- ratingBase, ratingBase));
+ .getQuantityString(R.plurals.place_page_booking_rating_base,
+ ratingBase, ratingBase));
}
}
}
diff --git a/android/src/com/mapswithme/maps/review/ReviewFragment.java b/android/src/com/mapswithme/maps/review/ReviewFragment.java
index 7f5f562054..cfb39156e1 100644
--- a/android/src/com/mapswithme/maps/review/ReviewFragment.java
+++ b/android/src/com/mapswithme/maps/review/ReviewFragment.java
@@ -1,9 +1,5 @@
package com.mapswithme.maps.review;
-import com.mapswithme.maps.R;
-import com.mapswithme.maps.base.BaseMwmFragment;
-import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
-
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
@@ -14,29 +10,42 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import com.mapswithme.maps.R;
+import com.mapswithme.maps.base.BaseMwmFragment;
+import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
+
import java.util.ArrayList;
-public class ReviewFragment extends BaseMwmFragment implements RecyclerClickListener {
+public class ReviewFragment extends BaseMwmFragment implements RecyclerClickListener
+{
+ @Nullable
private ArrayList<Review> mItems;
+ @Nullable
private String mRating;
private int mRatingBase;
+ @Nullable
private String mUrl;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
- @Nullable Bundle savedInstanceState) {
+ @Nullable Bundle savedInstanceState)
+ {
return inflater.inflate(R.layout.fragment_review, container, false);
}
@Override
- public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
+ {
super.onViewCreated(view, savedInstanceState);
readArguments();
- RecyclerView rvGallery = (RecyclerView) view.findViewById(R.id.rv__review);
- rvGallery.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
- rvGallery.setAdapter(new ReviewAdapter(mItems, this, mRating, mRatingBase));
+ if (mItems != null && mRating != null)
+ {
+ RecyclerView rvGallery = (RecyclerView) view.findViewById(R.id.rv__review);
+ rvGallery.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
+ rvGallery.setAdapter(new ReviewAdapter(mItems, this, mRating, mRatingBase));
+ }
}
private void readArguments()
@@ -52,7 +61,11 @@ public class ReviewFragment extends BaseMwmFragment implements RecyclerClickList
}
@Override
- public void onItemClick(View v, int position) {
+ public void onItemClick(View v, int position)
+ {
+ if (mUrl == null)
+ return;
+
final Intent intent = new Intent(Intent.ACTION_VIEW);
String url = mUrl;
if (!url.startsWith("http://") && !url.startsWith("https://"))
diff --git a/android/src/com/mapswithme/maps/widget/LineCountTextView.java b/android/src/com/mapswithme/maps/widget/LineCountTextView.java
index afd4f9a4bd..34060ab173 100644
--- a/android/src/com/mapswithme/maps/widget/LineCountTextView.java
+++ b/android/src/com/mapswithme/maps/widget/LineCountTextView.java
@@ -6,44 +6,52 @@ import android.text.Layout;
import android.util.AttributeSet;
import android.widget.TextView;
-public class LineCountTextView extends TextView {
+public class LineCountTextView extends TextView
+{
- public interface OnLineCountCalculatedListener {
+ public interface OnLineCountCalculatedListener
+ {
void onLineCountCalculated(boolean grater);
}
private OnLineCountCalculatedListener mListener;
- public LineCountTextView(Context context) {
+ public LineCountTextView(Context context)
+ {
super(context);
}
- public LineCountTextView(Context context, AttributeSet attrs) {
+ public LineCountTextView(Context context, AttributeSet attrs)
+ {
super(context, attrs);
}
- public LineCountTextView(Context context, AttributeSet attrs, int defStyleAttr) {
+ public LineCountTextView(Context context, AttributeSet attrs, int defStyleAttr)
+ {
super(context, attrs, defStyleAttr);
}
@Override
- protected void onDraw(Canvas canvas) {
+ protected void onDraw(Canvas canvas)
+ {
super.onDraw(canvas);
Layout layout = getLayout();
- if (layout != null) {
+ if (layout != null)
+ {
int textHeight = layout.getHeight();
int viewHeight = getHeight();
- if (mListener != null) {
+ if (mListener != null)
+ {
mListener.onLineCountCalculated(textHeight > viewHeight);
}
}
}
- public void setListener(
- OnLineCountCalculatedListener listener) {
+ public void setListener(OnLineCountCalculatedListener listener)
+ {
mListener = listener;
}
}
diff --git a/android/src/com/mapswithme/maps/widget/StaticGridView.java b/android/src/com/mapswithme/maps/widget/StaticGridView.java
index db77432f2b..a89fbe6fcf 100644
--- a/android/src/com/mapswithme/maps/widget/StaticGridView.java
+++ b/android/src/com/mapswithme/maps/widget/StaticGridView.java
@@ -4,22 +4,27 @@ import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;
-public class StaticGridView extends GridView {
+public class StaticGridView extends GridView
+{
- public StaticGridView(Context context) {
+ public StaticGridView(Context context)
+ {
super(context);
}
- public StaticGridView(Context context, AttributeSet attrs) {
+ public StaticGridView(Context context, AttributeSet attrs)
+ {
super(context, attrs);
}
- public StaticGridView(Context context, AttributeSet attrs, int defStyleAttr) {
+ public StaticGridView(Context context, AttributeSet attrs, int defStyleAttr)
+ {
super(context, attrs, defStyleAttr);
}
@Override
- public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ public void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
+ {
super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(MEASURED_SIZE_MASK, MeasureSpec.AT_MOST));
getLayoutParams().height = getMeasuredHeight();
}
diff --git a/android/src/com/mapswithme/maps/widget/placepage/FacilitiesAdapter.java b/android/src/com/mapswithme/maps/widget/placepage/FacilitiesAdapter.java
index 9ab248ef03..3a5aa72e7e 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/FacilitiesAdapter.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/FacilitiesAdapter.java
@@ -1,7 +1,6 @@
package com.mapswithme.maps.widget.placepage;
-import com.mapswithme.maps.R;
-
+import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -9,71 +8,87 @@ import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
+import com.mapswithme.maps.R;
+
import java.util.ArrayList;
import java.util.List;
-class FacilitiesAdapter extends BaseAdapter {
+class FacilitiesAdapter extends BaseAdapter
+{
static final int MAX_COUNT = 6;
- private List<SponsoredHotel.FacilityType> items = new ArrayList<>();
+ @NonNull
+ private List<SponsoredHotel.FacilityType> mItems = new ArrayList<>();
private boolean isShowAll = false;
@Override
- public int getCount() {
- if (items.size() > MAX_COUNT && !isShowAll) {
+ public int getCount()
+ {
+ if (mItems.size() > MAX_COUNT && !isShowAll)
+ {
return MAX_COUNT;
}
- return items.size();
+ return mItems.size();
}
@Override
- public Object getItem(int position) {
- return items.get(position);
+ public Object getItem(int position)
+ {
+ return mItems.get(position);
}
@Override
- public long getItemId(int position) {
+ public long getItemId(int position)
+ {
return position;
}
@Override
- public View getView(int position, View convertView, ViewGroup parent) {
+ public View getView(int position, View convertView, ViewGroup parent)
+ {
ViewHolder holder;
- if (convertView == null) {
+ if (convertView == null)
+ {
convertView = LayoutInflater.from(parent.getContext())
- .inflate(R.layout.item_facility, parent, false);
+ .inflate(R.layout.item_facility, parent, false);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
- } else {
+ }
+ else
+ {
holder = (ViewHolder) convertView.getTag();
}
- holder.bind(items.get(position));
+ holder.bind(mItems.get(position));
return convertView;
}
- public void setItems(
- List<SponsoredHotel.FacilityType> items) {
- this.items = items;
+ public void setItems(@NonNull List<SponsoredHotel.FacilityType> items)
+ {
+ this.mItems = items;
notifyDataSetChanged();
}
- void setShowAll(boolean showAll) {
+ void setShowAll(boolean showAll)
+ {
isShowAll = showAll;
notifyDataSetChanged();
}
- private static class ViewHolder {
+ private static class ViewHolder
+ {
ImageView mIcon;
TextView mName;
- public ViewHolder(View view) {
+ public ViewHolder(View view)
+ {
mIcon = (ImageView) view.findViewById(R.id.iv__icon);
mName = (TextView) view.findViewById(R.id.tv__facility);
}
- public void bind(SponsoredHotel.FacilityType facility) {
+ public void bind(SponsoredHotel.FacilityType facility)
+ {
// TODO map facility key to image resource id
mIcon.setImageResource(R.drawable.ic_entrance);
mName.setText(facility.getName());
diff --git a/android/src/com/mapswithme/maps/widget/placepage/GalleryAdapter.java b/android/src/com/mapswithme/maps/widget/placepage/GalleryAdapter.java
index 54d3f29b7b..a7ec45ea17 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/GalleryAdapter.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/GalleryAdapter.java
@@ -1,125 +1,140 @@
package com.mapswithme.maps.widget.placepage;
-import com.bumptech.glide.Glide;
-import com.bumptech.glide.request.animation.GlideAnimation;
-import com.bumptech.glide.request.target.SimpleTarget;
-import com.mapswithme.maps.R;
-import com.mapswithme.maps.gallery.Image;
-import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
-import com.mapswithme.util.UiUtils;
-
import android.content.Context;
import android.graphics.Bitmap;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.request.animation.GlideAnimation;
+import com.bumptech.glide.request.target.SimpleTarget;
+import com.mapswithme.maps.R;
+import com.mapswithme.maps.gallery.Image;
+import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
+import com.mapswithme.util.UiUtils;
+
import java.util.ArrayList;
import java.util.List;
-class GalleryAdapter extends RecyclerView.Adapter<GalleryAdapter.ViewHolder> {
+class GalleryAdapter extends RecyclerView.Adapter<GalleryAdapter.ViewHolder>
+{
static final int MAX_COUNT = 5;
private final Context mContext;
+ @NonNull
private ArrayList<Image> mItems = new ArrayList<>();
+ @NonNull
private final List<Item> mLoadedItems = new ArrayList<>();
+ @NonNull
+ private final List<Item> mItemsToDownload = new ArrayList<>();
+ @Nullable
private RecyclerClickListener mListener;
private final int mImageWidth;
private final int mImageHeight;
- private final Object mMutex = new Object();
- private final List<DownloadState> mDownloadStates = new ArrayList<>();
- GalleryAdapter(Context context) {
+ GalleryAdapter(Context context)
+ {
mContext = context;
- mImageWidth = (int)context.getResources().getDimension(R.dimen.placepage_hotel_gallery_width);
- mImageHeight = (int)context.getResources().getDimension(R.dimen.placepage_hotel_gallery_height);
+ mImageWidth = (int) context.getResources().getDimension(R.dimen.placepage_hotel_gallery_width);
+ mImageHeight = (int) context.getResources()
+ .getDimension(R.dimen.placepage_hotel_gallery_height);
}
@Override
- public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
+ {
return new ViewHolder(LayoutInflater.from(mContext)
- .inflate(R.layout.item_gallery, parent, false), mListener);
+ .inflate(R.layout.item_gallery, parent, false), mListener);
}
@Override
- public void onBindViewHolder(ViewHolder holder, int position) {
+ public void onBindViewHolder(ViewHolder holder, int position)
+ {
Item item = mLoadedItems.get(position);
item.setShowMore(position == MAX_COUNT - 1);
holder.bind(item, position);
}
@Override
- public int getItemCount() {
- synchronized (mMutex) {
- return mLoadedItems.size();
- }
+ public int getItemCount()
+ {
+ return mLoadedItems.size();
}
- public ArrayList<Image> getItems() {
+ @NonNull
+ public ArrayList<Image> getItems()
+ {
return mItems;
}
- public void setItems(ArrayList<Image> items) {
+ public void setItems(@NonNull ArrayList<Image> items)
+ {
mItems = items;
- synchronized (mMutex) {
- mLoadedItems.clear();
- for (DownloadState state: mDownloadStates) {
- state.isCanceled = true;
- }
- mDownloadStates.clear();
+
+ for (Item item : mItemsToDownload)
+ {
+ item.setCanceled(true);
}
+ mItemsToDownload.clear();
+ mLoadedItems.clear();
loadImages();
notifyDataSetChanged();
}
- public void setListener(RecyclerClickListener listener) {
+ public void setListener(@Nullable RecyclerClickListener listener)
+ {
mListener = listener;
}
- private void loadImages() {
- int size = mItems.size();
- if (size > MAX_COUNT) {
- size = MAX_COUNT;
- }
+ private void loadImages()
+ {
+ int size = mItems.size() > MAX_COUNT ? MAX_COUNT : mItems.size();
- for (int i = 0; i < size; i++) {
- final DownloadState state;
- synchronized (mMutex) {
- state = new DownloadState();
- mDownloadStates.add(state);
- }
+ for (int i = 0; i < size; i++)
+ {
+ final Item item = new Item(null);
+ mItemsToDownload.add(item);
Image image = mItems.get(i);
Glide.with(mContext)
- .load(image.getSmallUrl())
- .asBitmap()
- .centerCrop()
- .into(new SimpleTarget<Bitmap>(mImageWidth, mImageHeight) {
- @Override
- public void onResourceReady(Bitmap resource,
- GlideAnimation<? super Bitmap> glideAnimation) {
- synchronized (mMutex) {
- if (state.isCanceled) {
- return;
- }
- int size = mLoadedItems.size();
- mLoadedItems.add(new Item(resource));
- notifyItemInserted(size);
- }
- }
- });
+ .load(image.getSmallUrl())
+ .asBitmap()
+ .centerCrop()
+ .into(new SimpleTarget<Bitmap>(mImageWidth, mImageHeight)
+ {
+ @Override
+ public void onResourceReady(Bitmap resource,
+ GlideAnimation<? super Bitmap> glideAnimation)
+ {
+ if (item.isCanceled())
+ return;
+
+ item.setBitmap(resource);
+ int size = mLoadedItems.size();
+ mLoadedItems.add(item);
+ notifyItemInserted(size);
+ }
+ });
}
}
- static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
+ static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener
+ {
+ @NonNull
private ImageView mImage;
+ @NonNull
private View mMore;
+ @Nullable
private final RecyclerClickListener mListener;
private int mPosition;
- public ViewHolder(View itemView, RecyclerClickListener listener) {
+ public ViewHolder(View itemView, @Nullable RecyclerClickListener listener)
+ {
super(itemView);
mListener = listener;
mImage = (ImageView) itemView.findViewById(R.id.iv__image);
@@ -128,47 +143,70 @@ class GalleryAdapter extends RecyclerView.Adapter<GalleryAdapter.ViewHolder> {
}
@Override
- public void onClick(View v) {
- if (mListener == null) {
+ public void onClick(View v)
+ {
+ if (mListener == null)
return;
- }
mListener.onItemClick(v, mPosition);
}
- public void bind(Item item, int position) {
+ public void bind(Item item, int position)
+ {
mPosition = position;
mImage.setImageBitmap(item.getBitmap());
- if (item.isShowMore()) {
+ if (item.isShowMore())
+ {
UiUtils.show(mMore);
- } else {
+ }
+ else
+ {
UiUtils.hide(mMore);
}
}
}
- static class Item {
- private final Bitmap mBitmap;
+ static class Item
+ {
+ @Nullable
+ private Bitmap mBitmap;
private boolean isShowMore;
+ private boolean isCanceled = false;
- Item(Bitmap bitmap) {
+ Item(@Nullable Bitmap bitmap)
+ {
this.mBitmap = bitmap;
}
- Bitmap getBitmap() {
+ @Nullable
+ Bitmap getBitmap()
+ {
return mBitmap;
}
- void setShowMore(boolean showMore) {
+ void setBitmap(@Nullable Bitmap bitmap)
+ {
+ mBitmap = bitmap;
+ }
+
+ void setShowMore(boolean showMore)
+ {
isShowMore = showMore;
}
- boolean isShowMore() {
+ boolean isShowMore()
+ {
return isShowMore;
}
- }
- private static class DownloadState {
- boolean isCanceled = false;
+ boolean isCanceled()
+ {
+ return isCanceled;
+ }
+
+ void setCanceled(boolean canceled)
+ {
+ isCanceled = canceled;
+ }
}
}
diff --git a/android/src/com/mapswithme/maps/widget/placepage/LeftPlacePageAnimationController.java b/android/src/com/mapswithme/maps/widget/placepage/LeftPlacePageAnimationController.java
index b68a2b068e..d981692c74 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/LeftPlacePageAnimationController.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/LeftPlacePageAnimationController.java
@@ -13,7 +13,7 @@ import com.mapswithme.util.UiUtils;
class LeftPlacePageAnimationController extends BasePlacePageAnimationController
{
- public LeftPlacePageAnimationController(@NonNull PlacePageView placePage)
+ LeftPlacePageAnimationController(@NonNull PlacePageView placePage)
{
super(placePage);
}
@@ -27,22 +27,21 @@ class LeftPlacePageAnimationController extends BasePlacePageAnimationController
@Override
protected boolean onInterceptTouchEvent(MotionEvent event)
{
- if (mPlacePage.isTouchGallery(event)) {
+ if (mPlacePage.isTouchGallery(event))
return false;
- }
switch (event.getAction())
{
- case MotionEvent.ACTION_DOWN:
- mIsDragging = false;
- mDownCoord = event.getX();
- break;
- case MotionEvent.ACTION_MOVE:
- if (mDownCoord > mPlacePage.getRight())
- return false;
- if (Math.abs(mDownCoord - event.getX()) > mTouchSlop)
- return true;
- break;
+ case MotionEvent.ACTION_DOWN:
+ mIsDragging = false;
+ mDownCoord = event.getX();
+ break;
+ case MotionEvent.ACTION_MOVE:
+ if (mDownCoord > mPlacePage.getRight())
+ return false;
+ if (Math.abs(mDownCoord - event.getX()) > mTouchSlop)
+ return true;
+ break;
}
return false;
@@ -74,7 +73,7 @@ class LeftPlacePageAnimationController extends BasePlacePageAnimationController
final boolean isInRange = Math.abs(distanceX) > X_MIN && Math.abs(distanceX) < X_MAX;
if (!isHorizontal || !isInRange)
- return false;;
+ return false;
if (!mIsDragging)
{
@@ -94,13 +93,13 @@ class LeftPlacePageAnimationController extends BasePlacePageAnimationController
{
switch (newState)
{
- case HIDDEN:
- hidePlacePage();
- break;
- case DETAILS:
- case PREVIEW:
- showPlacePage(currentState, newState);
- break;
+ case HIDDEN:
+ hidePlacePage();
+ break;
+ case DETAILS:
+ case PREVIEW:
+ showPlacePage(currentState);
+ break;
}
}
@@ -134,7 +133,7 @@ class LeftPlacePageAnimationController extends BasePlacePageAnimationController
tracker.onTrackLeftAnimation(offset + mPlacePage.getDockedWidth());
}
- private void showPlacePage(final State currentState, final State newState)
+ private void showPlacePage(final State currentState)
{
UiUtils.show(mPlacePage);
if (currentState != State.HIDDEN)
diff --git a/android/src/com/mapswithme/maps/widget/placepage/NearbyAdapter.java b/android/src/com/mapswithme/maps/widget/placepage/NearbyAdapter.java
index 154d342f1d..97bdca8995 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/NearbyAdapter.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/NearbyAdapter.java
@@ -1,9 +1,8 @@
package com.mapswithme.maps.widget.placepage;
-import com.mapswithme.maps.R;
-import com.mapswithme.util.ThemeUtils;
-
import android.content.res.Resources;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -11,69 +10,90 @@ import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
+import com.mapswithme.maps.R;
+import com.mapswithme.util.ThemeUtils;
+
import java.util.ArrayList;
import java.util.List;
-class NearbyAdapter extends BaseAdapter {
+class NearbyAdapter extends BaseAdapter
+{
+ @NonNull
+ private List<SponsoredHotel.NearbyObject> mItems = new ArrayList<>();
+ @Nullable
+ private final OnItemClickListener mListener;
- NearbyAdapter(OnItemClickListener listener) {
+ NearbyAdapter(@Nullable OnItemClickListener listener)
+ {
mListener = listener;
}
- interface OnItemClickListener {
- void onItemClick(SponsoredHotel.NearbyObject item);
+ interface OnItemClickListener
+ {
+ void onItemClick(@NonNull SponsoredHotel.NearbyObject item);
}
- private List<SponsoredHotel.NearbyObject> items = new ArrayList<>();
- private final OnItemClickListener mListener;
-
@Override
- public int getCount() {
- return items.size();
+ public int getCount()
+ {
+ return mItems.size();
}
@Override
- public Object getItem(int position) {
- return items.get(position);
+ public Object getItem(int position)
+ {
+ return mItems.get(position);
}
@Override
- public long getItemId(int position) {
+ public long getItemId(int position)
+ {
return position;
}
@Override
- public View getView(int position, View convertView, ViewGroup parent) {
+ public View getView(int position, View convertView, ViewGroup parent)
+ {
ViewHolder holder;
- if (convertView == null) {
+ if (convertView == null)
+ {
convertView = LayoutInflater.from(parent.getContext())
- .inflate(R.layout.item_nearby, parent, false);
+ .inflate(R.layout.item_nearby, parent, false);
holder = new ViewHolder(convertView, mListener);
convertView.setTag(holder);
- } else {
+ } else
+ {
holder = (ViewHolder) convertView.getTag();
}
- holder.bind(items.get(position));
+ holder.bind(mItems.get(position));
return convertView;
}
- public void setItems(
- List<SponsoredHotel.NearbyObject> items) {
- this.items = items;
+ public void setItems(@NonNull List<SponsoredHotel.NearbyObject> items)
+ {
+ this.mItems = items;
notifyDataSetChanged();
}
- private static class ViewHolder implements View.OnClickListener {
+ private static class ViewHolder implements View.OnClickListener
+ {
+ @Nullable
final OnItemClickListener mListener;
+ @NonNull
ImageView mIcon;
+ @NonNull
TextView mTitle;
+ @NonNull
TextView mType;
+ @NonNull
TextView mDistance;
+ @Nullable
SponsoredHotel.NearbyObject mItem;
- public ViewHolder(View view, OnItemClickListener listener) {
+ public ViewHolder(View view, @Nullable OnItemClickListener listener)
+ {
mListener = listener;
mIcon = (ImageView) view.findViewById(R.id.iv__icon);
mTitle = (TextView) view.findViewById(R.id.tv__title);
@@ -83,13 +103,14 @@ class NearbyAdapter extends BaseAdapter {
}
@Override
- public void onClick(View v) {
- if (mListener != null) {
+ public void onClick(View v)
+ {
+ if (mListener != null && mItem != null)
mListener.onItemClick(mItem);
- }
}
- public void bind(SponsoredHotel.NearbyObject item) {
+ public void bind(@NonNull SponsoredHotel.NearbyObject item)
+ {
mItem = item;
String packageName = mType.getContext().getPackageName();
final boolean isNightTheme = ThemeUtils.isNightTheme();
diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java
index 2447002fb3..dcdae42812 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java
@@ -35,16 +35,6 @@ import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
-import java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Currency;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.MwmActivity;
import com.mapswithme.maps.MwmApplication;
@@ -84,15 +74,25 @@ import com.mapswithme.util.sharing.ShareOption;
import com.mapswithme.util.statistics.AlohaHelper;
import com.mapswithme.util.statistics.Statistics;
+import java.text.NumberFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Currency;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
public class PlacePageView extends RelativeLayout
- implements View.OnClickListener,
- View.OnLongClickListener,
- SponsoredHotel.OnPriceReceivedListener,
- SponsoredHotel.OnInfoReceivedListener,
- LineCountTextView.OnLineCountCalculatedListener,
- RecyclerClickListener,
- NearbyAdapter.OnItemClickListener {
+ implements View.OnClickListener,
+ View.OnLongClickListener,
+ SponsoredHotel.OnPriceReceivedListener,
+ SponsoredHotel.OnInfoReceivedListener,
+ LineCountTextView.OnLineCountCalculatedListener,
+ RecyclerClickListener,
+ NearbyAdapter.OnItemClickListener
+{
private static final String PREF_USE_DMS = "use_dms";
private boolean mIsDocked;
@@ -161,10 +161,14 @@ public class PlacePageView extends RelativeLayout
private SponsoredHotel mSponsoredHotel;
private String mSponsoredHotelPrice;
private boolean mIsLatLonDms;
- private FacilitiesAdapter mFacilitiesAdapter = new FacilitiesAdapter();
- private GalleryAdapter mGalleryAdapter;
- private NearbyAdapter mNearbyAdapter = new NearbyAdapter(this);
- private ReviewAdapter mReviewAdapter = new ReviewAdapter();
+ @NonNull
+ private final FacilitiesAdapter mFacilitiesAdapter = new FacilitiesAdapter();
+ @NonNull
+ private final GalleryAdapter mGalleryAdapter;
+ @NonNull
+ private final NearbyAdapter mNearbyAdapter = new NearbyAdapter(this);
+ @NonNull
+ private final ReviewAdapter mReviewAdapter = new ReviewAdapter();
// Downloader`s stuff
private DownloaderStatusIcon mDownloaderIcon;
@@ -205,22 +209,6 @@ public class PlacePageView extends RelativeLayout
}
};
- public boolean isTouchGallery(MotionEvent event) {
- if (UiUtils.isHidden(mHotelGallery))
- return false;
-
- float x = event.getX();
- float y = event.getY();
- int[] location = new int[2];
- mHotelGallery.getLocationOnScreen(location);
- float viewX = (float) location[0];
- float viewY = (float) location[1];
- float width = (float) mHotelGallery.getWidth();
- float height = (float) mHotelGallery.getHeight();
-
- return !(x < viewX || x > viewX + width || y < viewY || y > viewY + height);
- }
-
public enum State
{
HIDDEN,
@@ -243,12 +231,17 @@ public class PlacePageView extends RelativeLayout
super(context, attrs);
mIsLatLonDms = MwmApplication.prefs().getBoolean(PREF_USE_DMS, false);
-
+ mGalleryAdapter = new GalleryAdapter(context);
init(attrs, defStyleAttr);
}
public ViewGroup GetPreview() { return mPreview; }
+ public boolean isTouchGallery(@NonNull MotionEvent event)
+ {
+ return UiUtils.isViewTouched(event, mHotelGallery);
+ }
+
private void initViews()
{
LayoutInflater.from(getContext()).inflate(R.layout.place_page, this);
@@ -317,36 +310,11 @@ public class PlacePageView extends RelativeLayout
ViewGroup ppButtons = (ViewGroup) findViewById(R.id.pp__buttons);
- mHotelDescription = findViewById(R.id.ll__place_hotel_description);
- mTvHotelDescription = (LineCountTextView) findViewById(R.id.tv__place_hotel_details);
- mHotelMoreDescription = findViewById(R.id.tv__place_hotel_more);
- mTvHotelDescription.setListener(this);
- mHotelMoreDescription.setOnClickListener(this);
- mHotelFacilities = findViewById(R.id.ll__place_hotel_facilities);
- GridView gvHotelFacilities = (GridView) findViewById(R.id.gv__place_hotel_facilities);
- mHotelMoreFacilities = findViewById(R.id.tv__place_hotel_facilities_more);
- gvHotelFacilities.setAdapter(mFacilitiesAdapter);
- mHotelMoreFacilities.setOnClickListener(this);
- mHotelGallery = findViewById(R.id.ll__place_hotel_gallery);
- mRvHotelGallery = (RecyclerView) findViewById(
- R.id.rv__place_hotel_gallery);
- mRvHotelGallery.setLayoutManager(new LinearLayoutManager(getContext(),
- LinearLayoutManager.HORIZONTAL, false));
- mRvHotelGallery.addItemDecoration(new DividerItemDecoration(ContextCompat.getDrawable(getContext(),
- R.drawable.divider_transparent)));
- mGalleryAdapter = new GalleryAdapter(getContext());
- mGalleryAdapter.setListener(this);
- mRvHotelGallery.setAdapter(mGalleryAdapter);
- mHotelNearby = findViewById(R.id.ll__place_hotel_nearby);
- GridView gvHotelNearby = (GridView) findViewById(R.id.gv__place_hotel_nearby);
- gvHotelNearby.setAdapter(mNearbyAdapter);
- mHotelReview = findViewById(R.id.ll__place_hotel_rating);
- GridView gvHotelReview = (GridView) findViewById(R.id.gv__place_hotel_review);
- gvHotelReview.setAdapter(mReviewAdapter);
- mHotelRating = (TextView) findViewById(R.id.tv__place_hotel_rating);
- mHotelRatingBase = (TextView) findViewById(R.id.tv__place_hotel_rating_base);
- View hotelMoreReviews = findViewById(R.id.tv__place_hotel_reviews_more);
- hotelMoreReviews.setOnClickListener(this);
+ initHotelDescriptionView();
+ initHotelFacilitiesView();
+ initHotelGalleryView();
+ initHotelNearbyView();
+ initHotelRatingView();
mButtons = new PlacePageButtons(this, ppButtons, new PlacePageButtons.ItemListener()
{
@@ -357,21 +325,21 @@ public class PlacePageView extends RelativeLayout
switch (item)
{
- case BOOKING:
- frame.setBackgroundResource(R.drawable.button_booking);
- color = Color.WHITE;
- break;
-
- case BOOKMARK:
- mBookmarkButtonIcon = icon;
- updateButtons();
- color = ThemeUtils.getColor(getContext(), R.attr.iconTint);
- break;
-
- default:
- color = ThemeUtils.getColor(getContext(), R.attr.iconTint);
- icon.setColorFilter(color);
- break;
+ case BOOKING:
+ frame.setBackgroundResource(R.drawable.button_booking);
+ color = Color.WHITE;
+ break;
+
+ case BOOKMARK:
+ mBookmarkButtonIcon = icon;
+ updateButtons();
+ color = ThemeUtils.getColor(getContext(), R.attr.iconTint);
+ break;
+
+ default:
+ color = ThemeUtils.getColor(getContext(), R.attr.iconTint);
+ icon.setColorFilter(color);
+ break;
}
title.setTextColor(color);
@@ -412,62 +380,63 @@ public class PlacePageView extends RelativeLayout
hide();
break;
- case ROUTE_TO:
- if (RoutingController.get().isPlanning())
- {
- if (RoutingController.get().setEndPoint(mMapObject))
- hide();
- }
- else
- {
- getActivity().startLocationToPoint(Statistics.EventName.PP_ROUTE, AlohaHelper.PP_ROUTE, getMapObject());
- }
- break;
-
- case BOOKING:
- onBookingClick(true /* book */);
- break;
+ case ROUTE_TO:
+ if (RoutingController.get().isPlanning())
+ {
+ if (RoutingController.get().setEndPoint(mMapObject))
+ hide();
+ }
+ else
+ {
+ getActivity().startLocationToPoint(Statistics.EventName.PP_ROUTE, AlohaHelper.PP_ROUTE, getMapObject());
+ }
+ break;
+
+ case BOOKING:
+ onBookingClick(true /* book */);
+ break;
}
}
});
mDownloaderIcon = new DownloaderStatusIcon(mPreview.findViewById(R.id.downloader_status_frame))
- .setOnIconClickListener(new OnClickListener()
- {
- @Override
- public void onClick(View v)
- {
- MapManager.warn3gAndDownload(getActivity(), mCurrentCountry.id, new Runnable()
- {
- @Override
- public void run()
- {
- Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_ACTION,
- Statistics.params()
- .add(Statistics.EventParam.ACTION, "download")
- .add(Statistics.EventParam.FROM, "placepage")
- .add("is_auto", "false")
- .add("scenario", (mCurrentCountry.isExpandable() ? "download_group"
- : "download")));
- }
- });
- }
- }).setOnCancelClickListener(new OnClickListener()
- {
- @Override
- public void onClick(View v)
- {
- MapManager.nativeCancel(mCurrentCountry.id);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_CANCEL,
- Statistics.params().add(Statistics.EventParam.FROM, "placepage"));
- }
- });
+ .setOnIconClickListener(new OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+ MapManager.warn3gAndDownload(getActivity(), mCurrentCountry.id, new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_ACTION,
+ Statistics.params()
+ .add(Statistics.EventParam.ACTION, "download")
+ .add(Statistics.EventParam.FROM, "placepage")
+ .add("is_auto", "false")
+ .add("scenario", (mCurrentCountry.isExpandable() ? "download_group"
+ : "download")));
+ }
+ });
+ }
+ }).setOnCancelClickListener(new OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+ MapManager.nativeCancel(mCurrentCountry.id);
+ Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_CANCEL,
+ Statistics.params()
+ .add(Statistics.EventParam.FROM, "placepage"));
+ }
+ });
mDownloaderInfo = (TextView) mPreview.findViewById(R.id.tv__downloader_details);
mShadowController = new ScrollViewShadowController((ObservableScrollView) mDetails)
- .addBottomShadow()
- .attach();
+ .addBottomShadow()
+ .attach();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
setElevation(UiUtils.dimen(R.dimen.placepage_elevation));
@@ -479,8 +448,58 @@ public class PlacePageView extends RelativeLayout
SponsoredHotel.setInfoListener(this);
}
+ private void initHotelRatingView()
+ {
+ mHotelReview = findViewById(R.id.ll__place_hotel_rating);
+ GridView gvHotelReview = (GridView) findViewById(R.id.gv__place_hotel_review);
+ gvHotelReview.setAdapter(mReviewAdapter);
+ mHotelRating = (TextView) findViewById(R.id.tv__place_hotel_rating);
+ mHotelRatingBase = (TextView) findViewById(R.id.tv__place_hotel_rating_base);
+ View hotelMoreReviews = findViewById(R.id.tv__place_hotel_reviews_more);
+ hotelMoreReviews.setOnClickListener(this);
+ }
+
+ private void initHotelNearbyView()
+ {
+ mHotelNearby = findViewById(R.id.ll__place_hotel_nearby);
+ GridView gvHotelNearby = (GridView) findViewById(R.id.gv__place_hotel_nearby);
+ gvHotelNearby.setAdapter(mNearbyAdapter);
+ }
+
+ private void initHotelGalleryView()
+ {
+ mHotelGallery = findViewById(R.id.ll__place_hotel_gallery);
+ mRvHotelGallery = (RecyclerView) findViewById(
+ R.id.rv__place_hotel_gallery);
+ mRvHotelGallery.setLayoutManager(new LinearLayoutManager(getContext(),
+ LinearLayoutManager.HORIZONTAL, false));
+ mRvHotelGallery.addItemDecoration(new DividerItemDecoration(ContextCompat.getDrawable(getContext(),
+ R.drawable.divider_transparent)));
+ mGalleryAdapter.setListener(this);
+ mRvHotelGallery.setAdapter(mGalleryAdapter);
+ }
+
+ private void initHotelFacilitiesView()
+ {
+ mHotelFacilities = findViewById(R.id.ll__place_hotel_facilities);
+ GridView gvHotelFacilities = (GridView) findViewById(R.id.gv__place_hotel_facilities);
+ mHotelMoreFacilities = findViewById(R.id.tv__place_hotel_facilities_more);
+ gvHotelFacilities.setAdapter(mFacilitiesAdapter);
+ mHotelMoreFacilities.setOnClickListener(this);
+ }
+
+ private void initHotelDescriptionView()
+ {
+ mHotelDescription = findViewById(R.id.ll__place_hotel_description);
+ mTvHotelDescription = (LineCountTextView) findViewById(R.id.tv__place_hotel_details);
+ mHotelMoreDescription = findViewById(R.id.tv__place_hotel_more);
+ mTvHotelDescription.setListener(this);
+ mHotelMoreDescription.setOnClickListener(this);
+ }
+
@Override
- public void onPriceReceived(String id, String price, String currencyCode)
+ public void onPriceReceived(@NonNull String id, @NonNull String price,
+ @NonNull String currencyCode)
{
if (mSponsoredHotel == null || !TextUtils.equals(id, mSponsoredHotel.getId()))
return;
@@ -500,67 +519,98 @@ public class PlacePageView extends RelativeLayout
}
@Override
- public void onInfoReceived(String id, SponsoredHotel.HotelInfo info) {
- if (mSponsoredHotel == null || !TextUtils.equals(id, mSponsoredHotel.getId())) {
+ public void onInfoReceived(@NonNull String id, @NonNull SponsoredHotel.HotelInfo info)
+ {
+ if (mSponsoredHotel == null || !TextUtils.equals(id, mSponsoredHotel.getId()))
return;
- }
- mTvHotelDescription.setMaxLines(5);
- refreshMetadataOrHide(info.description, mHotelDescription, mTvHotelDescription);
- mHotelMoreDescription.setVisibility(GONE);
+ updateHotelDetails(info);
+ updateHotelFacilities(info);
+ updateHotelGallery(info);
+ updateHotelNearby(info);
+ updateHotelRating(info);
+ }
- if (info.facilities == null || info.facilities.length == 0) {
- UiUtils.hide(mHotelFacilities);
- } else {
- UiUtils.show(mHotelFacilities);
- mFacilitiesAdapter.setShowAll(false);
- mFacilitiesAdapter.setItems(Arrays.asList(info.facilities));
- mHotelMoreFacilities.setVisibility(info.facilities.length > FacilitiesAdapter.MAX_COUNT
- ? VISIBLE : GONE);
+ private void updateHotelRating(@NonNull SponsoredHotel.HotelInfo info)
+ {
+ if (info.mReviews == null || info.mReviews.length == 0)
+ UiUtils.hide(mHotelReview);
+ else
+ {
+ UiUtils.show(mHotelReview);
+ mReviewAdapter.setItems(new ArrayList<>(Arrays.asList(info.mReviews)));
+ mHotelRating.setText(mSponsoredHotel.mRating);
+ mHotelRatingBase.setText(getResources().getQuantityString(R.plurals.place_page_booking_rating_base,
+ info.mReviews.length, info.mReviews.length));
}
+ }
+
+ private void updateHotelNearby(@NonNull SponsoredHotel.HotelInfo info)
+ {
+ if (info.mNearby == null || info.mNearby.length == 0)
+ UiUtils.hide(mHotelNearby);
+ else
+ {
+ UiUtils.show(mHotelNearby);
+ mNearbyAdapter.setItems(Arrays.asList(info.mNearby));
+ }
+ }
- if (info.photos == null || info.photos.length == 0) {
+ private void updateHotelGallery(@NonNull SponsoredHotel.HotelInfo info)
+ {
+ if (info.mPhotos == null || info.mPhotos.length == 0)
UiUtils.hide(mHotelGallery);
- } else {
+ else
+ {
UiUtils.show(mHotelGallery);
- mGalleryAdapter.setItems(new ArrayList<>(Arrays.asList(info.photos)));
+ mGalleryAdapter.setItems(new ArrayList<>(Arrays.asList(info.mPhotos)));
mRvHotelGallery.scrollToPosition(0);
}
+ }
- if (info.nearby == null || info.nearby.length == 0) {
- UiUtils.hide(mHotelNearby);
- } else {
- UiUtils.show(mHotelNearby);
- mNearbyAdapter.setItems(Arrays.asList(info.nearby));
+ private void updateHotelFacilities(@NonNull SponsoredHotel.HotelInfo info)
+ {
+ if (info.mFacilities == null || info.mFacilities.length == 0)
+ UiUtils.hide(mHotelFacilities);
+ else
+ {
+ UiUtils.show(mHotelFacilities);
+ mFacilitiesAdapter.setShowAll(false);
+ mFacilitiesAdapter.setItems(Arrays.asList(info.mFacilities));
+ mHotelMoreFacilities.setVisibility(info.mFacilities.length > FacilitiesAdapter.MAX_COUNT
+ ? VISIBLE : GONE);
}
+ }
- if (info.reviews == null || info.reviews.length == 0) {
- UiUtils.hide(mHotelReview);
- } else {
- UiUtils.show(mHotelReview);
- mReviewAdapter.setItems(new ArrayList<>(Arrays.asList(info.reviews)));
- mHotelRating.setText(mSponsoredHotel.rating);
- mHotelRatingBase.setText(getResources().getQuantityString(R.plurals.place_page_booking_rating_base,
- info.reviews.length, info.reviews.length));
- }
+ private void updateHotelDetails(@NonNull SponsoredHotel.HotelInfo info)
+ {
+ mTvHotelDescription.setMaxLines(getResources().getInteger(R.integer.pp_hotel_description_lines));
+ refreshMetadataOrHide(info.mDescription, mHotelDescription, mTvHotelDescription);
+ mHotelMoreDescription.setVisibility(GONE);
}
@Override
- public void onLineCountCalculated(boolean grater) {
+ public void onLineCountCalculated(boolean grater)
+ {
mHotelMoreDescription.setVisibility(grater ? VISIBLE : GONE);
}
@Override
- public void onItemClick(View v, int position) {
- if (position == GalleryAdapter.MAX_COUNT - 1) {
+ public void onItemClick(View v, int position)
+ {
+ if (position == GalleryAdapter.MAX_COUNT - 1)
+ {
GalleryActivity.start(getContext(), mGalleryAdapter.getItems(), mMapObject.getTitle());
- } else {
+ }
+ else
+ {
FullScreenGalleryActivity.start(getContext(), mGalleryAdapter.getItems(), position);
}
}
@Override
- public void onItemClick(SponsoredHotel.NearbyObject item) {
+ public void onItemClick(@NonNull SponsoredHotel.NearbyObject item)
+ {
// TODO go to selected object on map
}
@@ -593,7 +643,7 @@ public class PlacePageView extends RelativeLayout
try
{
- followUrl(book ? info.urlBook : info.urlDescription);
+ followUrl(book ? info.mUrlBook : info.mUrlDescription);
} catch (ActivityNotFoundException e)
{
AlohaHelper.logException(e);
@@ -622,7 +672,7 @@ public class PlacePageView extends RelativeLayout
public void restore()
{
// if (mMapObject != null)
- // FIXME query map object again
+ // FIXME query map object again
}
@Override
@@ -679,7 +729,7 @@ public class PlacePageView extends RelativeLayout
/**
* @param mapObject new MapObject
- * @param force if true, new object'll be set without comparison with the old one
+ * @param force if true, new object'll be set without comparison with the old one
*/
public void setMapObject(MapObject mapObject, boolean force)
{
@@ -695,7 +745,7 @@ public class PlacePageView extends RelativeLayout
if (mSponsoredHotel != null)
{
mSponsoredHotel.updateId(mMapObject);
- mSponsoredHotelPrice = mSponsoredHotel.price;
+ mSponsoredHotelPrice = mSponsoredHotel.mPrice;
Locale locale = Locale.getDefault();
Currency currency = Currency.getInstance(locale);
@@ -722,27 +772,27 @@ public class PlacePageView extends RelativeLayout
switch (mMapObject.getMapObjectType())
{
- case MapObject.BOOKMARK:
- refreshDistanceToObject(loc);
- showBookmarkDetails();
- setButtons(false, true);
- break;
- case MapObject.POI:
- case MapObject.SEARCH:
- refreshDistanceToObject(loc);
- hideBookmarkDetails();
- setButtons(false, true);
- break;
- case MapObject.API_POINT:
- refreshDistanceToObject(loc);
- hideBookmarkDetails();
- setButtons(true, true);
- break;
- case MapObject.MY_POSITION:
- refreshMyPosition(loc);
- hideBookmarkDetails();
- setButtons(false, false);
- break;
+ case MapObject.BOOKMARK:
+ refreshDistanceToObject(loc);
+ showBookmarkDetails();
+ setButtons(false, true);
+ break;
+ case MapObject.POI:
+ case MapObject.SEARCH:
+ refreshDistanceToObject(loc);
+ hideBookmarkDetails();
+ setButtons(false, true);
+ break;
+ case MapObject.API_POINT:
+ refreshDistanceToObject(loc);
+ hideBookmarkDetails();
+ setButtons(true, true);
+ break;
+ case MapObject.MY_POSITION:
+ refreshMyPosition(loc);
+ hideBookmarkDetails();
+ setButtons(false, false);
+ break;
}
UiThread.runLater(new Runnable()
@@ -787,7 +837,7 @@ public class PlacePageView extends RelativeLayout
UiUtils.showIf(sponsored, mHotelInfo);
if (sponsored)
{
- mTvHotelRating.setText(mSponsoredHotel.rating);
+ mTvHotelRating.setText(mSponsoredHotel.mRating);
UiUtils.setTextAndHideIfEmpty(mTvHotelPrice, mSponsoredHotelPrice);
}
}
@@ -806,7 +856,8 @@ public class PlacePageView extends RelativeLayout
UiUtils.hide(mHotelNearby);
UiUtils.hide(mHotelReview);
}
- else {
+ else
+ {
UiUtils.hide(mWebsite);
}
@@ -970,8 +1021,11 @@ public class PlacePageView extends RelativeLayout
return;
mTvDistance.setVisibility(View.VISIBLE);
- DistanceAndAzimut distanceAndAzimuth = Framework.nativeGetDistanceAndAzimuthFromLatLon(mMapObject.getLat(), mMapObject.getLon(),
- l.getLatitude(), l.getLongitude(), 0.0);
+ DistanceAndAzimut distanceAndAzimuth = Framework.nativeGetDistanceAndAzimuthFromLatLon(mMapObject
+ .getLat(), mMapObject
+ .getLon(),
+ l.getLatitude(), l
+ .getLongitude(), 0.0);
mTvDistance.setText(distanceAndAzimuth.getDistance());
}
@@ -999,16 +1053,18 @@ public class PlacePageView extends RelativeLayout
public void refreshAzimuth(double northAzimuth)
{
if (isHidden() ||
- mMapObject == null ||
- MapObject.isOfType(MapObject.MY_POSITION, mMapObject))
+ mMapObject == null ||
+ MapObject.isOfType(MapObject.MY_POSITION, mMapObject))
return;
final Location location = LocationHelper.INSTANCE.getSavedLocation();
if (location == null)
return;
- final double azimuth = Framework.nativeGetDistanceAndAzimuthFromLatLon(mMapObject.getLat(), mMapObject.getLon(),
- location.getLatitude(), location.getLongitude(),
+ final double azimuth = Framework.nativeGetDistanceAndAzimuthFromLatLon(mMapObject.getLat(), mMapObject
+ .getLon(),
+ location.getLatitude(), location
+ .getLongitude(),
northAzimuth)
.getAzimuth();
if (azimuth >= 0)
@@ -1026,7 +1082,8 @@ public class PlacePageView extends RelativeLayout
private void addOrganisation()
{
Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_ADD_CLICK,
- Statistics.params().add(Statistics.EventParam.FROM, "placepage"));
+ Statistics.params()
+ .add(Statistics.EventParam.FROM, "placepage"));
getActivity().showPositionChooser(true, false);
}
@@ -1041,68 +1098,69 @@ public class PlacePageView extends RelativeLayout
{
switch (v.getId())
{
- case R.id.ll__place_editor:
- getActivity().showEditor();
- break;
- case R.id.ll__add_organisation:
- addOrganisation();
- break;
- case R.id.ll__place_add:
- addPlace();
- break;
- case R.id.ll__more:
- onBookingClick(false /* book */);
- break;
- case R.id.ll__place_latlon:
- mIsLatLonDms = !mIsLatLonDms;
- MwmApplication.prefs().edit().putBoolean(PREF_USE_DMS, mIsLatLonDms).commit();
- refreshLatLon();
- break;
- case R.id.ll__place_phone:
- Intent intent = new Intent(Intent.ACTION_DIAL);
- intent.setData(Uri.parse("tel:" + mTvPhone.getText()));
- try
- {
+ case R.id.ll__place_editor:
+ getActivity().showEditor();
+ break;
+ case R.id.ll__add_organisation:
+ addOrganisation();
+ break;
+ case R.id.ll__place_add:
+ addPlace();
+ break;
+ case R.id.ll__more:
+ onBookingClick(false /* book */);
+ break;
+ case R.id.ll__place_latlon:
+ mIsLatLonDms = !mIsLatLonDms;
+ MwmApplication.prefs().edit().putBoolean(PREF_USE_DMS, mIsLatLonDms).commit();
+ refreshLatLon();
+ break;
+ case R.id.ll__place_phone:
+ Intent intent = new Intent(Intent.ACTION_DIAL);
+ intent.setData(Uri.parse("tel:" + mTvPhone.getText()));
+ try
+ {
+ getContext().startActivity(intent);
+ } catch (ActivityNotFoundException e)
+ {
+ AlohaHelper.logException(e);
+ }
+ break;
+ case R.id.ll__place_website:
+ followUrl(mTvWebsite.getText().toString());
+ break;
+ case R.id.ll__place_wiki:
+ // TODO: Refactor and use separate getters for Wiki and all other PP meta info too.
+ followUrl(mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA));
+ break;
+ case R.id.direction_frame:
+ Statistics.INSTANCE.trackEvent(Statistics.EventName.PP_DIRECTION_ARROW);
+ AlohaHelper.logClick(AlohaHelper.PP_DIRECTION_ARROW);
+ showBigDirection();
+ break;
+ case R.id.ll__place_email:
+ intent = new Intent(Intent.ACTION_SENDTO);
+ intent.setData(Utils.buildMailUri(mTvEmail.getText().toString(), "", ""));
getContext().startActivity(intent);
- } catch (ActivityNotFoundException e)
- {
- AlohaHelper.logException(e);
- }
- break;
- case R.id.ll__place_website:
- followUrl(mTvWebsite.getText().toString());
- break;
- case R.id.ll__place_wiki:
- // TODO: Refactor and use separate getters for Wiki and all other PP meta info too.
- followUrl(mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA));
- break;
- case R.id.direction_frame:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.PP_DIRECTION_ARROW);
- AlohaHelper.logClick(AlohaHelper.PP_DIRECTION_ARROW);
- showBigDirection();
- break;
- case R.id.ll__place_email:
- intent = new Intent(Intent.ACTION_SENDTO);
- intent.setData(Utils.buildMailUri(mTvEmail.getText().toString(), "", ""));
- getContext().startActivity(intent);
- break;
- case R.id.tv__bookmark_edit:
- Bookmark bookmark = (Bookmark) mMapObject;
- EditBookmarkFragment.editBookmark(bookmark.getCategoryId(), bookmark.getBookmarkId(),
- getActivity(), getActivity().getSupportFragmentManager());
- break;
- case R.id.tv__place_hotel_more:
- UiUtils.hide(mHotelMoreDescription);
- mTvHotelDescription.setMaxLines(Integer.MAX_VALUE);
- break;
- case R.id.tv__place_hotel_facilities_more:
- UiUtils.hide(mHotelMoreFacilities);
- mFacilitiesAdapter.setShowAll(true);
- break;
- case R.id.tv__place_hotel_reviews_more:
- ReviewActivity.start(getContext(), mReviewAdapter.getItems(), mMapObject.getTitle(),
- mSponsoredHotel.rating, mReviewAdapter.getItems().size(), mSponsoredHotel.urlBook);
- break;
+ break;
+ case R.id.tv__bookmark_edit:
+ Bookmark bookmark = (Bookmark) mMapObject;
+ EditBookmarkFragment.editBookmark(bookmark.getCategoryId(), bookmark.getBookmarkId(),
+ getActivity(), getActivity().getSupportFragmentManager());
+ break;
+ case R.id.tv__place_hotel_more:
+ UiUtils.hide(mHotelMoreDescription);
+ mTvHotelDescription.setMaxLines(Integer.MAX_VALUE);
+ break;
+ case R.id.tv__place_hotel_facilities_more:
+ UiUtils.hide(mHotelMoreFacilities);
+ mFacilitiesAdapter.setShowAll(true);
+ break;
+ case R.id.tv__place_hotel_reviews_more:
+ ReviewActivity.start(getContext(), mReviewAdapter.getItems(), mMapObject.getTitle(),
+ mSponsoredHotel.mRating, mReviewAdapter.getItems()
+ .size(), mSponsoredHotel.mUrlBook);
+ break;
}
}
@@ -1134,7 +1192,8 @@ public class PlacePageView extends RelativeLayout
private void showBigDirection()
{
- final DirectionFragment fragment = (DirectionFragment) Fragment.instantiate(getActivity(), DirectionFragment.class.getName(), null);
+ final DirectionFragment fragment = (DirectionFragment) Fragment.instantiate(getActivity(), DirectionFragment.class
+ .getName(), null);
fragment.setMapObject(mMapObject);
fragment.show(getActivity().getSupportFragmentManager(), null);
}
@@ -1151,30 +1210,30 @@ public class PlacePageView extends RelativeLayout
final List<String> items = new ArrayList<>();
switch (v.getId())
{
- case R.id.ll__place_latlon:
- final double lat = mMapObject.getLat();
- final double lon = mMapObject.getLon();
- items.add(Framework.nativeFormatLatLon(lat, lon, false));
- items.add(Framework.nativeFormatLatLon(lat, lon, true));
- break;
- case R.id.ll__place_website:
- items.add(mTvWebsite.getText().toString());
- break;
- case R.id.ll__place_email:
- items.add(mTvEmail.getText().toString());
- break;
- case R.id.ll__place_phone:
- items.add(mTvPhone.getText().toString());
- break;
- case R.id.ll__place_schedule:
- items.add(mFullOpeningHours.getText().toString());
- break;
- case R.id.ll__place_operator:
- items.add(mTvOperator.getText().toString());
- break;
- case R.id.ll__place_wiki:
- items.add(mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA));
- break;
+ case R.id.ll__place_latlon:
+ final double lat = mMapObject.getLat();
+ final double lon = mMapObject.getLon();
+ items.add(Framework.nativeFormatLatLon(lat, lon, false));
+ items.add(Framework.nativeFormatLatLon(lat, lon, true));
+ break;
+ case R.id.ll__place_website:
+ items.add(mTvWebsite.getText().toString());
+ break;
+ case R.id.ll__place_email:
+ items.add(mTvEmail.getText().toString());
+ break;
+ case R.id.ll__place_phone:
+ items.add(mTvPhone.getText().toString());
+ break;
+ case R.id.ll__place_schedule:
+ items.add(mFullOpeningHours.getText().toString());
+ break;
+ case R.id.ll__place_operator:
+ items.add(mTvOperator.getText().toString());
+ break;
+ case R.id.ll__place_wiki:
+ items.add(mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA));
+ break;
}
final String copyText = getResources().getString(android.R.string.copy);
diff --git a/android/src/com/mapswithme/maps/widget/placepage/ReviewAdapter.java b/android/src/com/mapswithme/maps/widget/placepage/ReviewAdapter.java
index 90ef5d214e..8c91269b81 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/ReviewAdapter.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/ReviewAdapter.java
@@ -1,9 +1,6 @@
package com.mapswithme.maps.widget.placepage;
-import com.mapswithme.maps.R;
-import com.mapswithme.maps.review.Review;
-import com.mapswithme.util.UiUtils;
-
+import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.view.LayoutInflater;
@@ -12,71 +9,93 @@ import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
+import com.mapswithme.maps.R;
+import com.mapswithme.maps.review.Review;
+import com.mapswithme.util.UiUtils;
+
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;
-class ReviewAdapter extends BaseAdapter {
+class ReviewAdapter extends BaseAdapter
+{
private static final int MAX_COUNT = 3;
- private ArrayList<Review> items = new ArrayList<>();
+ @NonNull
+ private ArrayList<Review> mItems = new ArrayList<>();
@Override
- public int getCount() {
- if (items.size() > MAX_COUNT) {
- return MAX_COUNT;
- }
- return items.size();
+ public int getCount()
+ {
+ return mItems.size() > MAX_COUNT ? MAX_COUNT : mItems.size();
}
@Override
- public Object getItem(int position) {
- return items.get(position);
+ public Object getItem(int position)
+ {
+ return mItems.get(position);
}
@Override
- public long getItemId(int position) {
+ public long getItemId(int position)
+ {
return position;
}
@Override
- public View getView(int position, View convertView, ViewGroup parent) {
+ public View getView(int position, View convertView, ViewGroup parent)
+ {
ViewHolder holder;
- if (convertView == null) {
+ if (convertView == null)
+ {
convertView = LayoutInflater.from(parent.getContext())
- .inflate(R.layout.item_comment, parent, false);
+ .inflate(R.layout.item_comment, parent, false);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
- } else {
+ }
+ else
+ {
holder = (ViewHolder) convertView.getTag();
}
- holder.bind(items.get(position), position > 0);
+ holder.bind(mItems.get(position), position > 0);
return convertView;
}
- public void setItems(
- ArrayList<Review> items) {
- this.items = items;
+ public void setItems(@NonNull ArrayList<Review> items)
+ {
+ this.mItems = items;
notifyDataSetChanged();
}
- public ArrayList<Review> getItems() {
- return items;
+ @NonNull
+ public ArrayList<Review> getItems()
+ {
+ return mItems;
}
- private static class ViewHolder {
+ private static class ViewHolder
+ {
+ @NonNull
final View mDivider;
+ @NonNull
final TextView mUserName;
+ @NonNull
final TextView mCommentDate;
+ @NonNull
final TextView mRating;
+ @NonNull
final View mPositiveReview;
+ @NonNull
final TextView mTvPositiveReview;
+ @NonNull
final View mNegativeReview;
+ @NonNull
final TextView mTvNegativeReview;
- public ViewHolder(View view) {
+ public ViewHolder(View view)
+ {
mDivider = view.findViewById(R.id.v__divider);
mUserName = (TextView) view.findViewById(R.id.tv__user_name);
mCommentDate = (TextView) view.findViewById(R.id.tv__comment_date);
@@ -87,24 +106,31 @@ class ReviewAdapter extends BaseAdapter {
mTvNegativeReview = (TextView) view.findViewById(R.id.tv__negative_review);
}
- public void bind(Review item, boolean isShowDivider) {
+ public void bind(Review item, boolean isShowDivider)
+ {
UiUtils.showIf(isShowDivider, mDivider);
mUserName.setText(item.getAuthor());
Date date = new Date(item.getDate());
mCommentDate.setText(DateFormat.getMediumDateFormat(mCommentDate.getContext()).format(date));
mRating.setText(String.format(Locale.getDefault(), "%.1f", item.getRating()));
- if (TextUtils.isEmpty(item.getReviewPositive())) {
+ if (TextUtils.isEmpty(item.getReviewPositive()))
+ {
UiUtils.hide(mPositiveReview);
- } else {
+ }
+ else
+ {
UiUtils.show(mPositiveReview);
mTvPositiveReview.setText(item.getReviewPositive());
}
- if (TextUtils.isEmpty(item.getReviewNegative())) {
+ if (TextUtils.isEmpty(item.getReviewNegative()))
+ {
UiUtils.hide(mNegativeReview);
- } else {
+ }
+ else
+ {
UiUtils.show(mNegativeReview);
mTvNegativeReview.setText(item.getReviewNegative());
}
}
}
-} \ No newline at end of file
+}
diff --git a/android/src/com/mapswithme/maps/widget/placepage/SponsoredHotel.java b/android/src/com/mapswithme/maps/widget/placepage/SponsoredHotel.java
index dc3da30561..1ef4c46d28 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/SponsoredHotel.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/SponsoredHotel.java
@@ -1,135 +1,194 @@
package com.mapswithme.maps.widget.placepage;
+import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import android.text.TextUtils;
-import java.lang.ref.WeakReference;
-import java.util.HashMap;
-import java.util.Map;
-
import com.mapswithme.maps.bookmarks.data.MapObject;
import com.mapswithme.maps.bookmarks.data.Metadata;
import com.mapswithme.maps.gallery.Image;
import com.mapswithme.maps.review.Review;
+import java.lang.ref.WeakReference;
+import java.util.HashMap;
+import java.util.Map;
+
@UiThread
-final class SponsoredHotel
+public final class SponsoredHotel
{
private static class Price
{
- final String price;
- final String currency;
+ @NonNull
+ final String mPrice;
+ @NonNull
+ final String mCurrency;
- private Price(String price, String currency)
+ private Price(@NonNull String price, @NonNull String currency)
{
- this.price = price;
- this.currency = currency;
+ mPrice = price;
+ mCurrency = currency;
}
}
- static class FacilityType {
- private final String key;
- private final String name;
+ static class FacilityType
+ {
+ @NonNull
+ private final String mKey;
+ @NonNull
+ private final String mName;
- public FacilityType(String key, String name) {
- this.key = key;
- this.name = name;
+ public FacilityType(@NonNull String key, @NonNull String name)
+ {
+ mKey = key;
+ mName = name;
}
- public String getKey() {
- return key;
+ @NonNull
+ public String getKey()
+ {
+ return mKey;
}
- public String getName() {
- return name;
+ @NonNull
+ public String getName()
+ {
+ return mName;
}
}
- static class NearbyObject {
- private final String category;
- private final String title;
- private final String distance;
- private final double latitude;
- private final double longitude;
-
- public NearbyObject(String category, String title, String distance, double lat, double lon) {
- this.category = category;
- this.title = title;
- this.distance = distance;
- this.latitude = lat;
- this.longitude = lon;
+ static class NearbyObject
+ {
+ @NonNull
+ private final String mCategory;
+ @NonNull
+ private final String mTitle;
+ @NonNull
+ private final String mDistance;
+ private final double mLatitude;
+ private final double mLongitude;
+
+ public NearbyObject(@NonNull String category, @NonNull String title,
+ @NonNull String distance, double lat, double lon)
+ {
+ mCategory = category;
+ mTitle = title;
+ mDistance = distance;
+ mLatitude = lat;
+ mLongitude = lon;
}
- public String getCategory() {
- return category;
+ @NonNull
+ public String getCategory()
+ {
+ return mCategory;
}
- public String getTitle() {
- return title;
+ @NonNull
+ public String getTitle()
+ {
+ return mTitle;
}
- public String getDistance() {
- return distance;
+ @NonNull
+ public String getDistance()
+ {
+ return mDistance;
}
- public double getLatitude() {
- return latitude;
+ public double getLatitude()
+ {
+ return mLatitude;
}
- public double getLongitude() {
- return longitude;
+ public double getLongitude()
+ {
+ return mLongitude;
}
}
- static class HotelInfo {
- final String description;
- final Image[] photos;
- final FacilityType[] facilities;
- final Review[] reviews;
- final NearbyObject[] nearby;
-
- public HotelInfo(String description, Image[] photos,
- FacilityType[] facilities, Review[] reviews,
- NearbyObject[] nearby) {
- this.description = description;
- this.photos = photos;
- this.facilities = facilities;
- this.reviews = reviews;
- this.nearby = nearby;
+ static class HotelInfo
+ {
+ @Nullable
+ final String mDescription;
+ @Nullable
+ final Image[] mPhotos;
+ @Nullable
+ final FacilityType[] mFacilities;
+ @Nullable
+ final Review[] mReviews;
+ @Nullable
+ final NearbyObject[] mNearby;
+
+ public HotelInfo(@Nullable String description, @Nullable Image[] photos,
+ @Nullable FacilityType[] facilities, @Nullable Review[] reviews,
+ @Nullable NearbyObject[] nearby)
+ {
+ mDescription = description;
+ mPhotos = photos;
+ mFacilities = facilities;
+ mReviews = reviews;
+ mNearby = nearby;
}
}
interface OnPriceReceivedListener
{
- void onPriceReceived(String id, String price, String currency);
+ /**
+ * This method is called from the native core on the UI thread
+ * when the Hotel price will be obtained
+ *
+ * @param id A hotel id
+ * @param price A price
+ * @param currency A price currency
+ */
+ @UiThread
+ void onPriceReceived(@NonNull String id, @NonNull String price, @NonNull String currency);
}
interface OnInfoReceivedListener
{
- void onInfoReceived(String id, HotelInfo info);
+ /**
+ * This method is called from the native core on the UI thread
+ * when the Hotel information will be obtained
+ *
+ * @param id A hotel id
+ * @param info A hotel info
+ */
+ @UiThread
+ void onInfoReceived(@NonNull String id, @NonNull HotelInfo info);
}
// Hotel ID -> Price
+ @NonNull
private static final Map<String, Price> sPriceCache = new HashMap<>();
// Hotel ID -> Description
+ @NonNull
private static final Map<String, HotelInfo> sInfoCache = new HashMap<>();
- private static WeakReference<OnPriceReceivedListener> sPriceListener;
- private static WeakReference<OnInfoReceivedListener> sInfoListener;
+ @NonNull
+ private static WeakReference<OnPriceReceivedListener> sPriceListener = new WeakReference<>(null);
+ @NonNull
+ private static WeakReference<OnInfoReceivedListener> sInfoListener = new WeakReference<>(null);
+ @Nullable
private String mId;
- final String rating;
- final String price;
- final String urlBook;
- final String urlDescription;
-
- public SponsoredHotel(String rating, String price, String urlBook, String urlDescription)
+ @NonNull
+ final String mRating;
+ @NonNull
+ final String mPrice;
+ @NonNull
+ final String mUrlBook;
+ @NonNull
+ final String mUrlDescription;
+
+ public SponsoredHotel(@NonNull String rating, @NonNull String price, @NonNull String urlBook,
+ @NonNull String urlDescription)
{
- this.rating = rating;
- this.price = price;
- this.urlBook = urlBook;
- this.urlDescription = urlDescription;
+ mRating = rating;
+ mPrice = price;
+ mUrlBook = urlBook;
+ mUrlDescription = urlDescription;
}
void updateId(MapObject point)
@@ -137,50 +196,71 @@ final class SponsoredHotel
mId = point.getMetadata(Metadata.MetadataType.FMD_SPONSORED_ID);
}
+ @Nullable
public String getId()
{
return mId;
}
+ @NonNull
public String getRating()
{
- return rating;
+ return mRating;
}
+ @NonNull
public String getPrice()
{
- return price;
+ return mPrice;
}
+ @NonNull
public String getUrlBook()
{
- return urlBook;
+ return mUrlBook;
}
+ @NonNull
public String getUrlDescription()
{
- return urlDescription;
+ return mUrlDescription;
}
- static void setPriceListener(OnPriceReceivedListener listener)
+ static void setPriceListener(@NonNull OnPriceReceivedListener listener)
{
sPriceListener = new WeakReference<>(listener);
}
- static void setInfoListener(OnInfoReceivedListener listener)
+ static void setInfoListener(@NonNull OnInfoReceivedListener listener)
{
sInfoListener = new WeakReference<>(listener);
}
+ /**
+ * Make request to obtain hotel price information.
+ * This method also checks cache for requested hotel id
+ * and if cache exists - call {@link #onPriceReceived(String, String, String) onPriceReceived} immediately
+ *
+ * @param id A Hotel id
+ * @param currencyCode A user currency
+ */
static void requestPrice(String id, String currencyCode)
{
Price p = sPriceCache.get(id);
if (p != null)
- onPriceReceived(id, p.price, p.currency);
+ onPriceReceived(id, p.mPrice, p.mCurrency);
nativeRequestPrice(id, currencyCode);
}
+ /**
+ * Make request to obtain hotel information.
+ * This method also checks cache for requested hotel id
+ * and if cache exists - call {@link #onInfoReceived(String, HotelInfo) onInfoReceived} immediately
+ *
+ * @param id A Hotel id
+ * @param locale A user locale
+ */
static void requestInfo(String id, String locale)
{
HotelInfo info = sInfoCache.get(id);
@@ -190,38 +270,33 @@ final class SponsoredHotel
nativeRequestInfo(id, locale);
}
- @SuppressWarnings("unused")
- private static void onPriceReceived(String id, String price, String currency)
+ private static void onPriceReceived(@NonNull String id, @NonNull String price,
+ @NonNull String currency)
{
if (TextUtils.isEmpty(price))
return;
sPriceCache.put(id, new Price(price, currency));
+
OnPriceReceivedListener listener = sPriceListener.get();
- if (listener == null)
- sPriceListener = null;
- else
+ if (listener != null)
listener.onPriceReceived(id, price, currency);
}
- @SuppressWarnings("unused")
- private static void onInfoReceived(String id, HotelInfo info)
+ private static void onInfoReceived(@NonNull String id, @NonNull HotelInfo info)
{
- if (info == null)
- return;
-
sInfoCache.put(id, info);
OnInfoReceivedListener listener = sInfoListener.get();
- if (listener == null)
- sInfoListener = null;
- else
+ if (listener != null)
listener.onInfoReceived(id, info);
}
@Nullable
public static native SponsoredHotel nativeGetCurrent();
- private static native void nativeRequestPrice(String id, String currencyCode);
- private static native void nativeRequestInfo(String id, String locale);
+
+ private static native void nativeRequestPrice(@NonNull String id, @NonNull String currencyCode);
+
+ private static native void nativeRequestInfo(@NonNull String id, @NonNull String locale);
}
diff --git a/android/src/com/mapswithme/maps/widget/recycler/DividerItemDecoration.java b/android/src/com/mapswithme/maps/widget/recycler/DividerItemDecoration.java
index a7624fab85..ea3d6f0da1 100644
--- a/android/src/com/mapswithme/maps/widget/recycler/DividerItemDecoration.java
+++ b/android/src/com/mapswithme/maps/widget/recycler/DividerItemDecoration.java
@@ -3,6 +3,7 @@ package com.mapswithme.maps.widget.recycler;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
+import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
@@ -11,9 +12,11 @@ import android.view.View;
* Adds interior dividers to a RecyclerView with a LinearLayoutManager or its
* subclass.
*/
-public class DividerItemDecoration extends RecyclerView.ItemDecoration {
+public class DividerItemDecoration extends RecyclerView.ItemDecoration
+{
- private Drawable mDivider;
+ @NonNull
+ private final Drawable mDivider;
private int mOrientation;
/**
@@ -22,7 +25,8 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
*
* @param divider A divider {@code Drawable} to be drawn on the RecyclerView
*/
- public DividerItemDecoration(Drawable divider) {
+ public DividerItemDecoration(@NonNull Drawable divider)
+ {
mDivider = divider;
}
@@ -31,15 +35,15 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
*
* @param canvas The {@link Canvas} onto which dividers will be drawn
* @param parent The RecyclerView onto which dividers are being added
- * @param state The current RecyclerView.State of the RecyclerView
+ * @param state The current RecyclerView.State of the RecyclerView
*/
@Override
- public void onDraw(Canvas canvas, RecyclerView parent, RecyclerView.State state) {
- if (mOrientation == LinearLayoutManager.HORIZONTAL) {
+ public void onDraw(Canvas canvas, RecyclerView parent, RecyclerView.State state)
+ {
+ if (mOrientation == LinearLayoutManager.HORIZONTAL)
drawHorizontalDividers(canvas, parent);
- } else if (mOrientation == LinearLayoutManager.VERTICAL) {
+ else if (mOrientation == LinearLayoutManager.VERTICAL)
drawVerticalDividers(canvas, parent);
- }
}
/**
@@ -48,24 +52,23 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
*
* @param outRect The {@link Rect} of offsets to be added around the child
* view
- * @param view The child view to be decorated with an offset
- * @param parent The RecyclerView onto which dividers are being added
- * @param state The current RecyclerView.State of the RecyclerView
+ * @param view The child view to be decorated with an offset
+ * @param parent The RecyclerView onto which dividers are being added
+ * @param state The current RecyclerView.State of the RecyclerView
*/
@Override
- public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
+ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state)
+ {
super.getItemOffsets(outRect, view, parent, state);
- if (parent.getChildAdapterPosition(view) == 0) {
+ if (parent.getChildAdapterPosition(view) == 0)
return;
- }
mOrientation = ((LinearLayoutManager) parent.getLayoutManager()).getOrientation();
- if (mOrientation == LinearLayoutManager.HORIZONTAL) {
+ if (mOrientation == LinearLayoutManager.HORIZONTAL)
outRect.left = mDivider.getIntrinsicWidth();
- } else if (mOrientation == LinearLayoutManager.VERTICAL) {
+ else if (mOrientation == LinearLayoutManager.VERTICAL)
outRect.top = mDivider.getIntrinsicHeight();
- }
}
/**
@@ -77,12 +80,14 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
* @param parent The RecyclerView onto which horizontal dividers are being
* added
*/
- private void drawHorizontalDividers(Canvas canvas, RecyclerView parent) {
+ private void drawHorizontalDividers(Canvas canvas, RecyclerView parent)
+ {
int parentTop = parent.getPaddingTop();
int parentBottom = parent.getHeight() - parent.getPaddingBottom();
int childCount = parent.getChildCount();
- for (int i = 0; i < childCount - 1; i++) {
+ for (int i = 0; i < childCount - 1; i++)
+ {
View child = parent.getChildAt(i);
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
@@ -104,12 +109,14 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
* @param parent The RecyclerView onto which vertical dividers are being
* added
*/
- private void drawVerticalDividers(Canvas canvas, RecyclerView parent) {
+ private void drawVerticalDividers(Canvas canvas, RecyclerView parent)
+ {
int parentLeft = parent.getPaddingLeft();
int parentRight = parent.getWidth() - parent.getPaddingRight();
int childCount = parent.getChildCount();
- for (int i = 0; i < childCount - 1; i++) {
+ for (int i = 0; i < childCount - 1; i++)
+ {
View child = parent.getChildAt(i);
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
diff --git a/android/src/com/mapswithme/maps/widget/recycler/GridDividerItemDecoration.java b/android/src/com/mapswithme/maps/widget/recycler/GridDividerItemDecoration.java
index abfd10496e..1dc7334c46 100644
--- a/android/src/com/mapswithme/maps/widget/recycler/GridDividerItemDecoration.java
+++ b/android/src/com/mapswithme/maps/widget/recycler/GridDividerItemDecoration.java
@@ -3,17 +3,21 @@ package com.mapswithme.maps.widget.recycler;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
+import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/**
* Adds interior dividers to a RecyclerView with a GridLayoutManager.
*/
-public class GridDividerItemDecoration extends RecyclerView.ItemDecoration {
+public class GridDividerItemDecoration extends RecyclerView.ItemDecoration
+{
- private Drawable mHorizontalDivider;
- private Drawable mVerticalDivider;
- private int mNumColumns;
+ @NonNull
+ private final Drawable mHorizontalDivider;
+ @NonNull
+ private final Drawable mVerticalDivider;
+ private final int mNumColumns;
/**
* Sole constructor. Takes in {@link Drawable} objects to be used as
@@ -21,11 +25,13 @@ public class GridDividerItemDecoration extends RecyclerView.ItemDecoration {
*
* @param horizontalDivider A divider {@code Drawable} to be drawn on the
* rows of the grid of the RecyclerView
- * @param verticalDivider A divider {@code Drawable} to be drawn on the
- * columns of the grid of the RecyclerView
- * @param numColumns The number of columns in the grid of the RecyclerView
+ * @param verticalDivider A divider {@code Drawable} to be drawn on the
+ * columns of the grid of the RecyclerView
+ * @param numColumns The number of columns in the grid of the RecyclerView
*/
- public GridDividerItemDecoration(Drawable horizontalDivider, Drawable verticalDivider, int numColumns) {
+ public GridDividerItemDecoration(@NonNull Drawable horizontalDivider,
+ @NonNull Drawable verticalDivider, int numColumns)
+ {
mHorizontalDivider = horizontalDivider;
mVerticalDivider = verticalDivider;
mNumColumns = numColumns;
@@ -36,10 +42,11 @@ public class GridDividerItemDecoration extends RecyclerView.ItemDecoration {
*
* @param canvas The {@link Canvas} onto which dividers will be drawn
* @param parent The RecyclerView onto which dividers are being added
- * @param state The current RecyclerView.State of the RecyclerView
+ * @param state The current RecyclerView.State of the RecyclerView
*/
@Override
- public void onDraw(Canvas canvas, RecyclerView parent, RecyclerView.State state) {
+ public void onDraw(Canvas canvas, RecyclerView parent, RecyclerView.State state)
+ {
drawHorizontalDividers(canvas, parent);
drawVerticalDividers(canvas, parent);
}
@@ -49,23 +56,22 @@ public class GridDividerItemDecoration extends RecyclerView.ItemDecoration {
* RecyclerView.
*
* @param outRect The {@link Rect} of offsets to be added around the child view
- * @param view The child view to be decorated with an offset
- * @param parent The RecyclerView onto which dividers are being added
- * @param state The current RecyclerView.State of the RecyclerView
+ * @param view The child view to be decorated with an offset
+ * @param parent The RecyclerView onto which dividers are being added
+ * @param state The current RecyclerView.State of the RecyclerView
*/
@Override
- public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
+ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state)
+ {
super.getItemOffsets(outRect, view, parent, state);
boolean childIsInLeftmostColumn = (parent.getChildAdapterPosition(view) % mNumColumns) == 0;
- if (!childIsInLeftmostColumn) {
+ if (!childIsInLeftmostColumn)
outRect.left = mHorizontalDivider.getIntrinsicWidth();
- }
boolean childIsInFirstRow = (parent.getChildAdapterPosition(view)) < mNumColumns;
- if (!childIsInFirstRow) {
+ if (!childIsInFirstRow)
outRect.top = mVerticalDivider.getIntrinsicHeight();
- }
}
/**
@@ -75,11 +81,13 @@ public class GridDividerItemDecoration extends RecyclerView.ItemDecoration {
* @param canvas The {@link Canvas} onto which dividers will be drawn
* @param parent The RecyclerView onto which dividers are being added
*/
- private void drawHorizontalDividers(Canvas canvas, RecyclerView parent) {
+ private void drawHorizontalDividers(Canvas canvas, RecyclerView parent)
+ {
int parentTop = parent.getPaddingTop();
int parentBottom = parent.getHeight() - parent.getPaddingBottom();
- for (int i = 0; i < mNumColumns; i++) {
+ for (int i = 0; i < mNumColumns; i++)
+ {
View child = parent.getChildAt(i);
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
@@ -98,17 +106,15 @@ public class GridDividerItemDecoration extends RecyclerView.ItemDecoration {
* @param canvas The {@link Canvas} onto which dividers will be drawn
* @param parent The RecyclerView onto which dividers are being added
*/
- private void drawVerticalDividers(Canvas canvas, RecyclerView parent) {
+ private void drawVerticalDividers(Canvas canvas, RecyclerView parent)
+ {
int parentLeft = parent.getPaddingLeft();
int parentRight = parent.getWidth() - parent.getPaddingRight();
int childCount = parent.getChildCount();
- int numChildrenOnLastRow = childCount % mNumColumns;
- int numRows = childCount / mNumColumns;
- if (numChildrenOnLastRow == 0) { // TODO: Replace this with math
- numRows--;
- }
- for (int i = 0; i < numRows; i++) {
+ int numRows = (childCount + (mNumColumns - 1)) / mNumColumns;
+ for (int i = 0; i < numRows - 1; i++)
+ {
View child = parent.getChildAt(i * mNumColumns);
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
@@ -119,4 +125,4 @@ public class GridDividerItemDecoration extends RecyclerView.ItemDecoration {
mVerticalDivider.draw(canvas);
}
}
-} \ No newline at end of file
+}
diff --git a/android/src/com/mapswithme/util/UiUtils.java b/android/src/com/mapswithme/util/UiUtils.java
index 55c329dc93..1e9fdfb469 100644
--- a/android/src/com/mapswithme/util/UiUtils.java
+++ b/android/src/com/mapswithme/util/UiUtils.java
@@ -7,6 +7,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Configuration;
import android.content.res.Resources;
+import android.graphics.Rect;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.AnyRes;
@@ -19,6 +20,7 @@ import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
+import android.view.MotionEvent;
import android.view.Surface;
import android.view.View;
import android.view.ViewTreeObserver;
@@ -339,6 +341,24 @@ public final class UiUtils
return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
}
+ public static boolean isViewTouched(@NonNull MotionEvent event, @NonNull View view)
+ {
+ if (UiUtils.isHidden(view))
+ return false;
+
+ int x = (int) event.getX();
+ int y = (int) event.getY();
+ int[] location = new int[2];
+ view.getLocationOnScreen(location);
+ int viewX = location[0];
+ int viewY = location[1];
+ int width = view.getWidth();
+ int height = view.getHeight();
+ Rect viewRect = new Rect(viewX, viewY, viewX + width, viewY + height);
+
+ return viewRect.contains(x, y);
+ }
+
// utility class
private UiUtils() {}
}
diff --git a/map/booking_api.cpp b/map/booking_api.cpp
index 95bad8fe36..1e3aef6e73 100644
--- a/map/booking_api.cpp
+++ b/map/booking_api.cpp
@@ -90,7 +90,7 @@ void BookingApi::GetMinPrice(string const & hotelId, string const & currency,
}
catch (my::Json::Exception const & e)
{
-// LOG(LERROR, (e.Msg()));
+ LOG(LERROR, (e.Msg()));
minPrice.clear();
priceCurrency.clear();
}
diff --git a/strings.txt b/strings.txt
index ed95cf256e..5f27356044 100644
--- a/strings.txt
+++ b/strings.txt
@@ -17909,6 +17909,10 @@
zh-Hant = 更多
sk = Viac
+ [placepage_more_reviews_button]
+ en = More Reviews
+ ru = Ещё отзывы
+
[bookingcom_book_button]
en = Book
ru = Забронировать
@@ -19919,3 +19923,13 @@
zh-Hant = 飯店搜尋結果現在還包含價格類別。\n我們還加入了超過 110,000 間飯店。
el = Τα αποτελέσματα αναζήτησης για ξενοδοχεία περιέχουν πλέον κατηγορία τιμής. \nΠροσθέσαμε επίσης περισσότερα από 110.000 ξενοδοχεία.
sk = Výsledky vyhľadávania hotelov odteraz obsahujú aj cenové kategórie. \nTiež sme pridali viac ako 110 000 hotelov.
+
+ [placepage_hotel_facilities]
+ comment = For place page hotel facilities block
+ en = Facilities
+ ru = Удобства
+
+ [placepage_hotel_nearby]
+ comment = For place page hotel nearby block
+ en = Nearby
+ ru = Рядом