Skip to content

Snacky has extra top padding #7

@xanahopper

Description

@xanahopper

When I show a Snacky, it has a extra top padding in it like this:
screenshot_1500862473

the layout is

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.design.widget.CoordinatorLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/white">

        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/AppTheme.AppBarOverlay">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="?attr/toolbarColor"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Dark"/>
        </android.support.design.widget.AppBarLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipToPadding="false"
        android:paddingTop="8dp"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
    </android.support.design.widget.CoordinatorLayout>

Showing code is

        Snacky.builder()
                .setView(recyclerView)
                .warning()
                .setText("账号已删除")
                .setAction("恢复", { actionCallback() })
                .setDuration(Snacky.LENGTH_LONG)
                .show()

Activity's theme is "AppTheme.NoActionBar"

        <style name="BaseAppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
            <item name="windowActionBar">false</item>
            <item name="windowNoTitle">true</item>
        </style>

        <style name="AppTheme" parent="BaseAppTheme">
            <!-- Customize your theme here. -->
            <item name="colorPrimary">@color/colorPrimary</item>
            <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
            <item name="colorAccent">@color/colorAccent</item>

            <item name="colorControlActivated">@color/colorControlActivated</item>
            <item name="colorControlHighlight">@color/colorControlHighlight</item>
            <item name="colorControlNormal">@color/colorControlNormal</item>

            <item name="topSnackbarBackground">@color/colorPrimaryDark</item>
            <item name="topSnackbarForeground">@color/colorAccent</item>

            <item name="fabColor">@color/colorPrimary</item>
            <item name="fabIconColor">@android:color/white</item>

            <item name="bottomNavColor">@color/colorPrimary</item>
            <item name="bottomNormalColor">@color/colorBottomNormal</item>
            <item name="bottomActiveColor">@android:color/white</item>
            <item name="bottomRippleColor">@color/colorBottomRipple</item>

            <item name="toolbarColor">@color/colorPrimary</item>
            <item name="toolbarNormalColor">@android:color/white</item>

            <item name="itemBgColor">@android:color/white</item>
            <item name="itemQuoteBgColor">@color/colorQuoteBackground</item>
            <item name="itemTextColor">@android:color/primary_text_light</item>
            <item name="itemTextSecondaryColor">@color/colorTextSecondary</item>
            <item name="itemNormalColor">@color/colorPrimary</item>
            <item name="itemActiveColor">@color/colorPrimaryDark</item>
            <item name="itemRippleColor">@color/colorPrimaryRipple</item>
            <item name="itemIconColor">@color/selector_icon_button_color</item>

            <item name="iconInactiveColor">@color/colorInactiveColor</item>
            <item name="iconActiveColor">@color/colorActiveColor</item>

            <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>


            <item name="windowActionBar">false</item>
            <item name="windowNoTitle">true</item>
            <item name="android:navigationBarColor" tools:targetApi="21">@color/colorPrimaryDark</item>
            <!--<item name="android:windowTranslucentStatus">true</item>-->
        </style>

        <style name="AppTheme.NoActionBar" parent="AppTheme">
            <item name="android:windowActionBar">false</item>
            <item name="android:windowNoTitle">true</item>
            <item name="android:windowTranslucentStatus">true</item>
            <item name="android:windowTranslucentNavigation">false</item>
        </style>

This issues show now only on API 19, but it show on and API >=19 but it has been fixed by some way I don't know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions