Closed kagile closed 5 years ago
<app.com.tvrecyclerview.TvRecyclerView
android:id="@+id/rv_recommended_apps"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:focusScale="1.15"
app:fastScrollEnabled="false"
android:layout_marginTop="@dimen/dp_10"
app:scrollMode="followScroll" />
My row XML is:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/app_card"
android:layout_width="@dimen/dp_220"
android:layout_height="@dimen/dp_160"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fl_image_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<android.support.v7.widget.AppCompatImageView
android:id="@+id/iv_app_image"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_gravity="center"
android:scaleType="centerCrop" />
</FrameLayout>
<com.library.ui.widget.CustomTextView
android:id="@+id/tv_app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:clickable="false"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_5"
android:fontFamily="@font/raleway_regular"
android:gravity="start"
android:textColor="@color/white"
android:textSize="@dimen/font_24" />
</LinearLayout>
So, basically without a solid background, it fails.
This is not a bug. The amplification logic of item is to draw a layer on the original item. If the background of the item is transparent, there will be overlapping misalignment.
@henryblue Ok. Can you suggest me a quick fix? That would be helpful. Thanks.
You can add the 'isAutoProcessFocus' attribute, for example: <app.com.tvrecyclerview.TvRecyclerView android:id="@+id/rv_recommended_apps" android:layout_width="match_parent" android:layout_height="wrap_content" app:isAutoProcessFocus="false" app:fastScrollEnabled="false" android:layout_marginTop="@dimen/dp_10" app:scrollMode="followScroll" />
Then customize a zoom out layout to wrap the item, for example: https://github.com/henryblue/TvRecyclerView/blob/master/app/src/main/java/com/app/tvrecyclerview/view/FocusRelativeLayout.java
Specific you can refer to: https://github.com/henryblue/TvRecyclerView/blob/master/app/src/main/java/com/app/tvrecyclerview/maulCarouselActivity.java
Please find attached screenshot. I am using Auto Coursel example. Item scaling is duplicating and not scaled proper. What I want is just scale, not duplicate.