Skip to content

Commit

Permalink
Edge2Edge in send activity
Browse files Browse the repository at this point in the history
  • Loading branch information
ShortDevelopment committed Nov 13, 2024
1 parent 5b086a6 commit 37ea039
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SendActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Google.Android.Material.ProgressIndicator;
using Microsoft.Extensions.Logging;
using NearShare.Droid.Settings;
using NearShare.Droid.Utils;
using ShortDev.Android.UI;
using ShortDev.Microsoft.ConnectedDevices;
using ShortDev.Microsoft.ConnectedDevices.Encryption;
Expand Down Expand Up @@ -42,13 +43,13 @@ public sealed class SendActivity : AppCompatActivity
ILoggerFactory _loggerFactory = null!;
protected override void OnCreate(Bundle? savedInstanceState)
{
this.EnableEdgeToEdge();
base.OnCreate(savedInstanceState);

SetContentView(new CoordinatorLayout(this)
{
LayoutParameters = new(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
});
Window!.SetFlags(WindowManagerFlags.LayoutNoLimits, WindowManagerFlags.LayoutNoLimits);

_dialog = new(this);
_dialog.SetContentView(Resource.Layout.activity_share);
Expand Down
16 changes: 16 additions & 0 deletions src/Utils/EdgeToEdgeExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Android.Graphics;
using AndroidX.Activity;

namespace NearShare.Droid.Utils;

internal static class EdgeToEdgeExtensions
{
public static void EnableEdgeToEdge(this ComponentActivity activity)
{
EdgeToEdge.Enable(
activity,
SystemBarStyle.Dark(Color.Transparent.ToArgb()),
SystemBarStyle.Auto(Color.Transparent.ToArgb(), Color.Transparent.ToArgb())
);
}
}

0 comments on commit 37ea039

Please sign in to comment.