matteolobello / paper-launcher

Experimental Android Launcher
MIT License
114 stars 11 forks source link

Kitkat(API-19) Support #6

Open rohitkparida opened 6 years ago

rohitkparida commented 6 years ago

Was testing your on different device and noticed: The search bar do not expand and merge with the App drawer as it is supposed to be... 2017-10-11 15-29-03 screenshot I know Kitkat(API-19) is pretty old now but it still runs on more device than Oreo(API 26) itself android_oreo_chart_1507020928378 Thanks for your time, hope you'll look in this!

PrattiDev commented 6 years ago

This problem is caused by the static marginTop value in search_bar_container.

<android.support.v7.widget.CardView android:id="@+id/search_bar_container" android:layout_width="match_parent" android:layout_height="@dimen/search_bar_size" android:layout_marginEnd="@dimen/standard_padding" android:layout_marginStart="@dimen/standard_padding" android:layout_marginTop="32dp" app:cardBackgroundColor="@color/colorPrimary" app:cardCornerRadius="2dp">

The 32dp is a sum of the statusBar size in Lollipop and above +the 8dp margin of the search bar.

Prior to Lollipop, the statusBar was 25dp, which is why you're seeing that hairline gap between search bar and the app drawer.

When opened on a Kit Kat device, the margin that was supposed to be calculated from the top edge of the screen is instead placed below the status bar.

I believe this can be fixed by setting android:fitSystemWindows="true" to content_launcher.xml and changing the margin of the search bar to 33dp (25 + 8) on any pre-Lollipop device.