Browse Source

Add gamepad hint for Android TV

pull/6400/merge
Anders Jenbo 3 years ago
parent
commit
2b79ddb649
  1. 7
      android-project/app/src/main/java/org/diasurgical/devilutionx/DataActivity.java
  2. 271
      android-project/app/src/main/res/drawable/gamepad.xml
  3. 25
      android-project/app/src/main/res/layout/activity_data.xml
  4. 1
      android-project/app/src/main/res/values/strings.xml

7
android-project/app/src/main/java/org/diasurgical/devilutionx/DataActivity.java

@ -6,6 +6,7 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
@ -33,6 +34,12 @@ public class DataActivity extends Activity {
((TextView) findViewById(R.id.full_guide)).setMovementMethod(LinkMovementMethod.getInstance());
((TextView) findViewById(R.id.online_guide)).setMovementMethod(LinkMovementMethod.getInstance());
boolean isTelevision = getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK);
if (isTelevision) {
findViewById(R.id.gamepad_text).setVisibility(View.VISIBLE);
findViewById(R.id.gamepad_icon).setVisibility(View.VISIBLE);
}
}
protected void onResume() {

271
android-project/app/src/main/res/drawable/gamepad.xml

@ -0,0 +1,271 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="39.595dp"
android:height="27.966dp"
android:viewportWidth="39.595"
android:viewportHeight="27.966">
<path
android:pathData="m37.009,7.862 l-0.002,0.001c-0.666,-4.128 -4.233,-7.267 -8.551,-7.267L17.912,0.596l21.42,21.845zM37.009,7.862"
android:strokeWidth="0.0515891"
android:fillColor="#282b28"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m13.751,0h-3.994v0.876h3.994zM13.751,0"
android:strokeWidth="0.0515891"
android:fillColor="#0c0c0c"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m29.81,0h-3.994v0.876h3.994zM29.81,0"
android:strokeWidth="0.0515891"
android:fillColor="#0c0c0c"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m39.501,23.648 l-2.492,-15.637 -0.002,0.001c-0.666,-4.128 -4.233,-7.267 -8.551,-7.267L11.134,0.744c-4.31,0 -7.882,3.138 -8.548,7.266l-2.492,15.637c-0.062,0.261 -0.095,0.533 -0.095,0.812 0,1.936 1.57,3.506 3.506,3.506 0.968,0 1.845,-0.392 2.479,-1.027l6.391,-6.397h14.846l6.389,6.397c0.635,0.634 1.511,1.027 2.479,1.027 1.936,0 3.506,-1.57 3.506,-3.506 0,-0.28 -0.033,-0.552 -0.095,-0.812"
android:strokeWidth="0.0515891"
android:fillColor="#282b28"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m36.089,27.433c-0.968,0 -1.844,-0.377 -2.479,-0.986L27.222,20.3L12.376,20.3l-6.391,6.147c-0.634,0.609 -1.511,0.986 -2.479,0.986 -1.869,0 -3.397,-1.406 -3.5,-3.178 -0.004,0.068 -0.006,0.136 -0.006,0.205 0,1.936 1.569,3.506 3.506,3.506 0.968,0 1.845,-0.392 2.479,-1.027l6.391,-6.397h14.846l6.389,6.397c0.634,0.634 1.511,1.027 2.479,1.027 1.936,0 3.506,-1.57 3.506,-3.506 0,-0.069 -0.002,-0.137 -0.006,-0.205 -0.103,1.772 -1.63,3.178 -3.5,3.178"
android:strokeWidth="0.0515891"
android:fillColor="#0c0c0c"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m28.009,18.607c0.538,-0.685 8.89,-11.32 8.89,-11.32 -0.884,-3.848 -4.322,-6.707 -8.441,-6.707h-17.323c-4.113,0 -7.553,2.858 -8.438,6.707 0,0 8.651,10.972 9.016,11.477 0.365,0.505 0.838,0.846 1.697,0.846h12.588c0.757,0 1.474,-0.317 2.012,-1.002"
android:strokeWidth="0.0515891"
android:fillColor="#454545"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="M28.354,0.58L17.897,0.58l13.536,13.536c2.486,-3.165 5.363,-6.829 5.363,-6.829 -0.884,-3.848 -4.322,-6.707 -8.441,-6.707"
android:strokeWidth="0.0515891"
android:fillColor="#4c4c4c"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m28.321,9.279c0,0.606 0.49,1.095 1.095,1.095 0.606,0 1.096,-0.489 1.096,-1.095 0,-0.607 -0.49,-1.096 -1.096,-1.096 -0.605,0 -1.095,0.489 -1.095,1.096"
android:strokeWidth="0.0515891"
android:fillColor="#eeeeee"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m28.321,4.181c0,0.606 0.49,1.095 1.095,1.095 0.606,0 1.096,-0.49 1.096,-1.095 0,-0.607 -0.49,-1.096 -1.096,-1.096 -0.605,0 -1.095,0.489 -1.095,1.096"
android:strokeWidth="0.0515891"
android:fillColor="#eeeeee"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m25.84,6.73c0,0.606 0.49,1.095 1.095,1.095 0.606,0 1.096,-0.49 1.096,-1.095 0,-0.607 -0.49,-1.096 -1.096,-1.096 -0.605,0 -1.095,0.489 -1.095,1.096"
android:strokeWidth="0.0515891"
android:fillColor="#eeeeee"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m30.801,6.73c0,0.606 0.49,1.095 1.095,1.095 0.606,0 1.096,-0.49 1.096,-1.095 0,-0.607 -0.49,-1.096 -1.096,-1.096 -0.605,0 -1.095,0.489 -1.095,1.096"
android:strokeWidth="0.0515891"
android:fillColor="#eeeeee"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m2.697,7.329c0,0 8.651,10.971 9.016,11.477 0.365,0.505 0.838,0.845 1.697,0.845h4.27L4.24,4.038c-0.73,0.959 -1.264,2.075 -1.544,3.291"
android:strokeWidth="0.0515891"
android:fillColor="#383838"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m11.632,14.21c0,2.016 1.631,3.646 3.646,3.646 2.018,0 3.648,-1.63 3.648,-3.646 0,-2.019 -1.63,-3.648 -3.648,-3.648 -2.015,0 -3.646,1.628 -3.646,3.648"
android:strokeWidth="0.0515891"
android:fillColor="#282b28"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m12.371,14.31c0,1.608 1.301,2.907 2.908,2.906 1.609,-0 2.908,-1.3 2.908,-2.908 -0,-1.61 -1.3,-2.908 -2.909,-2.908 -1.606,0 -2.907,1.299 -2.906,2.909"
android:strokeWidth="0.0515891"
android:fillColor="#eeeeee"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<group>
<clip-path
android:pathData="M12.359,11.392l5.83,0l0,3.044l-5.83,0z"/>
<group>
<clip-path
android:pathData="M12.371,11.401L18.186,11.401L18.186,14.4L12.371,14.4ZM12.371,11.401"/>
<path
android:pathData="m15.278,11.583c1.578,0 2.856,1.25 2.904,2.818 0.001,-0.03 0.005,-0.06 0.005,-0.091 0,-1.61 -1.3,-2.909 -2.909,-2.909 -1.607,0 -2.907,1.298 -2.907,2.909 0,0.031 0.003,0.06 0.005,0.091C12.423,12.833 13.702,11.583 15.278,11.583"
android:fillColor="#ffffff"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
</group>
</group>
<group>
<clip-path
android:pathData="M12.359,14.178l5.83,0l0,3.044l-5.83,0z"/>
<group>
<clip-path
android:pathData="M12.371,14.217L18.186,14.217L18.186,17.217L12.371,17.217ZM12.371,14.217"/>
<path
android:pathData="M18.182,14.217C18.134,15.785 16.856,17.035 15.278,17.035 13.702,17.035 12.423,15.785 12.375,14.217 12.374,14.248 12.371,14.277 12.371,14.308c0,1.61 1.301,2.909 2.907,2.909 1.609,0 2.909,-1.298 2.909,-2.909 0,-0.031 -0.003,-0.06 -0.005,-0.091"
android:fillColor="#b3b3b3"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
</group>
</group>
<path
android:pathData="m20.583,14.21c0,2.016 1.631,3.646 3.646,3.646 2.018,0 3.648,-1.63 3.648,-3.646 0,-2.019 -1.63,-3.648 -3.648,-3.648 -2.015,0 -3.646,1.628 -3.646,3.648"
android:strokeWidth="0.0515891"
android:fillColor="#282b28"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m21.321,14.31c0,1.608 1.302,2.907 2.908,2.906 1.609,-0 2.908,-1.3 2.908,-2.908 -0,-1.61 -1.3,-2.908 -2.909,-2.908 -1.606,0 -2.907,1.299 -2.907,2.909"
android:strokeWidth="0.0515891"
android:fillColor="#eeeeee"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<group>
<clip-path
android:pathData="M21.284,14.178l5.881,0l0,3.044l-5.881,0z"/>
<group>
<clip-path
android:pathData="M21.321,14.217L27.137,14.217L27.137,17.217L21.321,17.217ZM21.321,14.217"/>
<path
android:pathData="M27.133,14.217C27.084,15.785 25.807,17.035 24.229,17.035 22.653,17.035 21.374,15.785 21.326,14.217 21.325,14.248 21.321,14.277 21.321,14.308c0,1.61 1.301,2.909 2.907,2.909 1.609,0 2.909,-1.298 2.909,-2.909 0,-0.031 -0.004,-0.06 -0.005,-0.091"
android:fillColor="#b3b3b3"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
</group>
</group>
<path
android:pathData="M10.812,5.896L10.812,3.457h-1.829v2.439h-2.439v1.829h2.439v2.439h1.829v-2.439h2.439L13.25,5.896ZM10.812,5.896"
android:strokeWidth="0.0515891"
android:fillColor="#eeeeee"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<group>
<clip-path
android:pathData="M8.955,3.448l1.857,0l0,0.206l-1.857,0z"/>
<group>
<clip-path
android:pathData="M8.982,3.457L10.812,3.457L10.812,3.61L8.982,3.61ZM8.982,3.457"/>
<path
android:pathData="M10.812,3.457L8.982,3.457l0,0.152l1.829,0zM10.812,3.457"
android:fillColor="#ffffff"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
</group>
</group>
<group>
<clip-path
android:pathData="M8.077,5.872l0.929,0l0,0.206l-0.929,0z"/>
<group>
<clip-path
android:pathData="M8.077,5.896L8.982,5.896L8.982,6.049L8.077,6.049ZM8.077,5.896"/>
<path
android:pathData="m8.982,5.896l-2.439,0l0,0.152l2.439,0zM8.982,5.896"
android:fillColor="#ffffff"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
</group>
</group>
<group>
<clip-path
android:pathData="M10.76,5.872l2.528,0l0,0.206l-2.528,0z"/>
<group>
<clip-path
android:pathData="m10.812,5.896l2.439,0L13.251,6.049L10.812,6.049ZM10.812,5.896"/>
<path
android:pathData="M13.251,5.896L10.812,5.896l0,0.152l2.439,0zM13.251,5.896"
android:fillColor="#ffffff"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
</group>
</group>
<group>
<clip-path
android:pathData="M8.077,7.526l0.929,0l0,0.206l-0.929,0z"/>
<group>
<clip-path
android:pathData="M8.077,7.573L8.982,7.573L8.982,7.725L8.077,7.725ZM8.077,7.573"/>
<path
android:pathData="M8.982,7.573L6.543,7.573L6.543,7.725l2.439,0zM8.982,7.573"
android:fillColor="#b3b3b3"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
</group>
</group>
<group>
<clip-path
android:pathData="M8.955,10.002l1.857,0l0,0.206l-1.857,0z"/>
<group>
<clip-path
android:pathData="M8.982,10.012L10.812,10.012L10.812,10.164L8.982,10.164ZM8.982,10.012"/>
<path
android:pathData="M10.812,10.012L8.982,10.012l0,0.152l1.829,0zM10.812,10.012"
android:fillColor="#b3b3b3"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
</group>
</group>
<group>
<clip-path
android:pathData="M10.76,7.526l2.528,0l0,0.206l-2.528,0z"/>
<group>
<clip-path
android:pathData="m10.812,7.573l2.439,0L13.251,7.725L10.812,7.725ZM10.812,7.573"/>
<path
android:pathData="M13.251,7.573L10.812,7.573L10.812,7.725l2.439,0zM13.251,7.573"
android:fillColor="#b3b3b3"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
</group>
</group>
<path
android:pathData="m18.077,6.811c0,0.692 -0.561,1.253 -1.253,1.253 -0.692,0 -1.253,-0.561 -1.253,-1.253 0,-0.692 0.561,-1.253 1.253,-1.253 0.692,0 1.253,0.561 1.253,1.253"
android:strokeWidth="0.0515891"
android:fillColor="#0c0c0c"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m16.872,7.41 l-0.594,-0.599 0.594,-0.6"
android:strokeLineJoin="miter"
android:strokeWidth="0.143882"
android:fillColor="#00000000"
android:strokeColor="#ffffff"
android:strokeLineCap="butt"/>
<path
android:pathData="m16.278,6.811h1.195"
android:strokeLineJoin="miter"
android:strokeWidth="0.143882"
android:fillColor="#00000000"
android:strokeColor="#ffffff"
android:strokeLineCap="butt"/>
<path
android:pathData="m23.687,6.811c0,0.692 -0.561,1.253 -1.253,1.253 -0.692,0 -1.253,-0.561 -1.253,-1.253 0,-0.692 0.561,-1.253 1.253,-1.253 0.692,0 1.253,0.561 1.253,1.253"
android:strokeWidth="0.0515891"
android:fillColor="#0c0c0c"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
<path
android:pathData="m23.01,6.785c0,0.318 -0.258,0.575 -0.576,0.575 -0.318,0 -0.575,-0.258 -0.575,-0.575 0,-0.318 0.258,-0.576 0.575,-0.576 0.318,0 0.576,0.258 0.576,0.576zM23.01,6.785"
android:strokeLineJoin="miter"
android:strokeWidth="0.143882"
android:fillColor="#00000000"
android:strokeColor="#ffffff"
android:strokeLineCap="butt"/>
<group>
<clip-path
android:pathData="M21.31,11.392l5.83,0l0,3.044l-5.83,0z"/>
<group>
<clip-path
android:pathData="M21.322,11.401L27.137,11.401L27.137,14.4L21.322,14.4ZM21.322,11.401"/>
<path
android:pathData="m24.229,11.583c1.578,0 2.856,1.25 2.904,2.818 0.001,-0.03 0.005,-0.06 0.005,-0.091 0,-1.61 -1.3,-2.909 -2.909,-2.909 -1.607,0 -2.907,1.298 -2.907,2.909 0,0.031 0.003,0.06 0.005,0.091C21.374,12.833 22.653,11.583 24.229,11.583"
android:fillColor="#ffffff"
android:strokeColor="#00000000"
android:fillType="nonZero"/>
</group>
</group>
</vector>

25
android-project/app/src/main/res/layout/activity_data.xml

@ -75,4 +75,29 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/full_guide" />
<ImageView
android:id="@+id/gamepad_icon"
android:layout_width="247dp"
android:layout_height="154dp"
android:layout_marginTop="16dp"
android:src="@drawable/gamepad"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/gamepad_text" />
<TextView
android:id="@+id/gamepad_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="@string/gamepad_tv_text"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/download_button" />
</android.support.constraint.ConstraintLayout>

1
android-project/app/src/main/res/values/strings.xml

@ -12,4 +12,5 @@
<string name="download_started">Download started</string>
<string name="shareware_data">Diablo Demo Data</string>
<string name="import_short_label">Import Data</string>
<string name="gamepad_tv_text">This game requires a gamepad to play</string>
</resources>

Loading…
Cancel
Save