diff options
author | Александр Зацепин <az@mapswithme.com> | 2017-10-10 19:17:47 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2017-10-11 10:18:57 +0300 |
commit | c816586c082d379d7d313c8f0014e4d63136465c (patch) | |
tree | c8f65d929aa9b097a379895855846faf9d6adb7a | |
parent | 4c96581eebef27bfb8b386192beb89ed13bcdb1f (diff) |
[android] Rebased on master and fixed compilation according last changes in ugc structuresbeta-1061
-rw-r--r-- | android/jni/com/mapswithme/maps/ugc/UGC.cpp | 18 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/ugc/UGC.java | 2 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/ugc/UGCController.java | 4 |
3 files changed, 12 insertions, 12 deletions
diff --git a/android/jni/com/mapswithme/maps/ugc/UGC.cpp b/android/jni/com/mapswithme/maps/ugc/UGC.cpp index fddcf0d6e5..aaabbbb60e 100644 --- a/android/jni/com/mapswithme/maps/ugc/UGC.cpp +++ b/android/jni/com/mapswithme/maps/ugc/UGC.cpp @@ -66,8 +66,8 @@ public: jni::TScopedLocalRef ugcUpdateResult(env, ToJavaUGCUpdate(env, ugcUpdate)); using namespace place_page; - int impress = static_cast<int>(rating::GetImpress(ugc.m_aggRating)); - std::string formattedRating = rating::GetRatingFormatted(ugc.m_aggRating); + int impress = static_cast<int>(rating::GetImpress(ugc.m_totalRating)); + std::string formattedRating = rating::GetRatingFormatted(ugc.m_totalRating); jni::TScopedLocalRef jrating(env, jni::ToJavaString(env, formattedRating)); env->CallStaticVoidMethod(m_ugcClass, m_onResult, ugcResult.get(), ugcUpdateResult.get(), @@ -104,11 +104,11 @@ private: { jni::TScopedLocalObjectArrayRef ratings(env, ToJavaRatings(env, ugc.m_ratings)); jni::TScopedLocalObjectArrayRef reviews(env, ToJavaReviews(env, ugc.m_reviews)); + jobject result = nullptr; - //TODO: use real values when core is ready. - if (true/* !ugc.IsEmpty() */) - result = env->NewObject(m_ugcClass, m_ugcCtor, ratings.get(), ugc.m_aggRating, - reviews.get(), 68/* ugc.m_basedOn */); + if (!ugc.IsEmpty()) + result = env->NewObject(m_ugcClass, m_ugcCtor, ratings.get(), ugc.m_totalRating, + reviews.get(), ugc.m_basedOn); return result; } @@ -116,9 +116,9 @@ private: { jni::TScopedLocalObjectArrayRef ratings(env, ToJavaRatings(env, ugcUpdate.m_ratings)); jni::TScopedLocalRef text(env, jni::ToJavaString(env, ugcUpdate.m_text.m_text)); + jobject result = nullptr; - //TODO: use real values when core is ready. - if (true/* !ugcUpdate.IsEmpty() */) + if (!ugcUpdate.IsEmpty()) result = env->NewObject(m_ugcUpdateClass, m_ugcUpdateCtor, ratings.get(), text.get()); return result; @@ -159,7 +159,7 @@ private: jobject ToJavaReview(JNIEnv * env, ugc::Review const & review) { jni::TScopedLocalRef text(env, jni::ToJavaString(env, review.m_text.m_text)); - jni::TScopedLocalRef author(env, jni::ToJavaString(env, review.m_author.m_name)); + jni::TScopedLocalRef author(env, jni::ToJavaString(env, review.m_author)); jobject result = env->NewObject(m_reviewClass, m_reviewCtor, text.get(), author.get(), static_cast<jlong>(ugc::DaysAgo(review.m_time))); ASSERT(result, ()); diff --git a/android/src/com/mapswithme/maps/ugc/UGC.java b/android/src/com/mapswithme/maps/ugc/UGC.java index 389b39c6c4..3c30edbe9c 100644 --- a/android/src/com/mapswithme/maps/ugc/UGC.java +++ b/android/src/com/mapswithme/maps/ugc/UGC.java @@ -65,7 +65,7 @@ public class UGC //TODO: remove it after core is ready. @NonNull - ArrayList<Rating> getUserRatings() + static ArrayList<Rating> getUserRatings() { return new ArrayList<Rating>(){ { diff --git a/android/src/com/mapswithme/maps/ugc/UGCController.java b/android/src/com/mapswithme/maps/ugc/UGCController.java index 4979286a35..c1f27ab9f1 100644 --- a/android/src/com/mapswithme/maps/ugc/UGCController.java +++ b/android/src/com/mapswithme/maps/ugc/UGCController.java @@ -48,12 +48,12 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener @Override public void onClick(View v) { - if (mUgc == null || mMapObject == null) + if (mMapObject == null) return; UGCEditorActivity.start((Activity) mPlacePage.getContext(), mMapObject.getTitle(), mMapObject.getFeatureId(), - mUgc.getUserRatings(), UGC.RATING_NONE, mMapObject.canBeReviewed()); + UGC.getUserRatings(), UGC.RATING_NONE, mMapObject.canBeReviewed()); } }; |