forked from xamarin/Xamarin.Forms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhancement] Entry: Read-only Entry and Editor (xamarin#1972)
- fixes xamarin#1678 - fixes xamarin#4834 * InputView BindableProperty IsReadOnly * Android Editor and Entry setup * MacOS Editor and Entry setup * Tizen Editor and Entry setup * UAP Editor and Entry setup * WPF Editor and Entry setup * iOS Editor and Entry setup * Issue1678 - TestContentPage added * Tests added * Tizen Editor and Entry fix * UI Test fix * Android fix for Entry and Editor. * Unit Tests fix. * Android Renderer first try. * MacOS Entry renderer small fix. * UpdateEditable fix. * Android Entry and Editor reduced number of calls to BP. * fix TestAttributes conflicts * Remove keyboard * [macOS] relinquish first responder * [Android] remove call to UpdateCursorSelection * [UWP] fix tabs
- Loading branch information
1 parent
f7823b6
commit 5c46848
Showing
21 changed files
with
219 additions
and
7 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1678.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,51 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 1678, "[Enhancement] Entry: Read-only entry", PlatformAffected.All)] | ||
public class Issue1678 | ||
: TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
var entryText = "Entry Lorem Ipsum"; | ||
var editorText = "Editor Lorem Ipsum"; | ||
|
||
var entryDefaults = new Entry { Text = entryText }; | ||
var editorDefaults = new Editor { Text = editorText }; | ||
var entryReadOnly = new Entry { Text = entryText, IsReadOnly = true }; | ||
var editorReadOnly = new Editor { Text = editorText, IsReadOnly = true }; | ||
var entryToggleable = new Entry { Text = entryText }; | ||
var editorToggleable = new Editor { Text = editorText }; | ||
|
||
var toggle = new Switch { IsToggled = false }; | ||
|
||
var stackLayout = new StackLayout(); | ||
stackLayout.Children.Add(new Label { Text = "Defaults" }); | ||
stackLayout.Children.Add(entryDefaults); | ||
stackLayout.Children.Add(editorDefaults); | ||
stackLayout.Children.Add(new Label { Text = "Read Only" }); | ||
stackLayout.Children.Add(entryReadOnly); | ||
stackLayout.Children.Add(editorReadOnly); | ||
stackLayout.Children.Add(new Label { Text = "Toggleable is read only" }); | ||
stackLayout.Children.Add(entryToggleable); | ||
stackLayout.Children.Add(editorToggleable); | ||
stackLayout.Children.Add(toggle); | ||
|
||
toggle.Toggled += (_, b) => | ||
{ | ||
entryToggleable.IsReadOnly = b.Value; | ||
editorToggleable.IsReadOnly = b.Value; | ||
}; | ||
|
||
stackLayout.Padding = new Thickness(0, 20, 0, 0); | ||
Content = stackLayout; | ||
} | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.