Permalink
Browse files

Merge pull request #7076 from JosJuice/android-gamelist-uicommon

Use UICommon's game list code on Android
  • Loading branch information...
JosJuice committed Jun 8, 2018
2 parents d23c3e9 + f0f8ca2 commit ca3d68cee581435217fe737390a9fed833ac3338
Showing with 985 additions and 1,578 deletions.
  1. +1 −7 Source/Android/app/src/main/AndroidManifest.xml
  2. +2 −5 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/DolphinApplication.java
  3. +0 −49 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java
  4. +14 −5 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
  5. +24 −132 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java
  6. +19 −21 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java
  7. +20 −32 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java
  8. +0 −95 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/FileListItem.java
  9. +0 −120 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/Game.java
  10. +0 −295 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameDatabase.java
  11. +34 −0 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFile.java
  12. +89 −0 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFileCache.java
  13. +0 −150 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameProvider.java
  14. +1 −1 .../Android/app/src/main/java/org/dolphinemu/dolphinemu/services/DirectoryInitializationService.java
  15. +125 −0 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/services/GameFileCacheService.java
  16. +19 −23 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainActivity.java
  17. +36 −26 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainPresenter.java
  18. +3 −11 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainView.java
  19. +35 −55 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/TvMainActivity.java
  20. +4 −6 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/Platform.java
  21. +9 −15 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java
  22. +0 −57 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesPresenter.java
  23. +5 −11 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesView.java
  24. +0 −44 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/AddDirectoryHelper.java
  25. +12 −6 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/GameBannerRequestHandler.java
  26. +7 −6 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/PicassoUtils.java
  27. +5 −12 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/GameViewHolder.java
  28. +3 −9 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/viewholders/TvGameViewHolder.java
  29. +4 −4 Source/Android/app/src/main/res/layout/dialog_game_details.xml
  30. +26 −0 Source/Android/jni/AndroidCommon/AndroidCommon.cpp
  31. +12 −0 Source/Android/jni/AndroidCommon/AndroidCommon.h
  32. +110 −0 Source/Android/jni/AndroidCommon/IDCache.cpp
  33. +23 −0 Source/Android/jni/AndroidCommon/IDCache.h
  34. +4 −0 Source/Android/jni/CMakeLists.txt
  35. +140 −0 Source/Android/jni/GameList/GameFile.cpp
  36. +17 −0 Source/Android/jni/GameList/GameFile.h
  37. +121 −0 Source/Android/jni/GameList/GameFileCache.cpp
  38. +16 −358 Source/Android/jni/MainAndroid.cpp
  39. +8 −8 Source/Core/Core/HW/WiimoteReal/IOAndroid.cpp
  40. +8 −9 Source/Core/InputCommon/GCAdapter_Android.cpp
  41. +8 −1 Source/Core/UICommon/GameFile.cpp
  42. +16 −3 Source/Core/UICommon/GameFileCache.cpp
  43. +5 −2 Source/Core/UICommon/GameFileCache.h
