mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-20 07:24:42 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c84df2c11c |
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
ndkVersion "23.0.7599858"
|
ndkVersion "22.1.7171670"
|
||||||
|
|
||||||
compileSdkVersion 31
|
compileSdkVersion 31
|
||||||
|
|
||||||
@@ -9,8 +9,8 @@ android {
|
|||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 31
|
targetSdkVersion 31
|
||||||
|
|
||||||
versionName "9.10.1"
|
versionName "9.10"
|
||||||
versionCode = 271
|
versionCode = 270
|
||||||
}
|
}
|
||||||
|
|
||||||
flavorDimensions "root"
|
flavorDimensions "root"
|
||||||
|
|||||||
@@ -1210,6 +1210,11 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleTextEvent(String text) {
|
||||||
|
conn.sendUtf8Text(text);
|
||||||
|
}
|
||||||
|
|
||||||
private TouchContext getTouchContext(int actionIndex)
|
private TouchContext getTouchContext(int actionIndex)
|
||||||
{
|
{
|
||||||
if (actionIndex < touchContextMap.length) {
|
if (actionIndex < touchContextMap.length) {
|
||||||
|
|||||||
@@ -88,11 +88,11 @@ public class AddComputerManually extends Activity {
|
|||||||
|
|
||||||
// Couldn't find a matching interface
|
// Couldn't find a matching interface
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (SocketException e) {
|
||||||
// Catch all exceptions because some broken Android devices
|
|
||||||
// will throw an NPE from inside getNetworkInterfaces().
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return false;
|
return false;
|
||||||
|
} catch (UnknownHostException e) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class StreamSettings extends Activity {
|
|||||||
void reloadSettings() {
|
void reloadSettings() {
|
||||||
getFragmentManager().beginTransaction().replace(
|
getFragmentManager().beginTransaction().replace(
|
||||||
R.id.stream_settings, new SettingsFragment()
|
R.id.stream_settings, new SettingsFragment()
|
||||||
).commitAllowingStateLoss();
|
).commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
package com.limelight.ui;
|
package com.limelight.ui;
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.text.InputType;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
import android.view.KeyCharacterMap;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.SurfaceView;
|
import android.view.SurfaceView;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.BaseInputConnection;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
import android.view.inputmethod.InputConnection;
|
||||||
|
|
||||||
public class StreamView extends SurfaceView {
|
public class StreamView extends SurfaceView {
|
||||||
private double desiredAspectRatio;
|
private double desiredAspectRatio;
|
||||||
@@ -20,19 +25,18 @@ public class StreamView extends SurfaceView {
|
|||||||
|
|
||||||
public StreamView(Context context) {
|
public StreamView(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
|
setFocusableInTouchMode(true);
|
||||||
|
setFocusable(true);
|
||||||
|
requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
public StreamView(Context context, AttributeSet attrs) {
|
public StreamView(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
}
|
|
||||||
|
|
||||||
public StreamView(Context context, AttributeSet attrs, int defStyleAttr) {
|
setFocusableInTouchMode(true);
|
||||||
super(context, attrs, defStyleAttr);
|
setFocusable(true);
|
||||||
}
|
requestFocus();
|
||||||
|
|
||||||
@TargetApi(21)
|
|
||||||
public StreamView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
|
||||||
super(context, attrs, defStyleAttr, defStyleRes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -79,8 +83,62 @@ public class StreamView extends SurfaceView {
|
|||||||
return super.onKeyPreIme(keyCode, event);
|
return super.onKeyPreIme(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCheckIsTextEditor() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
|
||||||
|
outAttrs.inputType = InputType.TYPE_CLASS_TEXT;
|
||||||
|
|
||||||
|
// TYPE_TEXT_VARIATION_VISIBLE_PASSWORD disables a bunch of the fancy IME
|
||||||
|
// stuff that we don't support (suggestions, auto-correct, GIFs, etc).
|
||||||
|
outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
|
||||||
|
|
||||||
|
// Don't show suggestions in the IME. We want everything to go through
|
||||||
|
// commitText() rather than setComposingText().
|
||||||
|
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
|
||||||
|
|
||||||
|
// Don't take up the whole screen in landscape mode, since the user
|
||||||
|
// needs to see at least some of the PC's screen.
|
||||||
|
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
|
||||||
|
|
||||||
|
return new StreamViewInputConnection(this, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
class StreamViewInputConnection extends BaseInputConnection {
|
||||||
|
private final KeyCharacterMap kcm;
|
||||||
|
|
||||||
|
private StreamViewInputConnection(View targetView, boolean fullEditor) {
|
||||||
|
super(targetView, fullEditor);
|
||||||
|
kcm = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean commitText(CharSequence text, int newCursorPosition) {
|
||||||
|
if (inputCallbacks != null) {
|
||||||
|
// If all characters have a direct KeyEvent mapping, we'll send this
|
||||||
|
// text as normal key up/down events.
|
||||||
|
KeyEvent[] keyEvents = kcm.getEvents(text.toString().toCharArray());
|
||||||
|
if (keyEvents != null) {
|
||||||
|
for (KeyEvent event : keyEvents) {
|
||||||
|
sendKeyEvent(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Otherwise we'll send it as UTF-8 text
|
||||||
|
inputCallbacks.handleTextEvent(text.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.commitText(text, newCursorPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public interface InputCallbacks {
|
public interface InputCallbacks {
|
||||||
boolean handleKeyUp(KeyEvent event);
|
boolean handleKeyUp(KeyEvent event);
|
||||||
boolean handleKeyDown(KeyEvent event);
|
boolean handleKeyDown(KeyEvent event);
|
||||||
|
void handleTextEvent(String text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
- Fixed crash on Android 12 when using USB driver
|
|
||||||
- Fixed several other rare user-reported crashes
|
|
||||||
Reference in New Issue
Block a user