Java Code Examples for android.widget.RatingBar

The following examples show how to use android.widget.RatingBar. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: FoodOrdering   Source File: Activity_QRcodeResult.java    License: Apache License 2.0 6 votes vote down vote up
private void initView() {
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
    foods_imageView = (ImageView) findViewById(R.id.foods_image_view);
    foods_ingredients_text = (TextView) findViewById(R.id.foods_ingredients_text);
    foods_description_text = (TextView) findViewById(R.id.foods_description_text);
    fab_comment = (FloatingActionButton) findViewById(R.id.fab_comment);
    ratingBar = (RatingBar) findViewById(R.id.ratingBar);
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    collapsingToolbar.setTitle(name);

    Glide.with(this).load(imageUrl).into(foods_imageView);
    foods_ingredients_text.setText("配料:" + ingredients);
    foods_description_text.setText("简介:" + description);
    ratingBar.setProgress(rating);
}
 
Example 2
Source Project: coursera-android   Source File: RatingsBarActivity.java    License: MIT License 6 votes vote down vote up
@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      
      final TextView tv = (TextView) findViewById(R.id.textView);
      final RatingBar bar = (RatingBar) findViewById(R.id.ratingbar);
    
      bar.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
	
      	// Called when the user swipes the RatingBar
      	@Override
	public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
		tv.setText("Rating:" + rating);
	}
});
  }
 
Example 3
Source Project: foodie-app   Source File: LocationFragment.java    License: Apache License 2.0 6 votes vote down vote up
public ViewHolder(View view,int viewType,MyItemClickListener myItemClickListener) {
    super(view);
    mView = view;
    mViewType=viewType;
    mItemClickListener = myItemClickListener;
    if (viewType == IS_HEADER) {
        headerView = (TextView) view.findViewById(R.id.my_location);
        headerView.setText("正在获取你的当前位置...");
        headerView.setOnClickListener(this);
        return;
    }
    mRestaurantImageView= (ImageView) view.findViewById(R.id.restaurant_image);
    mRestaurantNameView= (TextView) view.findViewById(R.id.restaurant_name_text);
    mScoreView= (RatingBar) view.findViewById(R.id.rating_bar);
    mCommentCountView= (TextView) view.findViewById(R.id.comment_count);
    mAveragePriceView= (TextView) view.findViewById(R.id.average_price);
    mKeywordView= (TextView) view.findViewById(R.id.keyword);
    mAddressVview= (TextView) view.findViewById(R.id.location);
    mDistanceView= (TextView) view.findViewById(R.id.distance);
    mItemClickListener=myItemClickListener;
    view.setOnClickListener(this);
}
 
Example 4
Source Project: codeexamples-android   Source File: RatingBar1.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.ratingbar_1);
    
    mRatingText = (TextView) findViewById(R.id.rating);

    // We copy the most recently changed rating on to these indicator-only
    // rating bars
    mIndicatorRatingBar = (RatingBar) findViewById(R.id.indicator_ratingbar);
    mSmallRatingBar = (RatingBar) findViewById(R.id.small_ratingbar);
    
    // The different rating bars in the layout. Assign the listener to us.
    ((RatingBar)findViewById(R.id.ratingbar1)).setOnRatingBarChangeListener(this);
    ((RatingBar)findViewById(R.id.ratingbar2)).setOnRatingBarChangeListener(this);
}
 
Example 5
Source Project: sa-sdk-android   Source File: ViewUtil.java    License: Apache License 2.0 6 votes vote down vote up
static boolean isTrackEvent(View view, boolean isFromUser) {
    if (view instanceof CheckBox) {
        if (!isFromUser) {
            return false;
        }
    } else if (view instanceof RadioButton) {
        if (!isFromUser) {
            return false;
        }
    } else if (view instanceof ToggleButton) {
        if (!isFromUser) {
            return false;
        }
    } else if (view instanceof CompoundButton) {
        if (!isFromUser) {
            return false;
        }
    }
    if (view instanceof RatingBar) {
        if (!isFromUser) {
            return false;
        }
    }
    return true;
}
 
