Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c381e0c authored by Franciszek Juras's avatar Franciszek Juras
Browse files

Fix Sign out button's text alignment

Because of limited vertical space in status bar, if user's font size
was increased, Sign out button's text on status bar was not aligned
properly. Adding wrapContentHeight(unbounded=true) modifier lets button's
text align properly when Button composable height is less than Text
composable height.

Test: manual - Sign out button visible on Keyguard's status bar
Test: manual - Increase user's font size - button is properly aligned
Flag: com.android.systemui.sign_out_button_on_keyguard_status_bar
Bug: 392052370
Change-Id: I7f5fa9bf3306640607bfe1c93fe2ffce876f90a4
parent e3d64acc
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -36,6 +37,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import com.android.compose.modifiers.height
@@ -141,9 +143,8 @@ constructor(
                )
                Spacer(modifier = Modifier.width(4.dp))
                Text(
                    checkNotNull(
                        context.getString(com.android.internal.R.string.global_action_logout)
                    )
                    text = stringResource(com.android.internal.R.string.global_action_logout),
                    modifier = Modifier.wrapContentHeight(unbounded = true),
                )
            }
        }