Search in sources :

Example 1 with UserReviewDialogBuilder

use of com.github.yeriomin.yalpstore.view.UserReviewDialogBuilder in project YalpStore by yeriomin.

the class Review method initUserReviewControls.

private void initUserReviewControls(final App app) {
    ((RatingBar) activity.findViewById(R.id.user_stars)).setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {

        @Override
        public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
            if (!fromUser) {
                return;
            }
            new UserReviewDialogBuilder(activity, Review.this, app.getPackageName()).show(getUpdatedUserReview(app.getUserReview(), (int) rating));
        }
    });
    activity.findViewById(R.id.user_review_edit).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            new UserReviewDialogBuilder(activity, Review.this, app.getPackageName()).show(app.getUserReview());
        }
    });
    activity.findViewById(R.id.user_review_delete).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            ReviewDeleteTask task = new ReviewDeleteTask();
            task.setFragment(Review.this);
            task.setContext(v.getContext());
            task.execute(app.getPackageName());
        }
    });
}
Also used : UserReviewDialogBuilder(com.github.yeriomin.yalpstore.view.UserReviewDialogBuilder) RatingBar(android.widget.RatingBar) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) ReviewDeleteTask(com.github.yeriomin.yalpstore.task.playstore.ReviewDeleteTask)

Aggregations

View (android.view.View)1 ImageView (android.widget.ImageView)1 RatingBar (android.widget.RatingBar)1 TextView (android.widget.TextView)1 ReviewDeleteTask (com.github.yeriomin.yalpstore.task.playstore.ReviewDeleteTask)1 UserReviewDialogBuilder (com.github.yeriomin.yalpstore.view.UserReviewDialogBuilder)1