Example 6
public TrainingSessionViewHolder(View v) {
    super(v);
    view = v;
    mCardViewLayout = (CardView) v.findViewById(R.id.card_training_session);
    mSmallLayout = (RelativeLayout) v.findViewById(R.id.card_training_session_small);
    mExpandedLayout = (LinearLayout) v.findViewById(R.id.card_training_session_expanded);
    mTextViewName = (TextView) v.findViewById(R.id.training_card_title);
    mTextViewDescription = (TextView) v.findViewById(R.id.training_card_description);
    mTextViewSteps = (TextView) v.findViewById(R.id.training_card_steps);
    mTextViewDistance = (TextView) v.findViewById(R.id.training_card_distance);
    mTextViewCalories = (TextView) v.findViewById(R.id.training_card_calories);
    mTextViewDuration = (TextView) v.findViewById(R.id.training_card_duration);
    mTextViewSmallSteps = (TextView) v.findViewById(R.id.training_small_card_steps);
    mTextViewSmallDuration = (TextView) v.findViewById(R.id.training_small_card_duration);
    mTextViewSmallDistance = (TextView) v.findViewById(R.id.training_small_card_distance);
    mTextViewSmallName = (TextView) v.findViewById(R.id.training_small_card_name);
    mTextViewDistanceTitle = (TextView) v.findViewById(R.id.distanceTitle);
    mTextViewSmallDistanceTitle = (TextView) v.findViewById(R.id.distance_title_small);
    mTextViewCaloriesTitle = (TextView) v.findViewById(R.id.calorieTitle);
    mRatingBarFeeling = (RatingBar) v.findViewById(R.id.training_card_feeling);
    mImageButton = (ImageButton) v.findViewById(R.id.training_card_menu);
    mImageButton.setOnClickListener(this);
    view.setOnClickListener(this);
}
 
Example 7
Source Project: KinoCast   Source File: ResultRecyclerAdapter.java    License: MIT License 5 votes vote down vote up
ViewHolder(View itemView) {
    super(itemView);
    background = itemView.findViewById(R.id.layoutInfo);
    image = (ImageView) itemView.findViewById(R.id.image);
    title = (TextView) itemView.findViewById(R.id.title);
    language = (ImageView) itemView.findViewById(R.id.language);
    rating = (RatingBar) itemView.findViewById(R.id.rating);
    detail = (TextView) itemView.findViewById(R.id.detail);
    progressBar = (ProgressBar) itemView.findViewById(R.id.progressBar);
    image.setVisibility(View.GONE);
}
 
Example 8
Source Project: xDrip   Source File: SendFeedBack.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_send_feed_back);
    send_url = getString(R.string.wserviceurl) + "/joh-feedback";

    myrating = (RatingBar) findViewById(R.id.ratingBar);
    ratingtext = (TextView) findViewById(R.id.ratingtext);
    contact = (EditText) findViewById(R.id.contactText);
    contact.setText(PersistentStore.getString(FEEDBACK_CONTACT_REFERENCE));

    Intent intent = getIntent();
    if (intent != null) {
        final Bundle bundle = intent.getExtras();
        if (bundle != null) {
            // TODO this probably should just use generic text method
            final String str = bundle.getString("request_translation");
            if (str != null) {
                // don't extract string - english only
                ((EditText) findViewById(R.id.yourText)).setText("Dear developers, please may I request that you add translation capability for: " + str + "\n\n");
                type_of_message = "Language request";

            }
            final String str2 = bundle.getString("generic_text");
            if (str2 != null) {
                log_data = str2;
                ((EditText) findViewById(R.id.yourText)).setText("\n\nPlease describe what you think these logs may show? Explain the problem if there is one.\n\nAttached " + log_data.length() + " characters of log data. (hidden)\n\n");
                type_of_message = "Log Push";
                myrating.setVisibility(View.GONE);
                ratingtext.setVisibility(View.GONE);
            }
        }
    }
    if (type_of_message.equals("Unknown")) {
        askType();
    }

}
 
