From 7c14996e3e24b0a4a1064ece1c656bcbe6c923c7 Mon Sep 17 00:00:00 2001 From: sigmabeta Date: Tue, 14 Jul 2015 22:35:52 -0400 Subject: [PATCH 1/4] Android TV: Implement game selector activity in new Android TV UI --- Source/Android/app/build.gradle | 6 +- .../Android/app/src/main/AndroidManifest.xml | 13 +- .../dolphinemu/activities/MainActivity.java | 2 +- .../dolphinemu/activities/TvMainActivity.java | 141 ++++++++++++++++++ .../dolphinemu/adapters/GamePresenter.java | 122 +++++++++++++++ .../org/dolphinemu/dolphinemu/model/Game.java | 33 +--- .../viewholders/TvGameViewHolder.java | 40 +++++ .../src/main/res/layout/activity_tv_main.xml | 13 ++ .../app/src/main/res/layout/card_game.xml | 1 - .../app/src/main/res/values/colors.xml | 2 + .../app/src/main/res/values/styles.xml | 15 ++ 11 files changed, 358 insertions(+), 30 deletions(-) create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/TvMainActivity.java create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GamePresenter.java create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvGameViewHolder.java create mode 100644 Source/Android/app/src/main/res/layout/activity_tv_main.xml diff --git a/Source/Android/app/build.gradle b/Source/Android/app/build.gradle index 8f5ce60a76..9668d8af95 100644 --- a/Source/Android/app/build.gradle +++ b/Source/Android/app/build.gradle @@ -1,7 +1,8 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 21 + // Leanback support requires >22 + compileSdkVersion 22 buildToolsVersion "22.0.1" lintOptions { @@ -80,6 +81,9 @@ dependencies { compile 'com.android.support:recyclerview-v7:22.2.0' compile 'com.android.support:design:22.2.0' + // Android TV UI libraries. + compile 'com.android.support:leanback-v17:22.2.0' + // For showing the banner as a circle a-la Material Design Guidelines compile 'de.hdodenhof:circleimageview:1.2.2' diff --git a/Source/Android/app/src/main/AndroidManifest.xml b/Source/Android/app/src/main/AndroidManifest.xml index 30fffd11e9..e08b2dd0a8 100644 --- a/Source/Android/app/src/main/AndroidManifest.xml +++ b/Source/Android/app/src/main/AndroidManifest.xml @@ -33,11 +33,22 @@ - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Android/app/src/main/res/layout/card_game.xml b/Source/Android/app/src/main/res/layout/card_game.xml index 9b172b6871..542969ebd6 100644 --- a/Source/Android/app/src/main/res/layout/card_game.xml +++ b/Source/Android/app/src/main/res/layout/card_game.xml @@ -33,7 +33,6 @@ android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:layout_marginTop="16dp" - android:layout_toStartOf="@+id/button_details" android:ellipsize="end" android:lines="1" android:maxLines="1" diff --git a/Source/Android/app/src/main/res/values/colors.xml b/Source/Android/app/src/main/res/values/colors.xml index d7b7847125..9052de99d5 100644 --- a/Source/Android/app/src/main/res/values/colors.xml +++ b/Source/Android/app/src/main/res/values/colors.xml @@ -8,4 +8,6 @@ #651fff #bdbdbd + + #444444 \ No newline at end of file diff --git a/Source/Android/app/src/main/res/values/styles.xml b/Source/Android/app/src/main/res/values/styles.xml index 76ee1f8f55..dba853f492 100644 --- a/Source/Android/app/src/main/res/values/styles.xml +++ b/Source/Android/app/src/main/res/values/styles.xml @@ -126,6 +126,21 @@ false + + + + +