From 7bb84fcf020bbde20f48e89f1542bcded0674453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= <danxuliu@gmail.com> Date: Sun, 18 Sep 2022 13:55:20 +0200 Subject: [PATCH] Fix icon not visible in call state message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The call state uses a RelativeLayout with a wrap content height where the state icons (including the progress bar) position was set as above the message. However, this caused the call state to wrap only the text; the icons were indeed above the message, but out of the view boundaries. Now the icons are wrapped in a FrameLayout and the text position is set below that frame layout instead, which causes the RelativeLayout height to correctly wrap its content. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com> --- app/src/main/res/layout/call_states.xml | 50 ++++++++++++++----------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/app/src/main/res/layout/call_states.xml b/app/src/main/res/layout/call_states.xml index 1e2a354d6..71c24b657 100644 --- a/app/src/main/res/layout/call_states.xml +++ b/app/src/main/res/layout/call_states.xml @@ -25,34 +25,40 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - <ImageView - android:id="@+id/errorImageView" - android:layout_width="48dp" - android:layout_height="48dp" - android:layout_above="@id/callStateTextView" - android:layout_centerHorizontal="true" - android:contentDescription="@null" - android:src="@drawable/ic_signal_wifi_off_white_24dp" - android:visibility="gone" /> + <FrameLayout + android:id="@+id/callStateIconFrameLayout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:measureAllChildren="@bool/value_true"> - <ProgressBar - android:id="@+id/callStateProgressBar" - android:layout_width="@dimen/item_height" - android:layout_height="@dimen/item_height" - android:layout_above="@id/callStateTextView" - android:layout_centerHorizontal="true" - android:layout_marginStart="@dimen/activity_horizontal_margin" - android:layout_marginLeft="@dimen/activity_horizontal_margin" - android:layout_marginEnd="@dimen/activity_horizontal_margin" - android:layout_marginRight="@dimen/activity_horizontal_margin" - android:indeterminate="true" - android:indeterminateTint="@color/colorPrimary" - android:indeterminateTintMode="src_in" /> + <ImageView + android:id="@+id/errorImageView" + android:layout_width="48dp" + android:layout_height="48dp" + android:layout_gravity="center" + android:contentDescription="@null" + android:src="@drawable/ic_signal_wifi_off_white_24dp" + android:visibility="gone" /> + + <ProgressBar + android:id="@+id/callStateProgressBar" + android:layout_width="@dimen/item_height" + android:layout_height="@dimen/item_height" + android:layout_gravity="center" + android:layout_marginStart="@dimen/activity_horizontal_margin" + android:layout_marginLeft="@dimen/activity_horizontal_margin" + android:layout_marginEnd="@dimen/activity_horizontal_margin" + android:layout_marginRight="@dimen/activity_horizontal_margin" + android:indeterminate="true" + android:indeterminateTint="@color/colorPrimary" + android:indeterminateTintMode="src_in" /> + </FrameLayout> <TextView android:id="@+id/callStateTextView" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_below="@id/callStateIconFrameLayout" android:layout_centerInParent="true" android:layout_margin="16dp" android:gravity="center"