Example 9
public void setRating(Long rating) {
            RatingBar product_rating_bar = (RatingBar) mView.findViewById(R.id.product_rating_bar);
            product_rating_bar.setVisibility(View.GONE);
//            SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(itemView.getContext());
//            boolean ratingDisplayCheck = SP.getBoolean("ratingButton", true);
//            if (ratingDisplayCheck == false)
//                product_rating_bar.setVisibility(View.INVISIBLE);
//            Log.d(TAG + " ratingDisplayCheck", ratingDisplayCheck + "");
        }
 
Example 10
Source Project: SmileEssence   Source File: ReviewDialogFragment.java    License: MIT License 5 votes vote down vote up
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_review, null);
    ratingBar = (RatingBar) view.findViewById(R.id.rating_review);
    Button button = (Button) view.findViewById(R.id.button_submit);
    button.setOnClickListener(this);
    return new AlertDialog.Builder(getActivity())
            .setView(view)
            .create();
}
 
Example 11
Source Project: android-basic-samples   Source File: MainActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
  mSaveGame.setLevelStars(mWorld, mLevel, (int) rating);
  updateUi();
  findViewById(R.id.screen_gameplay).setVisibility(View.GONE);
  findViewById(R.id.screen_main).setVisibility(View.VISIBLE);

  mInLevel = false;
  // save new data to cloud
  saveSnapshot(null);
}
 
Example 12
Source Project: Movie-Check   Source File: MovieDetailFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void showVoteAverage(float voteAverage) {
    textViewVoteCount.setVisibility(View.VISIBLE);
    RatingBar newRatingBar = new RatingBar(new ContextThemeWrapper(getActivity(), R.style.RatingBarAccent));
    newRatingBar.setRating(voteAverage / 2);
    newRatingBar.setIsIndicator(true);
    newRatingBar.setOnRatingBarChangeListener(onRatingBarChangeListener);
    ((ViewGroup) ratingBarVoteAverage.getParent()).addView(newRatingBar, 0);
    ((ViewGroup) ratingBarVoteAverage.getParent()).removeView(ratingBarVoteAverage);
    ratingBarVoteAverage = newRatingBar;
}
 
Example 13
Source Project: Movie-Check   Source File: MovieInterestListAdapter.java    License: Apache License 2.0 5 votes vote down vote up
public ViewHolder(View itemView) {
    super(itemView);
    imageViewMoviePoster = (ImageView) itemView.findViewById(R.id.imageview_movieposter);
    textViewMovieName = (TextView) itemView.findViewById(R.id.textview_moviename);
    textViewMovieReleaseDate = (TextView) itemView.findViewById(R.id.textview_moviereleasedate);
    textViewMovieVoteCount = (TextView) itemView.findViewById(R.id.textview_movievotecount);
    ratingBarVote = (RatingBar) itemView.findViewById(R.id.ratingbar_vote);
}
 
