Review UI Widget from Google Play
I need to implement a Reviews widget in my application, similar to that seen in Google Play. Image Below:
Are there any components our there that make it easier to do this? It would save time & trouble of implementing my own version.
I would create a custom layout for that.
A TextField for stars information, a progress bar to show the number of stars and another TextField to show the number of ratings. Everything rapped on a LinearLayout (orientation = horizontal) for proper alignment.
Implement RatingBar in android.
some sample links
I used a custom layout for this as cmota recommended.
The labels for the stars are a series of TextViews within a Relative layout
The rating bars are Imageviews in a Linearlayouts.
ImageView ratingOne = (ImageView) ratingsView.findViewById(R.id.ratingOne);
<LinearLayout android:layout_width="match_parent" android:layout_height="15dp" android:background="@android:color/white" > <ImageView android:id="@+id/ratings_length_one" android:layout_width="wrap_content" android:layout_height="15dp" android:background="@color/orange" /> </LinearLayout>
Each imageview has a fixed height : for example i use 15dp above
The width of the imageview is the my rating count
Then i change the layoutParams for each imageView according to the values
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(myRatingCount, ratingOne.getHeight());