https://kotlinlang.org logo
#compose
Title
# compose
g

Guy Bieber

10/27/2020, 7:50 PM
On a Samsung phone (SM-G960U1) I get a white line on the bottom of the screen with a grey pull-up bar. This does not happen on other android phones. Any way to overcome this in compose?
z

Zach Klippenstein (he/him) [MOD]

10/27/2020, 10:36 PM
do you have a screenshot?
g

Guy Bieber

10/27/2020, 10:40 PM
Sorry I can’t share a full picture of the app just yet.
top bar is fine… just the bottom bar.
z

Zach Klippenstein (he/him) [MOD]

10/27/2020, 10:46 PM
what’s your app theme? maybe this samsung device is overwriting some theme values?
g

Guy Bieber

10/27/2020, 10:48 PM
Compose is supposed to support rendering under the header and footer.
Here are the colors for my material theme:
Copy code
val lightColors = Colors(
        primary = Black,
        primaryVariant = MotorDarkGray,
        secondary = NikolaBlue,
        secondaryVariant = NikolaDarkBlue,
        background = Black,
        surface = White, //Transparent,

        error = Black,

        onPrimary = White,
        onSecondary = White,
        onBackground = White,
        onSurface = White,
        onError = Red,

        isLight = true
    )
z

Zach Klippenstein (he/him) [MOD]

10/27/2020, 10:49 PM
Compose is supposed to support rendering under the header and footer.
It does, but you have to tell the Window that you want to do that (either through setting window flags programmatically or your activity theme), and based on the screenshot from the other device, it looks like you haven’t.
g

Guy Bieber

10/27/2020, 10:50 PM
Copy code
setContent {
            MaterialTheme(
                colors = nikolaColors.lightColors,
                typography = nikolaTypography.typography
            ) {
                rootView?.view()
            }
        }
Compose is moving away from using XML definitions of themes.
Here is my current application section of manifest:
Copy code
<application
        android:allowBackup="true"
        android:icon="@mipmap/nikola"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/nikola_round"
        android:supportsRtl="true"
        tools:replace="android:theme"
        android:theme="@style/AppTheme.NoActionBar" >

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
NoActionBar Theme:
Copy code
<style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="colorPrimary">@color/Black</item>
        <item name="colorPrimaryDark">@color/Black</item>
        <item name="colorAccent">@color/Black</item>
        <item name="android:windowBackground">@drawable/launch_screen</item>

    </style>
z

Zach Klippenstein (he/him) [MOD]

10/27/2020, 11:16 PM
Compose doesn’t use themes internally, but on Android XML themes don’t just affect your views, they actually change Window flags. Compose doesn’t set any window flags for you at the moment, so if you want to draw under system bars, you need to tell set that window flag yourself. https://developer.android.com/reference/android/R.attr#windowTranslucentNavigation
But to your original question, idk why samsung is doing weird things, but i’m not surprised
g

Guy Bieber

10/27/2020, 11:25 PM
Grrrr….. Also found the alpha security framework doesn’t work on Samsung.
Fun fun
m

MaxUt

08/13/2021, 8:14 AM
@Guy Bieber did you figure out a solution ? I'm trying to modify the background color and line color of this bottom action slider
g

Guy Bieber

08/16/2021, 6:46 PM
Unfortunately no.
but I haven’t tried it with the latest compose.