Try to add the very basics of Android TV support

This commit is contained in:
Henrik Rydgard 2015-03-19 21:23:52 +01:00 committed by Henrik Rydgård
parent 6573bca313
commit 3eff1100d0
5 changed files with 18 additions and 5 deletions

1
.gitignore vendored
View File

@ -28,6 +28,7 @@ ui_atlas.zim.png
ui_atlas_high.zim.png
android/assets
ext/_Output
android/lint.xml
# For Mac
.DS_Store

View File

@ -3,15 +3,17 @@
package="org.ppsspp.ppsspp"
android:installLocation="auto"
android:versionCode="1010"
android:versionName="1.0.1.0" >
android:versionName="1.0.1.0">
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="19" />
android:targetSdkVersion="22" />
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.screen.landscape" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.software.leanback" android:required="false" />
<uses-feature android:name="android.hardware.gamepad" android:required="false"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
@ -29,12 +31,14 @@
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:logo="@drawable/ic_banner" >
android:logo="@drawable/ic_banner"
android:isGame="true"
android:banner="@drawable/tv_banner">
<activity
android:name=".PpssppActivity"
android:configChanges="orientation|locale|keyboard|keyboardHidden|navigation|fontScale|uiMode"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<!-- android:screenOrientation="landscape" -->
<intent-filter>

View File

@ -11,5 +11,5 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-19
target=android-22
android.library.reference.1=../native/android

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -1,10 +1,13 @@
package org.ppsspp.ppsspp;
import android.app.AlertDialog;
import android.app.UiModeManager;
import android.content.res.Configuration;
import android.graphics.Point;
import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
import android.util.Log;
import com.henrikrydgard.libnative.NativeActivity;
import com.henrikrydgard.libnative.NativeApp;
@ -65,6 +68,11 @@ public class PpssppActivity extends NativeActivity {
return;
}
UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE);
if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
Log.i(TAG, "Running on an Android TV Device");
}
// In case app launched from homescreen shortcut, get shortcut parameter
// using Intent extra string. Intent extra will be null if launch normal
// (from app drawer).