On a Samsung phone (SM-G960U1) I get a white line ...
# compose
g
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
do you have a screenshot?
g
Sorry I can’t share a full picture of the app just yet.
top bar is fine… just the bottom bar.
z
what’s your app theme? maybe this samsung device is overwriting some theme values?
g
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
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
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
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
Grrrr….. Also found the alpha security framework doesn’t work on Samsung.
Fun fun
m
@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
Unfortunately no.
but I haven’t tried it with the latest compose.