Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>//code block public void itemRatingPopup() { final AlertDialog.Builder popDialog = new AlertDialog.Builder( mainScreen); final RatingBar rating = new RatingBar(mainScreen); rating.setNumStars(5); rating.setStepSize(0.1f); rating.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); LinearLayout parent = new LinearLayout(mainScreen); parent.setGravity(Gravity.CENTER); parent.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); parent.addView(rating); // popDialog.setIcon(android.R.drawable.btn_star_big_on); popDialog.setTitle(mainScreen.getResources().getString( R.string.user_ratings)); popDialog.setView(parent); // Button OK popDialog.setPositiveButton(R.string.submit, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { String fanid = StorageManager.getInstance() .getSharedPrefs(mainScreen) .getString(AppConstants.PREFS_FAN_ID, "0"); if (fanid != null) { new SubmitUserRatingAsyncTask("Item", "" + item.getId(), fanid, rating.getRating()) .execute(); } dialog.dismiss(); } }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); popDialog.create(); popDialog.show(); } </code></pre> <p>your dialog UI will not show exactly 5 stars, it will may show any number of start because you have assign RatingBar as a root view of Dialog, for reference see the above code:</p> <pre><code> you can change rating programatically by below code: float myRating=0f; rating.setRating(myRating) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload