forked from organicmaps/organicmaps
[android] Reviews amount is taken from 'info.m_scoreCount' field
This commit is contained in:
parent
13529ee13b
commit
58ef791c47
3 changed files with 7 additions and 4 deletions
|
@ -56,7 +56,7 @@ void PrepareClassRefs(JNIEnv * env, jclass sponsoredClass)
|
|||
env, g_hotelInfoClass,
|
||||
"(Ljava/lang/String;[Lcom/mapswithme/maps/gallery/Image;[Lcom/mapswithme/maps/widget/"
|
||||
"placepage/Sponsored$FacilityType;[Lcom/mapswithme/maps/review/Review;[Lcom/mapswithme/"
|
||||
"maps/widget/placepage/Sponsored$NearbyObject;)V");
|
||||
"maps/widget/placepage/Sponsored$NearbyObject;J)V");
|
||||
|
||||
// Sponsored(String rating, String price, String urlBook, String urlDescription)
|
||||
g_sponsoredClassConstructor = jni::GetConstructorID(
|
||||
|
@ -178,7 +178,7 @@ JNIEXPORT void JNICALL Java_com_mapswithme_maps_widget_placepage_Sponsored_nativ
|
|||
|
||||
env->CallStaticVoidMethod(g_sponsoredClass, g_infoCallback, jni::ToJavaString(env, hotelId),
|
||||
env->NewObject(g_hotelInfoClass, g_hotelInfoConstructor, description,
|
||||
photos, facilities, reviews, nearby));
|
||||
photos, facilities, reviews, nearby, hotelInfo.m_scoreCount));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -605,7 +605,7 @@ public class PlacePageView extends RelativeLayout
|
|||
mReviewAdapter.setItems(new ArrayList<>(Arrays.asList(info.mReviews)));
|
||||
mHotelRating.setText(mSponsored.getRating());
|
||||
mHotelRatingBase.setText(getResources().getQuantityString(R.plurals.place_page_booking_rating_base,
|
||||
info.mReviews.length, info.mReviews.length));
|
||||
info.mReviews.length, info.mReviewsAmount));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -132,16 +132,19 @@ public final class Sponsored
|
|||
final Review[] mReviews;
|
||||
@Nullable
|
||||
final NearbyObject[] mNearby;
|
||||
final long mReviewsAmount;
|
||||
|
||||
|
||||
public HotelInfo(@Nullable String description, @Nullable Image[] photos,
|
||||
@Nullable FacilityType[] facilities, @Nullable Review[] reviews,
|
||||
@Nullable NearbyObject[] nearby)
|
||||
@Nullable NearbyObject[] nearby, long reviewsAmount)
|
||||
{
|
||||
mDescription = description;
|
||||
mPhotos = photos;
|
||||
mFacilities = facilities;
|
||||
mReviews = reviews;
|
||||
mNearby = nearby;
|
||||
mReviewsAmount = reviewsAmount;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue