~evilham/unchat-android

cce4d7d4d9e09d43ad98ab74d12b16bb5a5d6a85 — Benoit Marty 3 years ago 7c9b943
Use style instead of duplicating the whole layout file
4 files changed, 13 insertions(+), 110 deletions(-)

D vector/src/main/res/layout-land/view_state.xml
M vector/src/main/res/layout/view_state.xml
A vector/src/main/res/values-land/styles.xml
M vector/src/main/res/values/styles.xml
D vector/src/main/res/layout-land/view_state.xml => vector/src/main/res/layout-land/view_state.xml +0 -110
@@ 1,110 0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merge 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="8dp"
    tools:parentTag="android.widget.FrameLayout">

    <ProgressBar
        android:id="@+id/progressBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center" />


    <LinearLayout
        android:id="@+id/errorView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:orientation="vertical"
        android:padding="@dimen/layout_horizontal_margin"
        android:visibility="gone"
        tools:visibility="visible">

        <TextView
            android:id="@+id/errorMessageView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center"
            android:textColor="?riotx_text_primary"
            android:textSize="16sp"
            tools:text="Une erreur est survenue" />


        <com.google.android.material.button.MaterialButton
            android:id="@+id/errorRetryView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginTop="8dp"
            android:minWidth="190dp"
            android:text="@string/global_retry" />

    </LinearLayout>


    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/emptyView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:orientation="vertical"
        android:padding="@dimen/layout_horizontal_margin">

        <ImageView
            android:id="@+id/emptyImageView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginStart="20dp"
            android:layout_marginEnd="20dp"
            android:visibility="gone"
            app:layout_constraintBottom_toTopOf="@id/emptyTitleView"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_chainStyle="packed"
            tools:ignore="MissingPrefix"
            tools:src="@drawable/empty_state_dm" />

        <TextView
            android:id="@+id/emptyTitleView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="30dp"
            android:gravity="center"
            android:textColor="?riotx_text_primary"
            android:textSize="15sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toTopOf="@id/emptyMessageView"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/emptyImageView"
            app:layout_constraintVertical_chainStyle="packed"
            tools:text="@string/room_list_people_empty_title" />


        <TextView
            android:id="@+id/emptyMessageView"
            android:layout_width="220dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginTop="20dp"
            android:gravity="center"
            android:textColor="?riotx_text_secondary"
            android:textSize="14sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/emptyTitleView"
            app:layout_constraintVertical_chainStyle="packed"
            tools:text="@string/room_list_people_empty_body" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</merge>
\ No newline at end of file

M vector/src/main/res/layout/view_state.xml => vector/src/main/res/layout/view_state.xml +1 -0
@@ 57,6 57,7 @@

        <ImageView
            android:id="@+id/emptyImageView"
            style="@style/VectorEmptyImageView"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_gravity="center_horizontal"

A vector/src/main/res/values-land/styles.xml => vector/src/main/res/values-land/styles.xml +8 -0
@@ 0,0 1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="VectorEmptyImageView">
        <item name="android:visibility">gone</item>
    </style>

</resources>
\ No newline at end of file

M vector/src/main/res/values/styles.xml => vector/src/main/res/values/styles.xml +4 -0
@@ 3,4 3,8 @@

    <style name="Vector.PopupMenu" parent="Vector.PopupMenuBase" />

    <style name="VectorEmptyImageView">
        <item name="android:visibility">visible</item>
    </style>

</resources>
\ No newline at end of file