Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Add an about screen that shows build revision.
  • Loading branch information
Sonicadvance1 committed Jun 23, 2013
1 parent fea1e3b commit 6bb7cc5
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 49 deletions.
169 changes: 121 additions & 48 deletions Source/Android/.idea/workspace.xml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Source/Android/AndroidManifest.xml
Expand Up @@ -41,6 +41,9 @@
<activity
android:name=".GameListActivity" >
</activity>
<activity
android:name=".AboutActivity" >
</activity>
</application>

</manifest>
31 changes: 31 additions & 0 deletions Source/Android/src/org/dolphinemu/dolphinemu/AboutActivity.java
@@ -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);
}
}
Expand Up @@ -129,6 +129,7 @@ protected void onCreate(Bundle savedInstanceState) {
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);
Expand Down Expand Up @@ -184,6 +185,11 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
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;
}
Expand Down
Expand Up @@ -20,7 +20,7 @@ public GameListItem(Context ctx, String n,String d,String p)
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)
Expand Down
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/Common/Src/Version.cpp
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/DolphinWX/Src/MainAndroid.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 6bb7cc5

Please sign in to comment.