android - To draw a red circle with count on top corner of the app -
android - To draw a red circle with count on top corner of the app -
i new android , need display count on top right corner of app.
the main page have grid view. here xml code of page.
can show circle code?
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:id="@+id/lay_main" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#8c5630" android:orientation="vertical" > <relativelayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <gridview android:id="@+id/main_gridview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@+id/adview" android:layout_margin="5dp" android:layout_margintop="4dp" android:horizontalspacing="10dp" android:numcolumns="2" android:verticalspacing="10dp" > </gridview> <com.google.ads.adview android:id="@+id/adview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_gravity="center" ads:adsize="banner" ads:adunitid="@string/admob_id" ads:loadadoncreate="true" ads:testdevices="test_emulator, test_device_id" /> </relativelayout> </linearlayout>
yes can show it. take imageview
want draw circle. in java code set these line after initializing imageview
.
gradientdrawable gd = new gradientdrawable(); gd.setshape(gradientdrawable.oval); gd.setcolor(color.rgb(134, 135, 255)); gd.setcornerradius(5); gd.setstroke(4, color.rgb(255, 255, 255)); yourimageview.setimagedrawable(gd);
android
Comments
Post a Comment