Browse Source

make android compatible with new ime interfaces.

pull/8963/head
Dan Walmsley 4 years ago
parent
commit
4d90f63953
  1. 2
      samples/MobileSandbox.Android/Properties/AndroidManifest.xml
  2. 9
      src/Android/Avalonia.Android/AndroidInputMethod.cs
  3. 4
      src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs

2
samples/MobileSandbox.Android/Properties/AndroidManifest.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
<application android:label="ControlCatalog.Android" android:icon="@drawable/Icon"></application>
<application android:label="MobileSandbox.Android" android:icon="@drawable/Icon"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

9
src/Android/Avalonia.Android/AndroidInputMethod.cs

@ -12,7 +12,14 @@ using Java.Lang;
namespace Avalonia.Android
{
class AndroidInputMethod<TView> : ITextInputMethodImpl
internal interface IAndroidInputMethod
{
public ITextInputMethodClient Client { get; }
public bool IsActive { get; }
}
class AndroidInputMethod<TView> : ITextInputMethodImpl, IAndroidInputMethod
where TView: View, IInitEditorInfo
{
private readonly TView _host;

4
src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs

@ -259,9 +259,9 @@ namespace Avalonia.Android.Platform.SkiaPlatform
internal class InputConnectionImpl: BaseInputConnection
{
private readonly ITextInputMethodImpl _inputMethod;
private readonly IAndroidInputMethod _inputMethod;
public InputConnectionImpl(View? targetView, ITextInputMethodImpl inputMethod) :
public InputConnectionImpl(View? targetView, IAndroidInputMethod inputMethod) :
base(targetView, false)
{
_inputMethod = inputMethod;

Loading…
Cancel
Save