Я использую RelativeLayout
в XML-дизайне главного экрана.
внутри него CustomScrollView
с показом RecyclerView
.
он работает нормально с обычными экранными устройствами, которые отображаются / фиксируются с размером экрана, но с большими экранами, такими как телефоны Samsung M20, он показывает дополнительное пространство между Recyclerview
и BottomView
Пожалуйста, обратите внимание на скриншот ниже:
Вот код XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.bocawestcc.cobaltmemberapp.util.CustomScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/rr_profileView"
android:fillViewport="true"
android:scrollbars="none" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_below="@+id/tv_name"
android:background="@color/colorWhite">
<RelativeLayout
android:id="@+id/card_notification"
android:layout_width="match_parent"
android:layout_marginTop="@dimen/default_margin"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_clubNews"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:backgroundTint="@color/colorOrange"
android:scaleType="centerInside"
android:visibility="visible"
android:src="@drawable/clun_news3" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:background="@drawable/text_cta"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_5"
android:layout_marginRight="@dimen/margin_5"
android:textAlignment="center"
android:gravity="center"
android:fontFamily="@font/sf_regular"
android:text=""
android:textColor="@color/colorOrange"
android:textSize="@dimen/text_20" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_clubNews"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/card_notification">
<TextView
android:id="@+id/tv_ClubNewsTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/color_texts"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:singleLine="true"
android:fontFamily="@font/sf_regular"
android:layout_marginTop="@dimen/margin_5"
android:text=""
android:layout_weight="0.7"
android:textSize="@dimen/text_18" />
<TextView
android:id="@+id/tv_ClubNewsDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/color_texts"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:fontFamily="@font/sf_regular"
android:layout_below="@+id/tv_ClubNewsTitle"
android:text=""
android:layout_weight="0.7"
android:textSize="@dimen/text_14" />
</LinearLayout>
</RelativeLayout>
<com.bocawestcc.cobaltmemberapp.custom.MyRecycler
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_below="@+id/toolbar"
android:background="@color/colorgbGrey"/>
<View
android:layout_width="match_parent"
android:layout_height="0.2dp"
android:background="@color/colorDividerGrey" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorLightWhite"
android:orientation="vertical">
<TextView
android:id="@+id/txt_sendUsFeedback"
android:layout_width="match_parent"
android:layout_height="20dp"
android:textColor="#3D3D3D"
android:textAlignment="center"
android:layout_marginTop="8dp"
android:layout_marginBottom="@dimen/padding_8"
android:visibility="visible"
android:gravity="bottom"
android:fontFamily="@font/sf_regular"
android:layout_gravity="bottom"
android:textSize="@dimen/text_14"
android:text="Send Us feedback" />
</LinearLayout>
</LinearLayout>
</com.bocawestcc.cobaltmemberapp.util.CustomScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
android:layout_weight="0"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/footer_height"
android:background="@color/colorLightWhite" />
</LinearLayout>
<RelativeLayout
android:id="@+id/rr_sendfeedback"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/v_toolbar"
android:visibility="gone">
<include layout="@layout/include_sendus_feed" />
</RelativeLayout>
</RelativeLayout>
Пожалуйста, предложите мне, как решить этот тип проблем дизайна.
Все предложения приветствуются.
Спасибо.!