Example 14
Source Project: CineLog   Source File: KinoListAdapter.java    License: GNU General Public License v3.0 5 votes vote down vote up
private void initRating(View convertView, RatingBar kinoRatingRatingBar, KinoDto movie) {
    TextView kinoRatingRatingBarAsText = (TextView) convertView.findViewById(R.id.main_result_kino_rating_bar_as_text);
    TextView kinoRatingRatingBarMaxAsText = (TextView) convertView.findViewById(R.id.main_result_kino_rating_bar_max_as_text);

    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());

    int maxRating;
    if (movie.getMaxRating() == null) {
        String defaultMaxRateValue = prefs.getString("default_max_rate_value", "5");
        maxRating = Integer.parseInt(defaultMaxRateValue);
    } else {
        maxRating = movie.getMaxRating();
    }

    if (maxRating <= 5) {
        kinoRatingRatingBarAsText.setVisibility(View.INVISIBLE);
        kinoRatingRatingBarMaxAsText.setVisibility(View.INVISIBLE);
        kinoRatingRatingBar.setVisibility(View.VISIBLE);

        kinoRatingRatingBar.setStepSize(0.5f);
        kinoRatingRatingBar.setNumStars(maxRating);

        if (movie.getRating() != null) {
            kinoRatingRatingBar.setRating(movie.getRating());
        } else {
            kinoRatingRatingBar.setRating(0);
        }
    } else {
        kinoRatingRatingBar.setVisibility(View.INVISIBLE);
        kinoRatingRatingBarAsText.setVisibility(View.VISIBLE);
        kinoRatingRatingBarMaxAsText.setVisibility(View.VISIBLE);

        kinoRatingRatingBarAsText.setText(String.format("%s", movie.getRating()));
        kinoRatingRatingBarMaxAsText.setText(String.format("/%s", maxRating));
    }
}
 
Example 15
Source Project: FoodOrdering   Source File: Activity_FoodsDetails.java    License: Apache License 2.0 5 votes vote down vote up
private void initView() {
    nf = NumberFormat.getCurrencyInstance();
    nf.setMaximumFractionDigits(2);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
    foods_imageView = (ImageView) findViewById(R.id.foods_image_view);
    foods_ingredients_text = (TextView) findViewById(R.id.foods_ingredients_text);
    foods_description_text = (TextView) findViewById(R.id.foods_description_text);
    fab_comment = (FloatingActionButton) findViewById(R.id.fab_comment);
    ratingBar = (RatingBar) findViewById(R.id.ratingBar);
    tv_price = (TextView) findViewById(R.id.tv_price);
    tv_count = (TextView) findViewById(R.id.tvCount);
    tvMinus = (TextView) findViewById(R.id.tvMinus);
    tvAdd = (TextView) findViewById(R.id.tvAdd);
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    collapsingToolbar.setTitle(name);

    Glide.with(this).load(imageUrl).into(foods_imageView);
    tv_price.setText(nf.format(price));
    tv_count.setText(count + "");
    foods_ingredients_text.setText("配料:" + ingredients);
    foods_description_text.setText("简介:" + description);
    ratingBar.setProgress(rating);

    tvMinus.setOnClickListener(this);
    tvAdd.setOnClickListener(this);
    fab_comment.setOnClickListener(this);
}
 
Example 16
Source Project: FoodOrdering   Source File: Adapter_Comment.java    License: Apache License 2.0 5 votes vote down vote up
public ViewHolder(View itemView) {
    super(itemView);
    comment_item_view = itemView.findViewById(R.id.comment_item_view);

    food_img = (ImageView) itemView.findViewById(R.id.comment_food_img);
    tv_food_name = (TextView) itemView.findViewById(R.id.comment_food_name);
    tv_time = (TextView) itemView.findViewById(R.id.comment_time);
    ratingBar = (RatingBar) itemView.findViewById(R.id.comment_ratingBar);
    tv_content = (TextView) itemView.findViewById(R.id.comment_food_content);

}
 
Example 17
Source Project: sa-sdk-android   Source File: VisualUtil.java    License: Apache License 2.0 5 votes vote down vote up
public static boolean isSupportClick(View v) {
    ViewParent parent = v.getParent();
    if (parent instanceof AdapterView || ViewUtil.instanceOfRecyclerView(parent)) {
        return true;
    }
    if (v instanceof RatingBar || v instanceof SeekBar) {
        return true;
    }
    return false;
}
 
