forked from organicmaps/organicmaps
[android] Refactored UGCController a little bit
This commit is contained in:
parent
76f9429342
commit
e8ef05d17a
2 changed files with 4 additions and 7 deletions
|
@ -84,8 +84,6 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener
|
|||
|
||||
@Nullable
|
||||
private MapObject mMapObject;
|
||||
@Nullable
|
||||
private UGC mUgc;
|
||||
|
||||
public UGCController(@NonNull final PlacePageView placePage)
|
||||
{
|
||||
|
@ -203,8 +201,7 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener
|
|||
UiUtils.showIf(canUserRate(ugcUpdate), mLeaveReviewButton, mUgcAddRatingView);
|
||||
UiUtils.showIf(ugc != null, mSummaryRootView, mUgcMoreReviews);
|
||||
RatingView ratingView = (RatingView) mPreviewUgcInfoView.findViewById(R.id.rating_view);
|
||||
mUgc = ugc;
|
||||
if (mUgc == null)
|
||||
if (ugc == null)
|
||||
{
|
||||
mReviewCount.setText(ugcUpdate != null ? R.string.placepage_reviewed : R.string.placepage_no_reviews);
|
||||
ratingView.setRating(ugcUpdate == null ? Impress.NONE : Impress.COMING_SOON, rating);
|
||||
|
@ -214,9 +211,9 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener
|
|||
|
||||
Context context = mPlacePage.getContext();
|
||||
mReviewCount.setText(context.getString(R.string.placepage_summary_rating_description,
|
||||
String.valueOf(mUgc.getBasedOnCount())));
|
||||
String.valueOf(ugc.getBasedOnCount())));
|
||||
ratingView.setRating(Impress.values()[impress], rating);
|
||||
setSummaryViews(mUgc, impress, rating);
|
||||
setSummaryViews(ugc, impress, rating);
|
||||
setUserReviewAndRatingsView(ugcUpdate);
|
||||
List<UGC.Review> reviews = ugc.getReviews();
|
||||
if (reviews != null)
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.mapswithme.maps.R;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UGCRatingRecordsAdapter extends RecyclerView.Adapter<UGCRatingRecordsAdapter.ViewHolder>
|
||||
class UGCRatingRecordsAdapter extends RecyclerView.Adapter<UGCRatingRecordsAdapter.ViewHolder>
|
||||
{
|
||||
@NonNull
|
||||
private ArrayList<UGC.Rating> mItems = new ArrayList<>();
|
||||
|
|
Loading…
Add table
Reference in a new issue