Commit dc28e2f 1 parent 0bd8f6a commit dc28e2f Copy full SHA for dc28e2f
File tree 1 file changed +17
-1
lines changed
src/MauiBlazorToolkit/MauiBlazorToolkit/Platform/WebViewSoftInput
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
using Android . Content . Res ;
2
+ using Android . Views ;
2
3
using Android . Widget ;
3
4
using System . Runtime . Versioning ;
4
5
using static Android . Resource ;
@@ -59,7 +60,14 @@ static int ComputeUsableHeight()
59
60
{
60
61
Rect rect = new Rect ( ) ;
61
62
MChildOfContent ? . GetWindowVisibleDisplayFrame ( rect ) ;
62
- return rect . Bottom - GetStatusBarHeight ( ) ;
63
+ if ( IsImmersiveMode ( ) )
64
+ {
65
+ return rect . Bottom ;
66
+ }
67
+ else
68
+ {
69
+ return rect . Bottom - GetStatusBarHeight ( ) ;
70
+ }
63
71
}
64
72
65
73
static int GetStatusBarHeight ( )
@@ -73,4 +81,12 @@ static int GetStatusBarHeight()
73
81
}
74
82
return result ;
75
83
}
84
+
85
+ static bool IsImmersiveMode ( )
86
+ {
87
+ var window = Activity . Window ?? throw new InvalidOperationException ( "Activity Window can't be null." ) ;
88
+ View decorView = window . DecorView ;
89
+ int uiOptions = ( int ) decorView . SystemUiVisibility ;
90
+ return ( uiOptions & ( int ) SystemUiFlags . Immersive ) == ( int ) SystemUiFlags . Immersive ;
91
+ }
76
92
}
You can’t perform that action at this time.
0 commit comments