Reputation: 2897
I am trying a badge View as suggested in this link. I am trying with this code .
String count_str = Integer.toString(count);
TextView text_view = (TextView) findViewById(R.id.textView);
badge1 = new BadgeView(this, text_view);
badge1.setText(count_str);
badge1.show();
But the badge is appearing in the middle of the TextView. How can I put this badge in the right corner of the TextView?
Upvotes: 0
Views: 427
Reputation: 8231
Looking at the source code for DemoActivity
in this library, it appears the following method is responsible for the position of the badge:
badge1.setBadgePosition(BadgeView.POSITION_CENTER);
Edit
And the following options from the BadgeView
class:
public static final int POSITION_TOP_LEFT = 1;
public static final int POSITION_TOP_RIGHT = 2;
public static final int POSITION_BOTTOM_LEFT = 3;
public static final int POSITION_BOTTOM_RIGHT = 4;
public static final int POSITION_CENTER = 5;
Upvotes: 1