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
<ContentPage ... | |
xmlns:effects="clr-namespace:<project>.Effects;assembly=<project>" | |
BackgroundColor="PaleTurquoise"> | |
<ContentPage.Resources> | |
<ResourceDictionary> | |
<x:Int32 x:Key="SmallCornerRadius">4</x:Int32> | |
<x:Int32 x:Key="MediumCornerRadius">8</x:Int32> | |
<x:Int32 x:Key="LargeCornerRadius">16</x:Int32> | |
</ResourceDictionary> |
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
namespace <project>.Controls | |
{ | |
public class SelectableLabel : Editor | |
{ | |
public SelectableLabel() | |
{ | |
} | |
} | |
} |
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
namespace <project>.Droid.Controls | |
{ | |
public class CustomEditText : FormsEditText | |
{ | |
public CustomEditText(Context context) : base(context) | |
{ | |
} | |
protected override void OnAttachedToWindow() | |
{ |
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
[assembly: ExportRenderer(typeof(SelectableLabel), typeof(SelectableLabelRenderer))] | |
namespace <project>.Droid.Controls | |
{ | |
public class SelectableLabelRenderer : EditorRenderer | |
{ | |
public SelectableLabelRenderer(Context context) : base(context) | |
{ | |
} |
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
[assembly: ExportRenderer(typeof(SelectableLabel), typeof(SelectableLabelRenderer))] | |
namespace <project>.iOS.Controls | |
{ | |
public class SelectableLabelRenderer : EditorRenderer | |
{ | |
protected override void OnElementChanged(ElementChangedEventArgs<Editor> e) | |
{ | |
base.OnElementChanged(e); |
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
protected override FormsEditText CreateNativeControl() => | |
new CustomEditText(Context); |
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
public class CustomSelectionActionModeCallback implements ActionMode.Callback { | |
@Override | |
public boolean onCreateActionMode(ActionMode mode, Menu menu) { | |
return true; | |
} | |
@Override | |
public boolean onPrepareActionMode(ActionMode mode, Menu menu) { | |
try { |
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
editText.setCustomSelectionActionModeCallback(new CustomSelectionActionModeCallback()); |
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
public class CustomInsertionActionModeCallback implements ActionMode.Callback { | |
@Override | |
public boolean onCreateActionMode(ActionMode mode, Menu menu) { | |
return false; | |
} | |
@Override | |
public boolean onPrepareActionMode(ActionMode mode, Menu menu) { | |
return false; |
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
editText.setShowSoftInputOnFocus(false); |
OlderNewer