Notch support via WindowInsets

This commit is contained in:
Karim Abou Zeid 2018-08-25 15:14:35 +02:00
commit 6464307c7d
15 changed files with 161 additions and 188 deletions

View file

@ -70,6 +70,7 @@
</FrameLayout>
<FrameLayout
android:layout_marginTop="24dp"
android:id="@+id/player_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -78,10 +79,10 @@
android:id="@+id/playing_queue_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginBottom="-8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="@dimen/status_bar_padding"
android:layout_marginTop="0dp"
app:cardBackgroundColor="?cardBackgroundColor"
app:cardElevation="@dimen/card_elevation"
app:cardUseCompatPadding="false">

View file

@ -11,12 +11,12 @@
android:elevation="@dimen/toolbar_elevation"
tools:ignore="UnusedAttribute">
<View
<com.kabouzeid.gramophone.views.StatusBarView
android:id="@+id/player_status_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/status_bar_padding" />
<View
<com.kabouzeid.gramophone.views.StatusBarView
android:layout_width="match_parent"
android:layout_height="@dimen/status_bar_padding"
android:background="@color/twenty_percent_black_overlay" />

View file

@ -1,5 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
tools:ignore="UnusedAttribute">
<include layout="@layout/status_bar" />
</FrameLayout>
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

View file

@ -3,14 +3,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
android:layout_height="match_parent">
<android.support.design.internal.ScrimInsetsFrameLayout
<FrameLayout
android:id="@+id/drawer_content_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true" />
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"

View file

@ -71,7 +71,7 @@
<com.kabouzeid.gramophone.views.StatusBarView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="@dimen/status_bar_padding" />
<android.support.v7.widget.Toolbar
android:id="@+id/player_toolbar"
@ -85,19 +85,21 @@
</FrameLayout>
<FrameLayout
<com.kabouzeid.gramophone.views.StatusBarMarginFrameLayout
android:id="@+id/player_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/status_bar_padding"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/playing_queue_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginBottom="-8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="@dimen/status_bar_padding"
android:layout_marginTop="8dp"
app:cardBackgroundColor="?cardBackgroundColor"
app:cardElevation="@dimen/card_elevation"
app:cardUseCompatPadding="false">
@ -149,7 +151,7 @@
</android.support.v7.widget.CardView>
</FrameLayout>
</com.kabouzeid.gramophone.views.StatusBarMarginFrameLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>

View file

@ -1,89 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.fragments.mainactivity.folders.FoldersFragment">
<FrameLayout
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
tools:ignore="UnusedAttribute">
<include layout="@layout/status_bar" />
</FrameLayout>
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="UnusedAttribute">
app:layout_scrollFlags="scroll|enterAlways">
<FrameLayout
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
android:elevation="0dp"
tools:ignore="UnusedAttribute">
</android.support.v7.widget.Toolbar>
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
android:elevation="0dp"
tools:ignore="UnusedAttribute">
</android.support.v7.widget.Toolbar>
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" />
</FrameLayout>
<com.kabouzeid.gramophone.views.BreadCrumbLayout
android:id="@+id/bread_crumbs"
android:layout_width="match_parent"
android:layout_height="@dimen/tab_height"
android:paddingEnd="8dp"
android:paddingLeft="60dp"
android:paddingRight="8dp"
android:paddingStart="60dp" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:scrollbars="none" />
<TextView
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="sans-serif-light"
android:text="@string/empty"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/empty_text_size" />
android:layout_height="?attr/actionBarSize" />
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
<com.kabouzeid.gramophone.views.BreadCrumbLayout
android:id="@+id/bread_crumbs"
android:layout_width="match_parent"
android:layout_height="@dimen/tab_height"
android:paddingEnd="8dp"
android:paddingLeft="60dp"
android:paddingRight="8dp"
android:paddingStart="60dp" />
</LinearLayout>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:scrollbars="none" />
<TextView
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="sans-serif-light"
android:text="@string/empty"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/empty_text_size" />
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>

View file

@ -1,67 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.fragments.mainactivity.library.LibraryFragment">
<FrameLayout
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
tools:ignore="UnusedAttribute">
<include layout="@layout/status_bar" />
</FrameLayout>
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="UnusedAttribute">
app:layout_scrollFlags="scroll|enterAlways">
<FrameLayout
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
android:elevation="0dp"
tools:ignore="UnusedAttribute">
</android.support.v7.widget.Toolbar>
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways">
android:layout_height="?attr/actionBarSize" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
android:elevation="0dp"
tools:ignore="UnusedAttribute">
</FrameLayout>
</android.support.v7.widget.Toolbar>
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" />
</FrameLayout>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="@dimen/tab_height"
app:tabContentStart="72dp"
app:tabMode="scrollable" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
android:layout_height="@dimen/tab_height"
app:tabContentStart="72dp"
app:tabMode="scrollable" />
</android.support.design.widget.CoordinatorLayout>
</android.support.design.widget.AppBarLayout>
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>