I'm extending CardView class because I want to create custom view for each row of my list view. this is my xml layout
<com.mojiapps.myquran.items.TranslationDownloadItemView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:foreground="?selectableItemBackground"
android:gravity="right"
card_view:cardCornerRadius="3dp"
card_view:cardElevation="3dp"
card_view:cardPreventCornerOverlap="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
...
</com.mojiapps.myquran.items.TranslationDownloadItemView>
and this is my java class
public class TranslationDownloadItemView extends CardView {
public TranslationDownloadItemView(Context context) {
super(context);
init();
}
public TranslationDownloadItemView(Context context, AttributeSet attrs) {
super(context, attrs);
}
private void init() {
LayoutInflater inflater = LayoutInflater.from(getContext());
inflater.inflate(R.layout.translation_type_row, this);
...
}
...
}
and this is the result
can anybody help me?
I had this issue setting the CardView background to something transparent. I solved it setting a non-alpha color.
Try to set your android:foreground
to something without alphas.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With