[Android] Add an about screen that shows build revision.

This commit is contained in:
Ryan Houdek 2013-06-22 22:54:28 -05:00
parent fea1e3b698
commit 6bb7cc5fea
8 changed files with 210 additions and 88 deletions

View File

@ -109,10 +109,58 @@
</provider>
</entry>
</file>
<file leaf-file-name="project.properties" pinned="false" current="true" current-in-tab="true">
<file leaf-file-name="GameListActivity.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/GameListActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="191" column="26" selection-start="6574" selection-end="6574" vertical-scroll-proportion="0.0" vertical-offset="2160" max-vertical-offset="4125">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="project.properties" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/project.properties">
<provider selected="true" editor-type-id="text-editor">
<state line="13" column="17" selection-start="562" selection-end="562" vertical-scroll-proportion="0.34210527" vertical-offset="0" max-vertical-offset="570">
<state line="13" column="17" selection-start="562" selection-end="562" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="300">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="PrefsActivity.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/PrefsActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="8" column="0" selection-start="215" selection-end="332" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="630">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="AboutActivity.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/AboutActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="12" column="3" selection-start="265" selection-end="265" vertical-scroll-proportion="0.0" vertical-offset="162" max-vertical-offset="555">
<folding>
<element signature="imports" expanded="true" />
<element signature="e#590#604#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="GameListItem.java" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/GameListItem.java">
<provider selected="true" editor-type-id="text-editor">
<state line="22" column="36" selection-start="580" selection-end="580" vertical-scroll-proportion="0.3816794" vertical-offset="90" max-vertical-offset="1050">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="FolderBrowser.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/FolderBrowser.java">
<provider selected="true" editor-type-id="text-editor">
<state line="41" column="61" selection-start="1431" selection-end="1454" vertical-scroll-proportion="0.0" vertical-offset="405" max-vertical-offset="1290">
<folding />
</state>
</provider>
@ -141,9 +189,6 @@
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
<option value="$PROJECT_DIR$/res/layout/activity_main.xml" />
<option value="$PROJECT_DIR$/res/layout/gamelist_listview.xml" />
<option value="$PROJECT_DIR$/res/layout/gamelist_layout.xml" />
<option value="$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/GameListAdapter.java" />
<option value="$PROJECT_DIR$/res/layout/sidemenu.xml" />
<option value="$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/SideMenuAdapter.java" />
@ -152,11 +197,14 @@
<option value="$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/FolderBrowser.java" />
<option value="$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/FolderBrowserAdapter.java" />
<option value="$PROJECT_DIR$/bin/AndroidManifest.xml" />
<option value="$PROJECT_DIR$/AndroidManifest.xml" />
<option value="$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/GameListActivity.java" />
<option value="$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/InputConfigActivity.java" />
<option value="$PROJECT_DIR$/res/layout/folderbrowser.xml" />
<option value="$PROJECT_DIR$/project.properties" />
<option value="$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/NativeLibrary.java" />
<option value="$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/AboutActivity.java" />
<option value="$PROJECT_DIR$/AndroidManifest.xml" />
<option value="$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/GameListActivity.java" />
<option value="$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/GameListItem.java" />
</list>
</option>
</component>
@ -261,6 +309,24 @@
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT USER_OBJECT="Root">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="Android">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="src">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="org/dolphinemu/dolphinemu">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT USER_OBJECT="Root">
<option name="myItemId" value="" />
@ -505,7 +571,7 @@
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32998455" sideWeight="0.69630873" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.29697987" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.29697987" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32718122" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32998326" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2179289" sideWeight="0.29026845" order="3" side_tool="true" content_ui="tabs" />
@ -611,63 +677,6 @@
<breakpoint-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/FolderBrowserAdapter.java">
<provider selected="true" editor-type-id="text-editor">
<state line="43" column="40" selection-start="1231" selection-end="1231" vertical-scroll-proportion="0.6505102" vertical-offset="285" max-vertical-offset="780">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/FolderBrowser.java">
<provider selected="true" editor-type-id="text-editor">
<state line="18" column="25" selection-start="476" selection-end="476" vertical-scroll-proportion="0.19788918" vertical-offset="0" max-vertical-offset="1290">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/GameListAdapter.java">
<provider selected="true" editor-type-id="text-editor">
<state line="12" column="13" selection-start="300" selection-end="300" vertical-scroll-proportion="-0.42091838" vertical-offset="225" max-vertical-offset="825">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/bin/AndroidManifest.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="39" column="18" selection-start="1869" selection-end="1869" vertical-scroll-proportion="1.1336899" vertical-offset="161" max-vertical-offset="720">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/AndroidManifest.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="16" column="17" selection-start="696" selection-end="696" vertical-scroll-proportion="-0.23214285" vertical-offset="331" max-vertical-offset="780">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/res/layout/gamelist_layout.xml">
<provider editor-type-id="android-designer">
<state />
</provider>
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="735">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/res/values/strings.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="570">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/res/drawable/ic_drawer.png">
<provider selected="true" editor-type-id="images">
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/res/layout/folderbrowser.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="25" column="38" selection-start="1051" selection-end="1051" vertical-scroll-proportion="1.0190217" vertical-offset="0" max-vertical-offset="525">
@ -678,20 +687,6 @@
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/PrefsActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="13" column="13" selection-start="346" selection-end="346" vertical-scroll-proportion="0.03816794" vertical-offset="120" max-vertical-offset="630">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/InputConfigActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="58" column="8" selection-start="2544" selection-end="2544" vertical-scroll-proportion="-3.923664" vertical-offset="2217" max-vertical-offset="2610">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/InputConfigAdapter.java">
<provider selected="true" editor-type-id="text-editor">
<state line="16" column="13" selection-start="385" selection-end="385" vertical-scroll-proportion="-0.7557252" vertical-offset="432" max-vertical-offset="825">
@ -699,13 +694,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/GameListActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="173" column="64" selection-start="5829" selection-end="5829" vertical-scroll-proportion="-2.3393178" vertical-offset="3478" max-vertical-offset="4035">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/DolphinEmulator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="17" column="13" selection-start="433" selection-end="433" vertical-scroll-proportion="0.026929982" vertical-offset="45" max-vertical-offset="2850">
@ -720,9 +708,94 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/GameListAdapter.java">
<provider selected="true" editor-type-id="text-editor">
<state line="12" column="13" selection-start="300" selection-end="300" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="825">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/NativeLibrary.java">
<provider selected="true" editor-type-id="text-editor">
<state line="16" column="58" selection-start="731" selection-end="731" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="630">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/InputConfigActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="57" column="0" selection-start="2469" selection-end="2571" vertical-scroll-proportion="0.0" vertical-offset="540" max-vertical-offset="2610">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/InputConfigItem.java">
<provider selected="true" editor-type-id="text-editor">
<state line="7" column="13" selection-start="167" selection-end="167" vertical-scroll-proportion="0.18421052" vertical-offset="0" max-vertical-offset="930">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/SideMenuItem.java">
<provider selected="true" editor-type-id="text-editor">
<state line="8" column="13" selection-start="168" selection-end="168" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="630">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/AndroidManifest.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="38" column="41" selection-start="1810" selection-end="1810" vertical-scroll-proportion="0.6315789" vertical-offset="210" max-vertical-offset="825">
<folding>
<element signature="e#659#677#0" expanded="true" />
<element signature="e#767#785#0" expanded="true" />
<element signature="e#1338#1356#0" expanded="true" />
<element signature="e#1603#1621#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/PrefsActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="8" column="0" selection-start="215" selection-end="332" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="630">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/project.properties">
<provider selected="true" editor-type-id="text-editor">
<state line="13" column="17" selection-start="562" selection-end="562" vertical-scroll-proportion="0.34210527" vertical-offset="0" max-vertical-offset="570">
<state line="13" column="17" selection-start="562" selection-end="562" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="300">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/GameListActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="191" column="26" selection-start="6574" selection-end="6574" vertical-scroll-proportion="0.0" vertical-offset="2160" max-vertical-offset="4125">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/FolderBrowser.java">
<provider selected="true" editor-type-id="text-editor">
<state line="41" column="61" selection-start="1431" selection-end="1454" vertical-scroll-proportion="0.0" vertical-offset="45" max-vertical-offset="1290">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/AboutActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="12" column="3" selection-start="265" selection-end="265" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="555">
<folding>
<element signature="imports" expanded="true" />
<element signature="e#590#604#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/org/dolphinemu/dolphinemu/GameListItem.java">
<provider selected="true" editor-type-id="text-editor">
<state line="22" column="36" selection-start="580" selection-end="580" vertical-scroll-proportion="0.3816794" vertical-offset="90" max-vertical-offset="1050">
<folding />
</state>
</provider>

