Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badge goes below/behind another view #81

Open
emaillenin opened this issue Oct 18, 2018 · 0 comments
Open

Badge goes below/behind another view #81

emaillenin opened this issue Oct 18, 2018 · 0 comments

Comments

@emaillenin
Copy link

Here is my layout:

                  <android.support.constraint.ConstraintLayout
                    android:id="@+id/role_bat"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp"
                    android:layout_weight="1"
                    android:alpha="0.8">

                    <TextView
                        android:id="@+id/role_bat_title"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="5dp"
                        android:text="@string/role_bat"
                        android:textAlignment="center"
                        android:textAppearance="@style/TextAppearance.AppCompat.Bold"
                        app:layout_constraintBottom_toTopOf="@id/img_role_bat" />

                    <ImageView
                        android:id="@+id/img_role_bat"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:adjustViewBounds="true"
                        android:src="@drawable/role_bat"
                        app:layout_constraintBottom_toBottomOf="parent" />

                </android.support.constraint.ConstraintLayout>

My target view:

    @BindView(R.id.role_bat_title)
    TextView roleBatTitle;

How I am adding the badge:

new QBadgeView(this).  bindTarget(roleBatTitle).setBadgeNumber(mAdapter.getCountOfPlayers("batsman")).setGravityOffset(5, true);

Sample of what is happening now: note that the badge with 1 goes behind the image. If bind the badge to the imageview itself, the badge doesn't appear (maybe it is hiding under the image).

image

I want the badge to appear on the bottom right on top of the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant