Make the bottom navigation bar going down to let the player open in fullscreen.

This commit is contained in:
Anonymous Raccoon
2018-09-05 22:09:04 +02:00
parent 85ef8781ee
commit b2eb5a3a88
3 changed files with 6 additions and 11 deletions
+1 -1
View File
@@ -967,7 +967,7 @@ namespace MusicApp
public void ShowPlayer()
{
FindViewById<NestedScrollView>(Resource.Id.playerSheet).SetPadding(0, 0, 0,0);
//SheetBehavior.State = BottomSheetBehavior.StateExpanded;
SheetBehavior.State = BottomSheetBehavior.StateExpanded;
}
public void GetStoragePermission()
@@ -602,13 +602,9 @@ namespace MusicApp.Resources.Portable_Class
if(movement == SheetMovement.Expanding && 0 <= slideOffset && slideOffset <= 1)
{
Console.WriteLine("&Expanding with offset: " + slideOffset);
sheet.Alpha = 1;
int defaultPadding = (int)(20 * context.Resources.DisplayMetrics.Density + 0.5f);
//((CoordinatorLayout.LayoutParams)layout.LayoutParameters).BottomMargin = (int)((70 * context.Resources.DisplayMetrics.Density + 0.5f) * (1 - slideOffset));
//layout.RequestLayout();
sheet.SetPadding((int)(defaultPadding * (1 - slideOffset)), 0, (int)(defaultPadding * (1 - slideOffset)), 0);
bottomLayer.TranslationY = (int)((56 * context.Resources.DisplayMetrics.Density + 0.5f) * slideOffset);
@@ -622,15 +618,12 @@ namespace MusicApp.Resources.Portable_Class
}
else if(movement == SheetMovement.Hidding && - 1 <= slideOffset && slideOffset < 0)
{
//((CoordinatorLayout.LayoutParams)layout.LayoutParameters).BottomMargin = (int)((70 * context.Resources.DisplayMetrics.Density + 0.5f) * (1 + slideOffset));
//layout.RequestLayout();
sheet.Alpha = 1 + slideOffset;
}
}
public override void OnStateChanged(View bottomSheet, int newState)
{
Console.WriteLine("&State: " + newState);
if (newState == BottomSheetBehavior.StateExpanded)
movement = SheetMovement.Unknow;
else if (newState == BottomSheetBehavior.StateCollapsed)
+5 -3
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<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"
@@ -29,7 +29,9 @@
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
layout_constraintEnd_toStartOf="@id/bottomLayer" >
app:layout_anchor="@id/bottomLayer"
app:layout_anchorGravity="top"
android:layout_gravity="top" >
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -198,4 +200,4 @@
</android.support.design.widget.CoordinatorLayout>
</android.support.design.widget.CoordinatorLayout>
</android.support.constraint.ConstraintLayout>
</android.support.design.widget.CoordinatorLayout>