mirror of
https://github.com/zoriya/Opus.git
synced 2025-12-05 22:16:17 +00:00
Remaking the download queue without the padding top set to an android constant.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Android.App;
|
||||
using Android.Graphics;
|
||||
using Android.OS;
|
||||
using Android.Support.Design.Widget;
|
||||
using Android.Support.V4.View;
|
||||
using Android.Support.V7.App;
|
||||
using Android.Support.V7.Widget;
|
||||
using Android.Views;
|
||||
@@ -26,8 +27,9 @@ namespace Opus.Fragments
|
||||
instance = this;
|
||||
SetContentView(Resource.Layout.DownloadQueue);
|
||||
|
||||
Toolbar ToolBar = FindViewById<Toolbar>(Resource.Id.toolbar);
|
||||
SetSupportActionBar(ToolBar);
|
||||
Toolbar toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
|
||||
ViewCompat.SetOnApplyWindowInsetsListener(toolbar, new FixToolbarPadding());
|
||||
SetSupportActionBar(toolbar);
|
||||
SupportActionBar.Title = GetString(Resource.String.download_queue);
|
||||
SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.Close);
|
||||
SupportActionBar.SetDisplayHomeAsUpEnabled(true);
|
||||
@@ -96,5 +98,16 @@ namespace Opus.Fragments
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class FixToolbarPadding : Java.Lang.Object, IOnApplyWindowInsetsListener
|
||||
{
|
||||
public WindowInsetsCompat OnApplyWindowInsets(View v, WindowInsetsCompat insets)
|
||||
{
|
||||
((AppBarLayout.LayoutParams)v.LayoutParameters).TopMargin = insets.SystemWindowInsetTop;
|
||||
return insets;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,14 @@
|
||||
<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:fitsSystemWindows="true"
|
||||
android:orientation="vertical" >
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@*android:dimen/status_bar_height"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="?colorAccent"
|
||||
android:id="@+id/appbar" >
|
||||
<android.support.v7.widget.Toolbar
|
||||
@@ -21,6 +21,7 @@
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/list"
|
||||
android:background="?android:colorBackground"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent" />
|
||||
|
||||
Reference in New Issue
Block a user