View File

@ -41,6 +41,9 @@
<activity
android:name=".GameListActivity" >
</activity>
<activity
android:name=".AboutActivity" >
</activity>
</application>
</manifest>

View File

@ -0,0 +1,31 @@
package org.dolphinemu.dolphinemu;
import android.app.ListActivity;
import android.os.Bundle;
import java.util.ArrayList;
import java.util.List;
/**
* Copyright 2013 Dolphin Emulator Project
* Licensed under GPLv2
* Refer to the license.txt file included.
*/
public class AboutActivity extends ListActivity {
private FolderBrowserAdapter adapter;
private int configPosition = 0;
boolean Configuring = false;
boolean firstEvent = true;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
List<GameListItem> Input = new ArrayList<GameListItem>();
int a = 0;
Input.add(a++, new GameListItem(getApplicationContext(), "Build Revision", NativeLibrary.GetVersionString(), ""));
adapter = new FolderBrowserAdapter(this, R.layout.folderbrowser, Input);
setListAdapter(adapter);
}
}

View File

@ -129,6 +129,7 @@ public class GameListActivity extends Activity {
dir.add(new SideMenuItem("Browse Folder", 0));
dir.add(new SideMenuItem("Settings", 1));
dir.add(new SideMenuItem("Gamepad Config", 2));
dir.add(new SideMenuItem("About", 3));
mDrawerAdapter = new SideMenuAdapter(this, R.layout.sidemenu, dir);
mDrawerList.setAdapter(mDrawerAdapter);
@ -184,6 +185,11 @@ public class GameListActivity extends Activity {
Intent ConfigIntent = new Intent(me, InputConfigActivity.class);
startActivityForResult(ConfigIntent, 3);
break;
case 3:
Toast.makeText(me, "Loading up About", Toast.LENGTH_SHORT).show();
Intent AboutIntent = new Intent(me, AboutActivity.class);
startActivityForResult(AboutIntent, 3);
break;
default:
break;
}

View File

@ -20,7 +20,7 @@ public class GameListItem implements Comparable<GameListItem>{
data = d;
path = p;
File file = new File(path);
if (!file.isDirectory())
if (!file.isDirectory() && !path.equals(""))
{
int[] Banner = NativeLibrary.GetBanner(path);
if (Banner[0] == 0)

View File

@ -16,6 +16,7 @@ public class NativeLibrary {
public static native void SetConfig(String configFile, String Key, String Value, String Default);
public static native int[] GetBanner(String filename);
public static native String GetTitle(String filename);
public static native String GetVersionString();
public static native void Run(String File, Surface surf, int width, int height);
public static native void UnPauseEmulation();

View File

@ -27,8 +27,12 @@ const char *scm_rev_str = "Dolphin "
#ifdef _M_X64
#define NP_ARCH "x64"
#else
#ifdef _M_ARM
#define NP_ARCH "ARM"
#else
#define NP_ARCH "x86"
#endif
#endif
#ifdef _WIN32
const char *netplay_dolphin_ver = SCM_DESC_STR " W" NP_ARCH;

View File

@ -254,6 +254,10 @@ JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetTitle(
env->ReleaseStringUTFChars(jFile, File);
return env->NewStringUTF(Name.c_str());
}
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv *env, jobject obj)
{
return env->NewStringUTF(scm_rev_str);
}
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetConfig(JNIEnv *env, jobject obj, jstring jFile, jstring jKey, jstring jValue, jstring jDefault)
{
IniFile ini;