@@ -71,13 +71,7 @@
</activity>
<service android:name=".services.DirectoryInitializationService"/>
<provider
android:name=".model.GameProvider"
android:authorities="${applicationId}.provider"
android:enabled="true"
android:exported="false">
</provider>
<service android:name=".services.GameFileCacheService"/>
<provider
android:name="android.support.v4.content.FileProvider"
@@ -2,22 +2,19 @@
import android.app.Application;
import org.dolphinemu.dolphinemu.model.GameDatabase;
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService;
import org.dolphinemu.dolphinemu.utils.PermissionsHandler;
public class DolphinApplication extends Application
{
public static GameDatabase databaseHelper;
@Override
public void onCreate()
{
super.onCreate();
System.loadLibrary("main");
if (PermissionsHandler.hasWriteAccess(getApplicationContext()))
DirectoryInitializationService.startService(getApplicationContext());
databaseHelper = new GameDatabase(this);
}
}
@@ -260,34 +260,6 @@ private NativeLibrary()
*/
public static native void SetConfig(String configFile, String Section, String Key, String Value);
/**
* Gets the embedded banner within the given ISO/ROM.
*
* @param filename the file path to the ISO/ROM.
*
* @return an integer array containing the color data for the banner.
*/
public static native int[] GetBanner(String filename);
/**
* Gets the embedded title of the given ISO/ROM.
*
* @param filename The file path to the ISO/ROM.
*
* @return the embedded title of the ISO/ROM.
*/
public static native String GetTitle(String filename);
public static native String GetDescription(String filename);
public static native String GetGameId(String filename);
public static native int GetCountry(String filename);
public static native String GetCompany(String filename);
public static native long GetFilesize(String filename);
public static native int GetPlatform(String filename);
/**
* Gets the Dolphin version string.
*
@@ -394,27 +366,6 @@ private NativeLibrary()
*/
public static native void RefreshWiimotes();
/**
* The methods C++ uses to find references to Java classes and methods
* are really expensive. Rather than calling them every time we want to
* run them, do it once when we load the native library.
*/
private static native void CacheClassesAndMethods();
static
{
try
{
System.loadLibrary("main");
}
catch (UnsatisfiedLinkError ex)
{
Log.error("[NativeLibrary] " + ex.toString());
}
CacheClassesAndMethods();
}
private static boolean alertResult = false;
public static boolean displayAlertMsg(final String caption, final String text, final boolean yesNo)
{
@@ -36,6 +36,7 @@
import org.dolphinemu.dolphinemu.fragments.EmulationFragment;
import org.dolphinemu.dolphinemu.fragments.MenuFragment;
import org.dolphinemu.dolphinemu.fragments.SaveLoadStateFragment;
import org.dolphinemu.dolphinemu.model.GameFile;
import org.dolphinemu.dolphinemu.ui.main.MainActivity;
import org.dolphinemu.dolphinemu.ui.main.MainPresenter;
import org.dolphinemu.dolphinemu.ui.platform.Platform;
@@ -74,10 +75,12 @@
private boolean activityRecreated;
private String mScreenPath;
private String mSelectedTitle;
private int mPlatform;
private String mPath;
public static final String EXTRA_SELECTED_GAME = "SelectedGame";
public static final String EXTRA_SELECTED_TITLE = "SelectedTitle";
public static final String EXTRA_PLATFORM = "Platform";
public static final String EXTRA_SCREEN_PATH = "ScreenPath";
public static final String EXTRA_GRID_POSITION = "GridPosition";
@@ -146,13 +149,14 @@
buttonsActionsMap.append(R.id.menu_exit, EmulationActivity.MENU_ACTION_EXIT);
}
public static void launch(FragmentActivity activity, String path, String title, String screenshotPath, int position, View sharedView)
public static void launch(FragmentActivity activity, GameFile gameFile, int position, View sharedView)
{
Intent launcher = new Intent(activity, EmulationActivity.class);
launcher.putExtra(EXTRA_SELECTED_GAME, path);
launcher.putExtra(EXTRA_SELECTED_TITLE, title);
launcher.putExtra(EXTRA_SCREEN_PATH, screenshotPath);
launcher.putExtra(EXTRA_SELECTED_GAME, gameFile.getPath());
launcher.putExtra(EXTRA_SELECTED_TITLE, gameFile.getTitle());
launcher.putExtra(EXTRA_PLATFORM, gameFile.getPlatform());
launcher.putExtra(EXTRA_SCREEN_PATH, gameFile.getScreenshotPath());
launcher.putExtra(EXTRA_GRID_POSITION, position);
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(
@@ -176,6 +180,7 @@ protected void onCreate(Bundle savedInstanceState)
Intent gameToEmulate = getIntent();
mPath = gameToEmulate.getStringExtra(EXTRA_SELECTED_GAME);
mSelectedTitle = gameToEmulate.getStringExtra(EXTRA_SELECTED_TITLE);
mPlatform = gameToEmulate.getIntExtra(EXTRA_PLATFORM, 0);
mScreenPath = gameToEmulate.getStringExtra(EXTRA_SCREEN_PATH);
mPosition = gameToEmulate.getIntExtra(EXTRA_GRID_POSITION, -1);
activityRecreated = false;
@@ -186,7 +191,9 @@ protected void onCreate(Bundle savedInstanceState)
restoreState(savedInstanceState);
}
sIsGameCubeGame = Platform.fromNativeInt(NativeLibrary.GetPlatform(mPath)) == Platform.GAMECUBE;
// TODO: The accurate way to find out which console we're emulating is to
// first launch emulation and then ask the core which console we're emulating
sIsGameCubeGame = Platform.fromNativeInt(mPlatform) == Platform.GAMECUBE;
mDeviceHasTouchScreen = getPackageManager().hasSystemFeature("android.hardware.touchscreen");
mControllerMappingHelper = new ControllerMappingHelper();
@@ -284,6 +291,7 @@ protected void onSaveInstanceState(Bundle outState)
mEmulationFragment.saveTemporaryState();
outState.putString(EXTRA_SELECTED_GAME, mPath);
outState.putString(EXTRA_SELECTED_TITLE, mSelectedTitle);
outState.putInt(EXTRA_PLATFORM, mPlatform);
outState.putString(EXTRA_SCREEN_PATH, mScreenPath);
outState.putInt(EXTRA_GRID_POSITION, mPosition);
super.onSaveInstanceState(outState);
@@ -293,6 +301,7 @@ protected void restoreState(Bundle savedInstanceState)
{
mPath = savedInstanceState.getString(EXTRA_SELECTED_GAME);
mSelectedTitle = savedInstanceState.getString(EXTRA_SELECTED_TITLE);
mPlatform = savedInstanceState.getInt(EXTRA_PLATFORM);
mScreenPath = savedInstanceState.getString(EXTRA_SCREEN_PATH);
mPosition = savedInstanceState.getInt(EXTRA_GRID_POSITION);
}
Oops, something went wrong.

0 comments on commit ca3d68c

Please sign in to comment.