Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion JournalApp/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:JournalApp"
x:Class="JournalApp.MainPage">
x:Class="JournalApp.MainPage"
Padding="0">

<BlazorWebView HostPage="wwwroot/index.html">
<BlazorWebView.RootComponents>
Expand Down
7 changes: 7 additions & 0 deletions JournalApp/Platforms/Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Android.Content.PM;
using Android.OS;
using AndroidX.Activity;
using AndroidX.Core.View;
using JournalApp.Platforms.Android;

namespace JournalApp;
Expand All @@ -14,6 +15,12 @@ protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);

// Enable edge-to-edge display
if (Window != null)
{
WindowCompat.SetDecorFitsSystemWindows(Window, false);
}

var backCallback = new OnBackPressedCallbackProxy(() =>
{
var service = IPlatformApplication.Current.Services.GetService<KeyEventService>();
Expand Down
11 changes: 11 additions & 0 deletions JournalApp/Platforms/Android/Resources/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Maui.SplashTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:enforceNavigationBarContrast">false</item>
<item name="android:enforceStatusBarContrast">false</item>
</style>
</resources>
36 changes: 5 additions & 31 deletions JournalApp/wwwroot/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ body {
flex-direction: column;
padding: 0 !important;
margin: 0 !important;
top: 0 !important;
top: env(safe-area-inset-top) !important;
position: sticky !important;
background-color: var(--mud-palette-surface);
color: var(--mud-palette-primary-text);
Expand All @@ -80,7 +80,7 @@ body {
max-width: 960px;
margin: 0 auto !important;
padding: 8px !important;
padding-bottom: 15vh !important;
padding-bottom: calc(15vh + env(safe-area-inset-bottom)) !important;
animation: fadeInUp 0.15s ease-out;
}

Expand Down Expand Up @@ -207,33 +207,7 @@ body {
z-index: 1000;
}

.status-bar-safe-area {
display: none;
}

@supports (-webkit-touch-callout: none) {
.status-bar-safe-area {
display: flex;
position: sticky;
top: 0;
height: env(safe-area-inset-top);
width: 100%;
z-index: 1;
}

.flex-column, .navbar-brand {
padding-left: env(safe-area-inset-left);
}
}

@media (prefers-color-scheme: dark) {
.status-bar-safe-area {
background-color: #120D10;
}
}

@media (prefers-color-scheme: light) {
.status-bar-safe-area {
background-color: #FFF8F9;
}
.flex-column, .navbar-brand {
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
}
2 changes: 0 additions & 2 deletions JournalApp/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

<body>

<div class="status-bar-safe-area"></div>

<div id="app">
<div id="splash-screen">
<p id="loading-text">Getting things ready...</p>
Expand Down