- 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.
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.
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.
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].
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.
Made some class variables final, since they should convey that they cannot be changed after the first assignment.
Made the formatting consistent between files.
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.
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.
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.
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.
- 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.
[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.