[android] Fixed review notes

This commit is contained in:
Dmitry Donskoy 2018-08-08 15:51:14 +03:00 committed by Aleksey Belousov
parent b90c95a026
commit 783081698d
3 changed files with 12 additions and 17 deletions

View file

@ -165,15 +165,15 @@ JNIEXPORT void JNICALL Java_com_mapswithme_maps_widget_placepage_Sponsored_nativ
auto const price = blocks.m_totalMinPrice == BlockInfo::kIncorrectPrice
? ""
: std::to_string(blocks.m_totalMinPrice);
jni::TScopedLocalRef hotelPriceInfo(env, env->NewObject(g_priceInfoClass,
g_priceInfoConstructor,
jni::ToJavaString(env, hotelId),
jni::ToJavaString(env, price),
jni::ToJavaString(env, blocks.m_currency),
static_cast<jint>(env, blocks.m_maxDiscount),
static_cast<jboolean>(env, false)));
auto const hotelPriceInfo = env->NewObject(g_priceInfoClass,
g_priceInfoConstructor,
jni::ToJavaString(env, hotelId),
jni::ToJavaString(env, price),
jni::ToJavaString(env, blocks.m_currency),
static_cast<jint>(env, blocks.m_maxDiscount),
static_cast<jboolean>(env, false));
env->CallStaticVoidMethod(g_sponsoredClass, g_priceCallback, hotelPriceInfo.get());
env->CallStaticVoidMethod(g_sponsoredClass, g_priceCallback, hotelPriceInfo);
});
}

View file

@ -305,7 +305,7 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHol
boolean isNotPopular = mResult.getPopularity().getType() == Popularity.Type.NOT_POPULAR;
return isNotPopular || !mResult.description.popularityHasHigherPriority;
return isNotPopular || !mResult.description.hasPopularityHigherPriority;
}
private boolean isPopularVisible()
@ -316,7 +316,7 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHol
boolean isClosed = mResult.description.openNow == SearchResult.OPEN_NOW_NO;
return !isClosed || mResult.description.popularityHasHigherPriority;
return !isClosed || mResult.description.hasPopularityHigherPriority;
}
private void setBackground()

View file

@ -33,7 +33,7 @@ public class SearchResult implements SearchData, PopularityProvider
public final float rating;
public final int stars;
public final int openNow;
private final boolean mHasPopularityHigherPriority;
public final boolean hasPopularityHigherPriority;
public Description(FeatureId featureId, String featureType, String region, String distance,
String cuisine, String pricing, float rating, int stars, int openNow,
@ -48,12 +48,7 @@ public class SearchResult implements SearchData, PopularityProvider
this.rating = rating;
this.stars = stars;
this.openNow = openNow;
mHasPopularityHigherPriority = hasPopularityHigherPriority;
}
public boolean hasPopularityHigherPriority()
{
return mHasPopularityHigherPriority;
this.hasPopularityHigherPriority = hasPopularityHigherPriority;
}
}