This repository has been archived by the owner on May 1, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove status bar underlay view in Android AppCompat (#892)
* Remove status bar underlay and handle status bar color with theme colors * Fix layout gap when SoftInputMode is set to resize * Restore linker settings
- Loading branch information
Showing
9 changed files
with
124 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/AndroidStatusBarColor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.None, 5553226, "Set status bar color on Android", PlatformAffected.Android)] | ||
public class AndroidStatusBarColor : TestContentPage | ||
{ | ||
public const string Message = "ChangeStatusBarToRed"; | ||
|
||
protected override void Init() | ||
{ | ||
var layout = new StackLayout | ||
{ | ||
HorizontalOptions = LayoutOptions.Fill, | ||
VerticalOptions = LayoutOptions.Fill, | ||
Margin = new Thickness(100) | ||
}; | ||
|
||
var instructions = new Label | ||
{ | ||
Text = | ||
"Tapping the button below should change the status bar color to red. If the status bar does not change to red, the test has failed. (Ignore this test for pre-Lollipop devices.)" | ||
}; | ||
|
||
var button = new Button { Text = "Change Status Bar Color" }; | ||
|
||
button.Clicked += (sender, args) => { MessagingCenter.Send(this, Message); }; | ||
|
||
layout.Children.Add(instructions); | ||
layout.Children.Add(button); | ||
|
||
Content = layout; | ||
} | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla47548.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.PlatformConfiguration; | ||
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific; | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Bugzilla, 47548, "Setting soft input mode to resize creates gap", PlatformAffected.Android)] | ||
public class Bugzilla47548 : TestContentPage | ||
{ | ||
static string GetMode() | ||
{ | ||
return Application.Current.On<Android>().GetWindowSoftInputModeAdjust() == WindowSoftInputModeAdjust.Pan | ||
? "Pan" | ||
: "Resize"; | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
var button = new Button() { Text = $"Toggle Soft Input Mode (Currently {GetMode()})"}; | ||
|
||
button.Clicked += (sender, args) => | ||
{ | ||
Application.Current.On<Android>() | ||
.UseWindowSoftInputModeAdjust(Application.Current.On<Android>().GetWindowSoftInputModeAdjust() == | ||
WindowSoftInputModeAdjust.Pan | ||
? WindowSoftInputModeAdjust.Resize | ||
: WindowSoftInputModeAdjust.Pan); | ||
button.Text = $"Toggle Soft Input Mode (Currently {GetMode()})"; | ||
}; | ||
|
||
Content = new StackLayout | ||
{ | ||
BackgroundColor = Color.CadetBlue, | ||
Spacing = 10, | ||
VerticalOptions = LayoutOptions.Fill, | ||
Children = | ||
{ | ||
new Label | ||
{ | ||
Text = @"With Soft Input Mode set to Pan, tapping the Entry at the bottom of the screen should cause the whole page to scroll up above the keyboard. | ||
With Soft Input Mode set to Resize, tapping the Entry at the bottom of the screen should resize the content to display everything above the keyboard (the Crimson Label in the middle should be squashed to fit)." | ||
}, | ||
button, | ||
new Label | ||
{ | ||
FontSize = 12f, | ||
HeightRequest = 500, | ||
Text = @"Meh", | ||
BackgroundColor = Color.Crimson | ||
}, | ||
new Entry() | ||
} | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters