Дизайн выглядит пустым в Motorola G5s Plus - Android - PullRequest
0 голосов
/ 16 октября 2019

У меня пользовательский интерфейс, созданный в Relative, эта раскладка отлично работает на любом устройстве, маленьком или большом. Вот макет, я попробовал посмотреть образ G5s Plus для эмулятора Android

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/mainLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg_alpha_main"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">


    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
    android:id="@+id/swipeRefreshLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">


            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingStart="10dp"
                android:visibility="visible">

                <LinearLayout
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:layout_weight="1"
                    android:orientation="vertical">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Welcome"
                        android:textColor="@color/colorPrimary" />


                    <TextView
                        android:id="@+id/userName"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textColor="@color/colorPrimary"
                        android:textSize="22sp"
                        android:textStyle="bold"
                        tools:text="Hi User" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:orientation="vertical">

                    <ImageView
                        android:id="@+id/logoutBtn"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="top"
                        android:layout_marginTop="2dp"
                        android:background="?attr/selectableItemBackground"
                        android:padding="5dp"
                        app:srcCompat="@drawable/ic_logout" />

                    <TextView
                        android:id="@+id/versionCode"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="2dp"
                        android:gravity="center"
                        android:paddingEnd="2dp"
                        android:textSize="12sp"
                        android:textStyle="bold"
                        tools:text="v1.5" />
                </LinearLayout>

            </LinearLayout>
            <TextView
                android:id="@+id/newheader"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="10dp"
                android:layout_marginTop="10dp"
                android:text="@string/news_feed"
                android:textColor="@color/colorBlack"
                android:textSize="18sp"
                android:textStyle="bold" />
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="300dp">

                <ProgressBar
                    android:id="@+id/progressBar"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:visibility="gone" />

                <TextView
                    android:id="@+id/newFeedNoDataTv"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:layout_marginStart="10dp"
                    android:text="No Data Found"
                    android:textColor="@color/colorRed"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    android:visibility="gone" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/newFeedRv"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:visibility="gone"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    tools:listitem="@layout/newsfeed_items" />


                <com.github.demono.AutoScrollViewPager
                    android:id="@+id/view_pager"
                    app:stopWhenTouch="false"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>

               <!-- <cn.trinea.android.view.autoscrollviewpager.AutoScrollViewPager
                    android:id="@+id/view_pager"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />-->
            </RelativeLayout>



            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="10dp"
                    android:text="@string/menu"
                    android:textColor="@color/colorBlack"
                    android:textSize="18sp"
                    android:textStyle="bold" />





                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/serviceRv"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="5dp"
                    app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
                    app:spanCount="2"
                    tools:listitem="@layout/services_item" />


                <androidx.coordinatorlayout.widget.CoordinatorLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="5dp"
                    android:visibility="visible">

                    <androidx.cardview.widget.CardView
                        android:id="@+id/knowledgeShareCardView"
                        android:layout_width="match_parent"
                        android:layout_height="130dp"
                        android:layout_marginStart="5dp"
                        android:layout_marginTop="30dp"
                        android:layout_marginEnd="5dp"
                        android:layout_marginBottom="10dp"
                        app:cardCornerRadius="10dp"
                        app:cardElevation="5dp">

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:background="@drawable/bg_alpha_knowledgeshare"
                            android:orientation="vertical">
                            <TextView
                                android:id="@+id/serviceTitle"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="10dp"
                                android:layout_marginTop="50dp"
                                android:gravity="center"
                                android:text="Knowledge Share"
                                android:textColor="@color/colorBlack"
                                android:textSize="20sp"
                                android:textStyle="bold" />
                            <TextView
                                android:id="@+id/serviceSubTitle"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="10dp"
                                android:textColor="@color/darkGray"
                                tools:text="Administrator" />
                        </LinearLayout>
                    </androidx.cardview.widget.CardView>

                </androidx.coordinatorlayout.widget.CoordinatorLayout>
            </LinearLayout>


        </LinearLayout>


    </androidx.core.widget.NestedScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

</RelativeLayout>

Он работает нормальнодругие устройства, но не отображаются в Motorola G5s Plus, не получая никаких намеков, почему так, на устройстве установлен android 7.

...