Tagged with: Android UI on Android shopping Cart
The number of small red dots on the shopping cart has baffled 2 colleagues or kankan to solve them.
First look at the layout, the Includelayout loading a top menu bar
The specific layout file of the menu
<relativelayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Xmlns:tools= "Http://schemas.android.com/tools"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:background= "@color/bg_1" >
<textview
Android:id= "@+id/v_title_text_score"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
Android:layout_centerinparent= "true"
android:gravity= "Center"
Android:padding= "10DP"
android:text= "Home"
Android:textcolor= "@color/text_title"
Android:textsize= "@dimen/text_size_18"/>
<textview
Android:id= "@+id/v_title_left_score"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_alignparentleft= "true"
Android:layout_centervertical= "true"
Android:padding= "10DP"
Android:text= "Back"
Android:textcolor= "@color/text_color_2"
Android:textsize= "@dimen/text_size_16"
android:visibility= "Gone"/>
<!--<imageview
Android:id= "@+id/v_title_left_img_score"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_alignparentleft= "true"
Android:layout_centervertical= "true"
Android:padding= "10DP"
android:src= "@drawable/title_left_img"
android:visibility= "Visible"/>--
<imageview
Android:id= "@+id/v_title_left_img_score"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_alignparentleft= "true"
Android:layout_centervertical= "true"
android:src= "@drawable/title_left_img"
Android:adjustviewbounds= "true"
Android:maxwidth= "35DP"
android:maxheight= "30DP"
android:layout_marginleft= "10DP"
Android:scaletype= "Fitxy"
android:visibility= "Visible"/>
<textview
Android:id= "@+id/v_title_right_score"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_alignparentright= "true"
Android:layout_centervertical= "true"
Android:padding= "10DP"
Android:text= "Features"
Android:textcolor= "@color/text_color_2"
Android:textsize= "@dimen/text_size_16"
android:visibility= "Gone"/>
<imageview
Android:id= "@+id/v_title_right_cart"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_alignparentright= "true"
Android:layout_centervertical= "true"
android:layout_marginright= "14DP"
android:src= "@drawable/score_cart_empty"/>
<textview
Android:id= "@+id/v_title_right_number"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_alignparentright= "true"
android:layout_marginright= "8DP"
android:layout_margintop= "2DP"
Android:gravity= "Center_horizontal"
Android:layout_alignparenttop= "true"
android:background= "@drawable/score_top_icon3"
Android:padding= "2DP"
Android:textalignment= "TextEnd"
android:text= "9"
Android:textcolor= "@color/white"
Android:textsize= "8SP"
android:visibility= "Gone"/>
</RelativeLayout>
Java code
Change the quantity, direct SetText can be
Little Red dots on your Android shopping cart