Example 18
Source Project: Movie-Check   Source File: MovieDetailFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void showUserClassification(Float classification) {
    textViewVoteCount.setVisibility(View.INVISIBLE);
    RatingBar newRatingBar = new RatingBar(new ContextThemeWrapper(getActivity(), R.style.RatingBarRed));
    newRatingBar.setRating(classification);
    newRatingBar.setIsIndicator(false);
    newRatingBar.setOnRatingBarChangeListener(onRatingBarChangeListener);
    ((ViewGroup) ratingBarVoteAverage.getParent()).addView(newRatingBar, 0);
    ((ViewGroup) ratingBarVoteAverage.getParent()).removeView(ratingBarVoteAverage);
    ratingBarVoteAverage = newRatingBar;

}
 
Example 19
@RequiresApi(api = Build.VERSION_CODES.O)
@NonNull
@Override
public ViewFinder setMinRating(final int ID, final int min) {
	((RatingBar) find(ID)).setMin(min);
	return this;
}
 
Example 20
@NonNull
@Override
public ViewFinder setRating(final int ID, final float rating, final int max) {
	final RatingBar ratingBar = find(ID);
	ratingBar.setRating(rating);
	ratingBar.setMax(max);
	return this;
}
 
Example 21
@RequiresApi(api = Build.VERSION_CODES.O)
@NonNull
@Override
public ViewFinder setRating(final int ID, final float rating, final int min, final int max) {
	final RatingBar ratingBar = find(ID);
	ratingBar.setRating(rating);
	ratingBar.setMin(min);
	ratingBar.setMax(max);
	return this;
}
 
Example 22
Source Project: Bailan   Source File: AppCommentController.java    License: Apache License 2.0 5 votes vote down vote up
private void init() {
    contentView = UIUtils.inflate(R.layout.appdetail_comment_score);
    commentScore = (TextView) contentView.findViewById(R.id.app_comment_score_textview);
    commentStars = (RatingBar) contentView.findViewById(R.id.detail_comment_colligation_stars_ratingbar);
    commentCount = (TextView) contentView.findViewById(R.id.detail_comments_count_textview);
    fiveStarsProgressBar = (ProgressBar) contentView.findViewById(R.id.detail_comment_five_stars_proportion_progressbar);
    fourStarsProgressBar = (ProgressBar) contentView.findViewById(R.id.detail_comment_four_stars_proportion_progressbar);
    threeStarsProgressBar = (ProgressBar) contentView.findViewById(R.id.detail_comment_three_stars_proportion_progressbar);
    twoStarsProgressBar = (ProgressBar) contentView.findViewById(R.id.detail_comment_two_stars_proportion_progressbar);
    oneStarsProgressBar = (ProgressBar) contentView.findViewById(R.id.detail_comment_one_stars_proportion_progressbar);
}
 
Example 23
Source Project: android   Source File: TVShowAdapter.java    License: Apache License 2.0 5 votes vote down vote up
private ViewHolder(View convertView) {
    mTitle = (TextView) convertView.findViewById(R.id.text1);
    mGenres = (TextView) convertView.findViewById(R.id.text2);
    mYear = (TextView) convertView.findViewById(R.id.text3);
    mRating = (RatingBar) convertView.findViewById(R.id.rating_bar1);
    mImageView = (ImageView) convertView.findViewById(R.id.image1);
}
 
Example 24
Source Project: JsonParsingDemo   Source File: DetailActivity.java    License: MIT License 5 votes vote down vote up
private void setUpUIViews() {
    ivMovieIcon = (ImageView)findViewById(R.id.ivIcon);
    tvMovie = (TextView)findViewById(R.id.tvMovie);
    tvTagline = (TextView)findViewById(R.id.tvTagline);
    tvYear = (TextView)findViewById(R.id.tvYear);
    tvDuration = (TextView)findViewById(R.id.tvDuration);
    tvDirector = (TextView)findViewById(R.id.tvDirector);
    rbMovieRating = (RatingBar)findViewById(R.id.rbMovie);
    tvCast = (TextView)findViewById(R.id.tvCast);
    tvStory = (TextView)findViewById(R.id.tvStory);
    progressBar = (ProgressBar)findViewById(R.id.progressBar);
}
 
