Commit Graph

115 Commits

Author SHA1 Message Date
Ryan Houdek fbd0fba13a [Android] Fix preferences from crashing. OSD controls was supposed to be boolean. 2013-08-21 00:06:48 -05:00
Lioncash 53df78d372 [Android] Missed a string for the Japanese translation. 2013-08-20 20:48:43 -04:00
Lioncash e52c2ac337 [Android] Migrate the "Draw Onscreen Controls" preference to the video settings. 2013-08-20 20:28:48 -04:00
Lioncash 9170c9b360 [Android] Remove unnecessary string messages from CPUSettingsFragment and VideoSettingsFragment. 2013-08-20 19:57:00 -04:00
Lioncash 00996c8d38 [Android] Implement a ViewPager for the settings. Also, move classes into appropriate packages to make things cleaner. 2013-08-20 19:39:00 -04:00
Ryan Houdek 0521b6aa69 [Android] Hopefully fix buildbot's ant build. 2013-08-20 15:41:11 -05:00
Lioncash 8de3250550 [Android] Load all of the new settings from the ini when the app is launched.
- Also fix a typo in the ini saving method in UserPreferences. Accidentally spelt the ini name wrong.
- Also include the relocated XML preferences. I meant to push this with the previous commit.
2013-08-20 15:35:16 -04:00
Lioncash 3fdfd75832 [Android] Add most of the Dolphin video/gfx settings to the settings menu. 2013-08-20 14:33:30 -04:00
Lioncash dd35156717 [Android] Forgot to document the new parameter used in SaveConfigToDolphinIni() in the last change. Fixed that. 2013-08-19 22:37:04 -04:00
Lioncash 9595457e1c [Android] Turn SaveConfigToDolphinIni() into a static method. Now saving settings to the ini config just uses one call in PrefsFragment.onDestroy(). 2013-08-19 22:34:27 -04:00
Lioncash 6dbfdce775 [Android] Remove the loading toast messages from the UI. These really don't need to be here since the things they were used for took very, very little time to load. 2013-08-19 22:09:43 -04:00
Lioncash 8dc0b38f00 [Android] Decouple Dolphin.ini config file saving from GameListActivity. It doesn't make sense to save the config AFTER control is returned from PrefsFragment to GameListActivity, since the main purpose of PrefsFragment is to handle the user settings. So, instead, we call SaveConfigToDolphinIni() in the PrefsFragment.onDestroy() method. This way, when the PrefsFragment object is being 'destroyed', it will write the settings to the ini. 2013-08-19 21:56:13 -04:00
Lioncash a87b967cde [Android] Simplify saving settings to the ini file. Since the setting names are known, there's no reason to loop through them.
This will likely be simplified further very soon.
2013-08-19 20:55:50 -04:00
Lioncash 77a5af3bcf [Android] Change the settings menu a little more. Instead of the settings being a single view with settings from all components being displayed, I have broken it into sections. This future-proofs the settings menu in the sense that it won't get cluttered before people start asking "Hey, shouldn't this be broken into sections?".
As of this commit, it is broken into CPU Settings and Video Settings.
I also simplified the code that is responsible for setting the valid CPU cores and video backends by simply making UI string arrays that get chosen, based on the platform the Android device is running on.
2013-08-19 19:10:13 -04:00
Lioncash 205ebbebbb [Android] Catch a more specific exception type (UnsatisfiedLinkError) when trying to load the main native Dolphin 'library'.
Also made the logging tag more specific.

It's generally bad to catch Exception because it's not very specific for the person reading the code. It doesn't say why that exception might have happened, it just indicates it's possible for an Exception to happen, which is quite general.
2013-08-18 18:30:13 -04:00
Lioncash 803b7ae991 [Android] Make the banners display a little larger. Now they don't look like tiny icons in the game list. 2013-08-17 22:51:35 -04:00
Ryan Houdek ba76b016da [Android] Fix Wii games. 2013-08-17 19:41:28 -05:00
Lioncash 07d729daa2 [Android] Prevent duplicate duplicate items from being in the game list at one time.
Previously it was possible for a game with the same path and name to be in the list as another. This is annoying because duplicates ae (obviously) no different from the initial item.

This prevents duplicates from entering the list.

The way this works is:

1. We get the final list of items to add to the list.

