mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-23 08:46:40 +00:00
Change target SDK to KitKat. Use immersive mode for streaming on KitKat devices.
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="16"
|
android:minSdkVersion="16"
|
||||||
android:targetSdkVersion="18" />
|
android:targetSdkVersion="19" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
|
|||||||
@@ -11,4 +11,4 @@
|
|||||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||||
|
|
||||||
# Project target.
|
# Project target.
|
||||||
target=android-18
|
target=android-19
|
||||||
|
|||||||
@@ -47,9 +47,6 @@ public class Game extends Activity implements OnGenericMotionListener, OnTouchLi
|
|||||||
// We don't want a title bar
|
// We don't want a title bar
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
|
||||||
// Make the UI "low profile"
|
|
||||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
|
||||||
|
|
||||||
// Inflate the content
|
// Inflate the content
|
||||||
setContentView(R.layout.activity_game);
|
setContentView(R.layout.activity_game);
|
||||||
|
|
||||||
@@ -62,6 +59,29 @@ public class Game extends Activity implements OnGenericMotionListener, OnTouchLi
|
|||||||
conn = new NvConnection(Game.this.getIntent().getStringExtra("host"), Game.this, sv.getHolder().getSurface());
|
conn = new NvConnection(Game.this.getIntent().getStringExtra("host"), Game.this, sv.getHolder().getSurface());
|
||||||
conn.start();
|
conn.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void hideSystemUi() {
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// Use immersive mode on 4.4+ or standard low profile on previous builds
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
|
||||||
|
Game.this.getWindow().getDecorView().setSystemUiVisibility(
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
|
||||||
|
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
|
||||||
|
View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||||
|
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Game.this.getWindow().getDecorView().setSystemUiVisibility(
|
||||||
|
View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||||
|
View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
|
|||||||
@@ -12,15 +12,15 @@ import java.util.concurrent.TimeUnit;
|
|||||||
|
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.view.Surface;
|
import android.view.Surface;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.limelight.Game;
|
||||||
import com.limelight.nvstream.input.NvController;
|
import com.limelight.nvstream.input.NvController;
|
||||||
|
|
||||||
public class NvConnection {
|
public class NvConnection {
|
||||||
private String host;
|
private String host;
|
||||||
private Activity activity;
|
private Game activity;
|
||||||
|
|
||||||
private NvControl controlStream;
|
private NvControl controlStream;
|
||||||
private NvController inputStream;
|
private NvController inputStream;
|
||||||
@@ -30,7 +30,7 @@ public class NvConnection {
|
|||||||
|
|
||||||
private ThreadPoolExecutor threadPool;
|
private ThreadPoolExecutor threadPool;
|
||||||
|
|
||||||
public NvConnection(String host, Activity activity, Surface video)
|
public NvConnection(String host, Game activity, Surface video)
|
||||||
{
|
{
|
||||||
this.host = host;
|
this.host = host;
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
@@ -107,6 +107,7 @@ public class NvConnection {
|
|||||||
beginControlStream();
|
beginControlStream();
|
||||||
controlStream.startJitterPackets();
|
controlStream.startJitterPackets();
|
||||||
startController();
|
startController();
|
||||||
|
activity.hideSystemUi();
|
||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
displayToast(e.getMessage());
|
displayToast(e.getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user