Example 25
Source Project: FaceT   Source File: FavouriteProductFragment.java    License: Mozilla Public License 2.0 5 votes vote down vote up
public void setRating(Long rating) {
    RatingBar product_rating_bar = (RatingBar) mFavouriteProductView.findViewById(R.id.favourite_product_rating_bar);
    product_rating_bar.setRating(rating);
    SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(mFavouriteProductView.getContext());
    boolean ratingDisplayCheck = SP.getBoolean("ratingButton", true);
    if(ratingDisplayCheck == false)
        product_rating_bar.setVisibility(View.INVISIBLE);
    Log.d(TAG + " ratingDisplayCheck", ratingDisplayCheck + "");
}
 
Example 26
Source Project: baseAdapter   Source File: ViewHolder.java    License: Apache License 2.0 5 votes vote down vote up
public ViewHolder setRating(int viewId, float rating, int max)
{
    RatingBar view = getView(viewId);
    view.setMax(max);
    view.setRating(rating);
    return this;
}
 
Example 27
Source Project: RxJava2RetrofitDemo   Source File: MartianViewHolder.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public MartianViewHolder setRating(int viewId, float rating, int max) {
    RatingBar view = getView(viewId);
    view.setMax(max);
    view.setRating(rating);
    return this;
}
 
Example 28
Source Project: miappstore   Source File: AppInfosHolder.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public View initView() {
    View view = View.inflate(UiUtils.getContext(), R.layout.holder_appinfos, null);
    tv_name = (TextView) view.findViewById(R.id.tv_appname);
    iv_icon = (ImageView) view.findViewById(R.id.iv_icon);
    rb_score = (RatingBar) view.findViewById(R.id.rb_score);
    tv_size_publisher = (TextView) view.findViewById(R.id.tv_size_publisher);
    return view;
}
 
Example 29
Source Project: YalpStore   Source File: Review.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void clearUserReview() {
    ((RatingBar) activity.findViewById(R.id.user_stars)).setRating(0);
    setText(R.id.user_title, "");
    setText(R.id.user_comment, "");
    setText(R.id.rate, R.string.details_rate_this_app);
    activity.findViewById(R.id.user_review_edit_delete).setVisibility(View.GONE);
    activity.findViewById(R.id.user_review).setVisibility(View.GONE);
}
 
Example 30
Source Project: uPods-android   Source File: MediaItemsAdapter.java    License: Apache License 2.0 5 votes vote down vote up
public ViewHolderCardItem(View view) {
    super(view);
    this.imgSquare = (ImageViewSquare) view.findViewById(R.id.imgSquare);
    this.tvItemStatus = (TextView) view.findViewById(R.id.tvItemStatus);
    this.tvSquareTitle = (TextView) view.findViewById(R.id.tvSquareTitle);
    this.tvSquareSubTitle = (TextView) view.findViewById(R.id.tvSquareSubTitle);
    this.tvItemCount = (TextView) view.findViewById(R.id.tvItemCount);
    this.rbMediaItem = (RatingBar) view.findViewById(R.id.rbMediaItem);
    this.cvSquare = (CardView) view;
    Context context = view.getContext();
    LayerDrawable stars = (LayerDrawable) rbMediaItem.getProgressDrawable();
    stars.getDrawable(2).setColorFilter(context.getResources().getColor(R.color.starFullySelected), PorterDuff.Mode.SRC_ATOP);
    stars.getDrawable(1).setColorFilter(context.getResources().getColor(R.color.starPartiallySelected), PorterDuff.Mode.SRC_ATOP);
    stars.getDrawable(0).setColorFilter(context.getResources().getColor(R.color.starNotSelected), PorterDuff.Mode.SRC_ATOP);
}