Skip to content

Commit d2e648c

Browse files
committed
Merge branch 'develop' into fixIncorrectWindowLevel
# Conflicts: # Samples/Demo/Pages/MainPage.xaml
2 parents 0d46f10 + 5da741a commit d2e648c

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

Rg.Plugins.Popup/Platforms/Android/Renderers/PopupPageRenderer.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,14 @@ protected override void OnLayout(bool changed, int l, int t, int r, int b)
7272

7373
if (Build.VERSION.SdkInt >= BuildVersionCodes.M && RootWindowInsets != null)
7474
{
75-
var screenRealSize = new Android.Graphics.Point();
76-
activity?.WindowManager?.DefaultDisplay?.GetRealSize(screenRealSize);
75+
var h = b-t;
7776

7877
var windowInsets = RootWindowInsets;
7978
var bottomPadding = Math.Min(windowInsets.StableInsetBottom, windowInsets.SystemWindowInsetBottom);
8079

81-
if (screenRealSize.Y - visibleRect.Bottom > windowInsets.StableInsetBottom)
80+
if (h - visibleRect.Bottom > windowInsets.StableInsetBottom)
8281
{
83-
keyboardOffset = Context.FromPixels(screenRealSize.Y - visibleRect.Bottom);
82+
keyboardOffset = Context.FromPixels(h - visibleRect.Bottom);
8483
}
8584

8685
systemPadding = new Thickness

Samples/Demo/Pages/MainPage.xaml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
23
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
34
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
45
x:Class="Demo.Pages.MainPage"
56
Title="Popup Demo"
67
BackgroundColor="White">
7-
<ContentPage.Resources>
8-
<ResourceDictionary>
9-
<Style TargetType="Button">
10-
<Setter Property="BackgroundColor" Value="#7dbbe6"/>
11-
<Setter Property="TextColor" Value="White"/>
12-
</Style>
13-
</ResourceDictionary>
14-
</ContentPage.Resources>
15-
<StackLayout Spacing="20" Margin="10, 15">
16-
<Button Text="Open Popup" Clicked="OnOpenPupup"></Button>
17-
<Button Text="Open User Animation Popup" Clicked="OnUserAnimationPupup"></Button>
18-
<Button Text="Open System Offset Page" Clicked="OnOpenSystemOffsetPage"></Button>
19-
<Button Text="ListView Page" Clicked="OnOpenListViewPage"></Button>
20-
<Button Text="Open User Animation Popup using Resources"
21-
Clicked="OnOpenUserAnimationFromResource"></Button>
22-
<Button Text="Open User Animation Popup using Style"
23-
Clicked="OnOpenUserAnimationFromStyle"></Button>
24-
<Button Text="Open Settings" Clicked="OnOpenSettingsPage"></Button>
25-
<Button Text="Open MvvmPage" Clicked="OnOpenMvvmPage"></Button>
26-
<Button Text="Open TestCurrentViewController" Clicked="OnTestCurrentViewController"></Button>
27-
</StackLayout>
8+
<ContentPage.Resources>
9+
<ResourceDictionary>
10+
<Style TargetType="Button">
11+
<Setter Property="BackgroundColor" Value="#7dbbe6" />
12+
<Setter Property="TextColor" Value="White" />
13+
</Style>
14+
</ResourceDictionary>
15+
</ContentPage.Resources>
16+
<ScrollView VerticalOptions="Fill">
17+
<StackLayout Spacing="20" Margin="10, 15">
18+
<Button Text="Open Popup" Clicked="OnOpenPupup" />
19+
<Button Text="Open User Animation Popup" Clicked="OnUserAnimationPupup" />
20+
<Button Text="Open System Offset Page" Clicked="OnOpenSystemOffsetPage" />
21+
<Button Text="ListView Page" Clicked="OnOpenListViewPage" />
22+
<Button Text="Open User Animation Popup using Resources"
23+
Clicked="OnOpenUserAnimationFromResource" />
24+
<Button Text="Open User Animation Popup using Style"
25+
Clicked="OnOpenUserAnimationFromStyle" />
26+
<Button Text="Open Settings" Clicked="OnOpenSettingsPage" />
27+
<Button Text="Open MvvmPage" Clicked="OnOpenMvvmPage" />
28+
<Button Text="Open TestCurrentViewController" Clicked="OnTestCurrentViewController"/>
29+
</StackLayout>
30+
</ScrollView>
2831
</ContentPage>

0 commit comments

Comments
 (0)