I try to align and justify all content of this RelativeLayout in the center.
MainActivity.xml
<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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:id="@+id/no_internet"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="gone"
android:background="#e8eaf6"
android:gravity="center"
>
<ImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:src="@drawable/no_wifi"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="#404852"
android:gravity="center"
android:textSize="25dp"
android:text="Internet indisponible"
/>
</LinearLayout>
But after many tries, I have this preview: Preview
Can someone help me please to justify and align the image and the text in center?