2. Loop through it using two indices, which, for this explanation I'll call [item] and [itemAfter]

We compare path name at item with index [item] and the path name at item with index [itemAfter]
To phrase this numerically comparison works like so:

for (int i = 0; i < listSize; i++)
{
    if (i+1 < listSize)
        item[i].getPath().equals(item[i+1].getPath())
}

3. For each path comparison that is true, remove item at [indexNext].
2013-08-17 14:28:50 -04:00
Lioncash a9d634086c [Android] Change the Game List items to be formatted similarly to how the folder browser is. Also ensure the 'no banner' icon scales down to the same size as the other banners. 2013-08-17 13:25:40 -04:00
Lioncash 1f6c63f1d8 [Android] Ensure that required dependencies are actually exported along with everything else when the Android version builds. Without this, the support libs will not export and cause the emulator to crash upon being executed. 2013-08-17 12:26:43 -04:00
Lioncash 88f79a14db [Android] Simplify if statement conditions for the item click listener in FolderBrowser.java.
Since FolderBrowserItems have an 'isDirectory()' method, that's all we need to care about now. There's no need to check subtitles to determine if an item is a directory anymore.
2013-08-17 11:03:02 -04:00
Lioncash 9149b30237 [Android] Shorten FolderBrowserItem's method 'isValidItem()' into 'isValid()' makes more sense and less redundancy in terms of 'item.isValidItem()' -> 'item.isValid()' 2013-08-17 10:55:13 -04:00
Lioncash 5047eeb263 [Android] FolderBrowserItem objects don't need to store a context.
Removed the requirement to pass a context in the constructors.
Also cleaned out unnecessary imports.
2013-08-17 10:50:31 -04:00
Lioncash 82e9bed20e [Android] Fix a bug where the name would display incorrectly in the game list.
Completely missed the 'this.' on the variable. My bad.
2013-08-15 20:34:05 -04:00
Lioncash 072fac4a74 [Android] Remove a redundant LinearLayout in one of the layout files. 2013-08-14 20:49:26 -04:00
Lioncash 3e6f9d22db [Android] Add a faint divider line between each folder browser item.
See here for how it looks: http://i.imgur.com/CGX9NTt.png
2013-08-14 20:43:29 -04:00
Lioncash 9c27fedd6d [Android] Remove the subtitles on all folders in the folder browser. No need to have the subtitle "Folder" when it's visibly indicated by the icon of a folder next to it.
Now it looks like this: http://i.imgur.com/CbUSqgg.png
2013-08-14 19:49:39 -04:00
Lioncash 94397a44cc [Android] General formatting clean-up.
Made some class variables final, since they should convey that they cannot be changed after the first assignment.
Made the formatting consistent between files.
2013-08-14 15:03:07 -04:00
Lioncash 6f1612d99c [Android] Fix the gamepad settings view inflation.
In some cases, it would fail to inflate correctly in the sense that it would only show the binding status and not the name of the actual control that was being binded.
2013-08-14 14:33:47 -04:00
Lioncash 39eeb37032 [Android] Correct the accessibility scope of a method and variable in InputConfigFragment.java.
Also, join a variable's declaration and assignment in the onMotionEvent() function.

If no explicit accessibility term (private, protected, public, etc) is given, then the permission level is set to something called 'package-private' which means it is set to the scope of the whole package. So technically any class could have access to this method and variable, which is likely not what we want.
2013-08-14 07:33:17 -04:00
Lioncash 0142efbb2a [Android] Add 'final' to all of the class declarations.
This prevents inheritance of the classes (will throw a compiler error if you try and extend any of the classes).
This is mainly syntactical sugar and form. Nothing major.
2013-08-14 07:17:45 -04:00
Lioncash 3cc8f7747e [Android] Main title text for the file browser items are bolded again. Must have removed it accidentally during the previous large refactor. 2013-08-13 14:32:46 -04:00
Lioncash 53bf55b1e9 [Android] Make the file browser look much more nice and user friendly to use.
This is what it now looks like: http://i.imgur.com/KOZgA1i.png

