android: Rename main entry class to CitraApplication.

This commit is contained in:
bunnei 2019-08-30 22:52:06 -04:00
parent a10290e6f8
commit bd75e7d840
7 changed files with 25 additions and 21 deletions

View File

@ -19,7 +19,7 @@
<application <application
android:name=".DolphinApplication" android:name=".CitraApplication"
android:label="@string/app_name" android:label="@string/app_name"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:allowBackup="true" android:allowBackup="true"

View File

@ -1,3 +1,7 @@
// Copyright 2019 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
package org.citra.citra_android; package org.citra.citra_android;
import android.app.Application; import android.app.Application;
@ -7,9 +11,9 @@ import org.citra.citra_android.model.GameDatabase;
import org.citra.citra_android.services.DirectoryInitializationService; import org.citra.citra_android.services.DirectoryInitializationService;
import org.citra.citra_android.utils.PermissionsHandler; import org.citra.citra_android.utils.PermissionsHandler;
public class DolphinApplication extends Application { public class CitraApplication extends Application {
public static GameDatabase databaseHelper; public static GameDatabase databaseHelper;
private static DolphinApplication application; private static CitraApplication application;
@Override @Override
public void onCreate() { public void onCreate() {

View File

@ -290,12 +290,12 @@ public final class NativeLibrary {
public static native void SwapScreens(boolean is_portrait_mode); public static native void SwapScreens(boolean is_portrait_mode);
public static boolean isPortraitMode() { public static boolean isPortraitMode() {
return DolphinApplication.getAppContext().getResources().getConfiguration().orientation == return CitraApplication.getAppContext().getResources().getConfiguration().orientation ==
Configuration.ORIENTATION_PORTRAIT; Configuration.ORIENTATION_PORTRAIT;
} }
public static int landscapeScreenLayout() { public static int landscapeScreenLayout() {
return PreferenceManager.getDefaultSharedPreferences(DolphinApplication.getAppContext()) return PreferenceManager.getDefaultSharedPreferences(CitraApplication.getAppContext())
.getInt("LandscapeScreenLayout", EmulationActivity.LayoutOption_MobileLandscape); .getInt("LandscapeScreenLayout", EmulationActivity.LayoutOption_MobileLandscape);
} }
@ -400,7 +400,7 @@ public final class NativeLibrary {
params.leftMargin = params.rightMargin = CitraApplication.getAppContext().getResources().getDimensionPixelSize(R.dimen.dialog_margin); params.leftMargin = params.rightMargin = CitraApplication.getAppContext().getResources().getDimensionPixelSize(R.dimen.dialog_margin);
// Set up the input // Set up the input
alertPromptEditText = new EditText(DolphinApplication.getAppContext()); alertPromptEditText = new EditText(CitraApplication.getAppContext());
alertPromptEditText.setText(text); alertPromptEditText.setText(text);
alertPromptEditText.setSingleLine(); alertPromptEditText.setSingleLine();
alertPromptEditText.setLayoutParams(params); alertPromptEditText.setLayoutParams(params);

View File

@ -8,7 +8,7 @@ import android.widget.Toast;
import org.citra.citra_android.NativeLibrary; import org.citra.citra_android.NativeLibrary;
import org.citra.citra_android.R; import org.citra.citra_android.R;
import org.citra.citra_android.DolphinApplication; import org.citra.citra_android.CitraApplication;
import org.citra.citra_android.model.settings.Setting; import org.citra.citra_android.model.settings.Setting;
import org.citra.citra_android.model.settings.StringSetting; import org.citra.citra_android.model.settings.StringSetting;
import org.citra.citra_android.utils.SettingsFile; import org.citra.citra_android.utils.SettingsFile;
@ -207,7 +207,7 @@ public final class InputBindingSetting extends SettingsItem {
*/ */
public void removeOldMapping() { public void removeOldMapping() {
// Get preferences editor // Get preferences editor
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(DolphinApplication.getAppContext()); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(CitraApplication.getAppContext());
SharedPreferences.Editor editor = preferences.edit(); SharedPreferences.Editor editor = preferences.edit();
// Try remove all possible keys we wrote for this setting // Try remove all possible keys we wrote for this setting
@ -256,7 +256,7 @@ public final class InputBindingSetting extends SettingsItem {
*/ */
private void WriteButtonMapping(String key) { private void WriteButtonMapping(String key) {
// Get preferences editor // Get preferences editor
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(DolphinApplication.getAppContext()); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(CitraApplication.getAppContext());
SharedPreferences.Editor editor = preferences.edit(); SharedPreferences.Editor editor = preferences.edit();
// Remove mapping for another setting using this input // Remove mapping for another setting using this input
@ -284,7 +284,7 @@ public final class InputBindingSetting extends SettingsItem {
*/ */
private void WriteAxisMapping(int axis, int value) { private void WriteAxisMapping(int axis, int value) {
// Get preferences editor // Get preferences editor
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(DolphinApplication.getAppContext()); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(CitraApplication.getAppContext());
SharedPreferences.Editor editor = preferences.edit(); SharedPreferences.Editor editor = preferences.edit();
// Cleanup old mapping // Cleanup old mapping
@ -309,7 +309,7 @@ public final class InputBindingSetting extends SettingsItem {
public void onKeyInput(KeyEvent keyEvent) public void onKeyInput(KeyEvent keyEvent)
{ {
if (!IsButtonMappingSupported()) { if (!IsButtonMappingSupported()) {
Toast.makeText(DolphinApplication.getAppContext(), R.string.input_message_analog_only, Toast.LENGTH_LONG).show(); Toast.makeText(CitraApplication.getAppContext(), R.string.input_message_analog_only, Toast.LENGTH_LONG).show();
return; return;
} }
@ -332,11 +332,11 @@ public final class InputBindingSetting extends SettingsItem {
char axisDir) char axisDir)
{ {
if (!IsAxisMappingSupported()) { if (!IsAxisMappingSupported()) {
Toast.makeText(DolphinApplication.getAppContext(), R.string.input_message_button_only, Toast.LENGTH_LONG).show(); Toast.makeText(CitraApplication.getAppContext(), R.string.input_message_button_only, Toast.LENGTH_LONG).show();
return; return;
} }
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(DolphinApplication.getAppContext()); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(CitraApplication.getAppContext());
SharedPreferences.Editor editor = preferences.edit(); SharedPreferences.Editor editor = preferences.edit();
int button; int button;
@ -362,7 +362,7 @@ public final class InputBindingSetting extends SettingsItem {
* Sets the string to use in the configuration UI for the gamepad input. * Sets the string to use in the configuration UI for the gamepad input.
*/ */
private StringSetting setUiString(String ui) { private StringSetting setUiString(String ui) {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(DolphinApplication.getAppContext()); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(CitraApplication.getAppContext());
SharedPreferences.Editor editor = preferences.edit(); SharedPreferences.Editor editor = preferences.edit();
if (getSetting() == null) { if (getSetting() == null) {

View File

@ -2,7 +2,7 @@ package org.citra.citra_android.ui.main;
import org.citra.citra_android.BuildConfig; import org.citra.citra_android.BuildConfig;
import org.citra.citra_android.DolphinApplication; import org.citra.citra_android.CitraApplication;
import org.citra.citra_android.R; import org.citra.citra_android.R;
import org.citra.citra_android.model.GameDatabase; import org.citra.citra_android.model.GameDatabase;
import org.citra.citra_android.utils.AddDirectoryHelper; import org.citra.citra_android.utils.AddDirectoryHelper;
@ -63,7 +63,7 @@ public final class MainPresenter {
} }
public void loadGames() { public void loadGames() {
GameDatabase databaseHelper = DolphinApplication.databaseHelper; GameDatabase databaseHelper = CitraApplication.databaseHelper;
databaseHelper.getGames() databaseHelper.getGames()
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
@ -71,7 +71,7 @@ public final class MainPresenter {
} }
private void refeshGameList() { private void refeshGameList() {
GameDatabase databaseHelper = DolphinApplication.databaseHelper; GameDatabase databaseHelper = CitraApplication.databaseHelper;
databaseHelper.scanLibrary(databaseHelper.getWritableDatabase()); databaseHelper.scanLibrary(databaseHelper.getWritableDatabase());
mView.refresh(); mView.refresh();
} }

View File

@ -11,7 +11,7 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import org.citra.citra_android.DolphinApplication; import org.citra.citra_android.CitraApplication;
import org.citra.citra_android.R; import org.citra.citra_android.R;
import org.citra.citra_android.adapters.GameAdapter; import org.citra.citra_android.adapters.GameAdapter;
import org.citra.citra_android.model.GameDatabase; import org.citra.citra_android.model.GameDatabase;
@ -54,7 +54,7 @@ public final class PlatformGamesFragment extends Fragment implements PlatformGam
pullToRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { pullToRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override @Override
public void onRefresh() { public void onRefresh() {
GameDatabase databaseHelper = DolphinApplication.databaseHelper; GameDatabase databaseHelper = CitraApplication.databaseHelper;
databaseHelper.scanLibrary(databaseHelper.getWritableDatabase()); databaseHelper.scanLibrary(databaseHelper.getWritableDatabase());
refresh(); refresh();
pullToRefresh.setRefreshing(false); pullToRefresh.setRefreshing(false);

View File

@ -1,7 +1,7 @@
package org.citra.citra_android.ui.platform; package org.citra.citra_android.ui.platform;
import org.citra.citra_android.DolphinApplication; import org.citra.citra_android.CitraApplication;
import org.citra.citra_android.model.GameDatabase; import org.citra.citra_android.model.GameDatabase;
import org.citra.citra_android.utils.Log; import org.citra.citra_android.utils.Log;
@ -27,7 +27,7 @@ public final class PlatformGamesPresenter {
private void loadGames() { private void loadGames() {
Log.debug("[PlatformGamesPresenter] : Loading games..."); Log.debug("[PlatformGamesPresenter] : Loading games...");
GameDatabase databaseHelper = DolphinApplication.databaseHelper; GameDatabase databaseHelper = CitraApplication.databaseHelper;
databaseHelper.getGames() databaseHelper.getGames()
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())