As usual, if any bugs arise from this rather large change. Please report it so I can fix it.
2013-08-13 13:05:42 -04:00
Lioncash 8fbf11a0d9 [Android] Add translatable="false" to the names of the string arrays in prefvalues.xml. 2013-08-13 12:10:42 -04:00
Lioncash a8fcd50cd7 [Android] Integer.toString isn't required in this string declaration. Concatenation handles this.
For example: "string" + 1 will just be concatenated as "string1" implicitly.
2013-08-13 10:09:42 -04:00
Lioncash debd5b42cf [Android] Clean up function SupportsGLES3 in PrefsFragment.java a little bit. 2013-08-13 09:48:18 -04:00
Lioncash 2015484c24 [Android] Some tiny cleanups in DolphinEmulator.java
- Join variable declaration and assignments in function onTouchEvent()
- Change a for-loop into a foreach loop in dispatchGenericMotionEvent(). Makes the loop body a single statement.
2013-08-13 09:23:11 -04:00
Lioncash 0916d0797c Simplify asset copying code a little bit in DolphinEmulator.java
Since the directories are already cached (with smaller variable names), use these instead so we can shorten the length of each line.
2013-08-13 09:13:46 -04:00
Lioncash e3617a55a0 [Android] Clean up the function CopyAsset in DolphinEmulator.java.
[streamtype].flush() is called when [streamtype].close() is called.

No need to null the references either after calling close(), the garbage collection will take care of it.
2013-08-13 08:58:50 -04:00
Lioncash 2d7244f6d5 [Android] Change the name of a variable in FolderBrowser.java to better reflect its purpose
Compressed file formats are not valid, so it's best to rename this to invalidExts.
2013-08-13 08:50:21 -04:00
Lioncash b823983199 [Android] Multi-language support (or at least the basic foundation of it).
Added an example translation (Japanese). So now the Android version can both display in English and Japanese, depending on what the Android device's system language is set to.

Also did a tiny clean-up of InputConfigItem.java so that the parameters are slightly more descriptive.

Now, to do a translation in [x] language, all you have to do is take the normal English strings.xml and translate the XML entries into said language, and simply make a folder in the /res/ sub-directory in the form of values-[region code]. IE) With the Japanese translation, it is in the folder /res/values-ja

No configuration other than that is needed. After doing the above, the language should load fine on any device when set to that specific system language.

By default, if a translation file does not exist for a given system language. The app will automatically fall back to using the English translation.

This *should* be bug-free since I did check everything multiple times. But if any issues occur, please report them so that I can fix them.
2013-08-12 21:22:20 -04:00
Lioncash 3b272d81b4 [Android] Use a HashMap in PrefsFragment.java instead of two CharSequence arrays.
This way, we hold the [key|value] pairs together in one object and reduce overall code clutter.
2013-08-12 19:41:23 -04:00
Lioncash 00b034f991 [Android] Seems like InputConfigFragment.java also had explicit list indexing. Removed it from here too. 2013-08-12 15:32:52 -04:00
Lioncash 68e12407a5 [Android] Remove unnecessary explicit indexing of entries in a List within AboutFragment.java
Indexes are handled internally within a List object.
2013-08-12 15:16:15 -04:00
Ryan Houdek 958590beaa [Android] Fix OpenGL ES 3 detection on Nexus 10. Nexus 10 defaults to GLES1 context when not specified while Adreno defaults to GLES2. Thanks to Jeremy D Miller for noticing and finding out why this was failing. 2013-08-12 04:44:08 -05:00
Ryan Houdek 5d38a9c91e [Android] Some minor cleanup. 2013-07-27 15:09:33 -05:00
Ryan Houdek 952aa714fd [Android] Another check for OpenGL ES 3. 2013-07-26 21:07:17 -05:00
Ryan Houdek 4deea2bcae Revert "[Android] Use equals to compare GL version string instead of contains. This should really be some sort of sscanf check so we can check if version > 3.0 but we'll worry about that when OpenGL ES 4.0 is released."
This reverts commit bc58e7f42f.
2013-07-25 19:35:01 +00:00
Ryan Houdek bc58e7f42f [Android] Use equals to compare GL version string instead of contains. This should really be some sort of sscanf check so we can check if version > 3.0 but we'll worry about that when OpenGL ES 4.0 is released. 2013-07-25 18:45:40 +00:00
lioncash 2e92e3814e [Android] Tiny cleanup regarding method indentation in GameListAdapter.
getItem() and getView were a little off-kilter with the rest of the class. Keeps things more consistent, etc.
2013-07-18 09:00:20 -04:00