Commit Graph

304 Commits

Author SHA1 Message Date
Greg Wicks
cf57e90986 Android: Update dependencies to use new format 2017-10-27 13:06:48 -04:00
Mike Harris
fb6274f7bc Android: Refactor onMotionEvent.
This works the same, but only looks for the initial event and ignores
the keyup / return to home. It handles joystick diagonals smarter, in
that it ignore diagonals until the stick moves in a more cardinal
direction.

This fixes an odd bug where the dpad up/down were switched (thread post
I think found it -
https://forums.dolphin-emu.org/Thread-arm64-version-on-shield-tv-x1-local-multiplayer-not-working-d-pad-mappings?pid=379918#pid379918)
2017-10-21 13:01:13 -07:00
Mike Harris
b8d45ad4be Android: Refactor the saveInput function.
In its prior state, it had xor parameters, which is confusing.
2017-10-21 13:01:12 -07:00
Mike Harris
0d78545255 Rename the param to setGamePath. 2017-10-16 20:36:13 -07:00
Mike Harris
d73100f0e4 Minor cleanup in EmulationActivity.
Move the parameter extraction earlier on in onCreate. Mostly this moves
setting sIsGameCubeGame to before setContentView, which means
EmulationFragment will always see it in a consistent state. Previously,
there was a race, which mean the controller overlay would randomly be
Wii controls for a GameCube game (since the default is false).

Use the correct support version of things, ActivityOptionsCompat and
transitions

Rename static var mIsGameCubeGame to sIsGameCubeGame. s is static, m is
member.
2017-10-16 20:36:12 -07:00
Mike Harris
94ed30b055 Use the fragment backstack properly, and use fragment animations.
Make the MenuFragment added and removed by fragment transactions only,
instead of being initially present in the XML. This fixes a glitch where
it doesn't animate correctly the first time it's used.
2017-10-16 20:36:12 -07:00
Mike Harris
c4d7814afa Collapse layouts with a framelayout root then another viewgroup.
There's no point to this, and it just slow things down (technically).
2017-10-15 16:44:56 -07:00
Mike Harris
4cab718065 Move emulation lifecycle handling into EmulationFragment.
The Activity is responsible for just its views and menus and such. It
signals the Fragment via setGamePath, StartEmulation and StopEmulation.

The Fragment manages the actual emulation lifecycle. It is solely
responsible for calling the NativeLibrary lifecycle methods.

With this lifecycle simplification, the NativeLibrary no longer needs to
kill the Activity. It happens normally now.

This simplifies a lot of things, live handling rotation.
2017-10-15 16:44:56 -07:00
Mike Harris
d48c64457a Start the postponed activity transition as soon as Picasso loads the
image.

Doing it on the preDraw for the View is too complicated. This works just
as well.
2017-10-15 16:44:56 -07:00
Mike Harris
25a08fc5cc Only postpone transistions on Activity creation.
This is causing bugs (no UI is rendered) when the Activity is rotated.
2017-10-15 16:44:56 -07:00
Mike Harris
80e1cc56b3 Use weak references for the static Activity in NativeLibrary.
Add in null checks as well.
2017-10-15 16:44:56 -07:00
Mike Harris
cde003c5cc Remove EmulationActivity.MenuType. This should have been removed when
SaveLoadStateFragment was refactored.
2017-10-15 16:44:56 -07:00
Mike Harris
80d51c97ab Add dummy View that works around a bug with the nVidia Shield.
Without this View, the emulation SurfaceView acts like it has the
highest Z-value, blocking any other View. This includes the menu
fragments and the screenshot ImageView.
2017-10-15 16:44:56 -07:00
Mike Harris
bb3f61296e Add a clearEmulation method.
This makes it clear that the Activity is being cleared and removes null as
a valid param. This improves readability (and logging slightly).

Fix spacing between [Tag] and message. This matches the rest of the log
messages.
2017-10-15 16:44:56 -07:00
Mike Harris
9fb0d9a664 Move all Activities and Fragments to the support library versions.
In the support lib, the code comes from the SDK, not the device like the
framework version. This means we're shipping a more recent and less buggy
version.

It's also a good idea to keep the entire project on one version. We have a bit
of a mix now. I think some of the Fragment animation issues were because of
this mixing.

For the leanback activities, AppCompatActivity requires AppCompat themes, which
they don't ship for Theme.Leanback. So use FragmentActivity instead (that's the
parent of AppCompatActivity, but still in the support library). For passed
around Activities, use FragmentActivity to work with both.
2017-10-15 16:44:56 -07:00
Mike Harris
9407d9ee0b Bump compile SDK and buildtools version to 26 (Oreo).
Bump the support lib version to 26. This allows for using property
animators (R.animator) in FragmentTransaction.setCustomAnimations.

Add the google maven repo, as from support lib 26 onwards, they're only
publishing it in there.

Bump the gradle version while we're at it, keep Android Studio quiet.
2017-10-15 16:44:56 -07:00
Mike Harris
e4c2d75198 Combine SaveStateFragment and LoadStateFragment into one.
Other than what action they send back to
EmulationActivity.handleMenuAction(), they are the same.

Change the menu-handling logic in EmulationActivity to keep track of a
boolean for whether the submenu is visible, rather than keeping the
fragment tag. There's only one fragment visible, so this makes more
sense.
2017-10-03 17:51:08 -07:00
Mike Harris
bdeee34eac Move newInstance and launch to the top of the file.
Following the style guide, constructors go before public methods.
newInstance and launch are basically constructors.
2017-10-03 17:51:08 -07:00
Mike Harris
3c3d0fa6f5 Remove 'all' as a Platform enum.
This will remove the 'all games' row on the TV view.
2017-09-29 09:38:14 -07:00
Mike Harris
cc77a4963f Convert platform ints to a proper enum Platform.
This is good practice (see Effective Java chapter 6), and adds
compile-time checks.
2017-09-29 09:38:14 -07:00
Mike Harris
487591c760 Change from using tags in ImageCardView to setting a per-platform background.
This allows us to use a real ImageCardView instead of extending the
class.
2017-09-29 09:38:14 -07:00
Mike Harris
2d740147fe remove dupe log tag 2017-09-29 09:38:14 -07:00
Mike Harris
7db88e831e Remove prefix of tag, args and keys with packagename.
Prefixing everything with a constant packagename is not needed for
internal keys, and just adds complexity.

Rename ARGUMENT_ prefix to ARG_ to match (most) of the rest of the
codebase.

Restrict visiblity of above as much as possible.
2017-09-26 17:15:58 -07:00
Mike Harris
ab90a3029d Move Save/LoadFragment's layout ID inline and private.
Fix the hack of using the layout resource ID as a save/load ID, and
instead use a proper enum.
2017-09-26 17:15:57 -07:00
Mike Harris
96525cbaaa Remove unused FRAGMENT_TAG, and move the fragment's layout ID inline.
FRAGMENT_ID wasn't actually the fragment's ID (that's misleading, and
sounds like the tag). It's actually the layout resource ID. There's no point in making that a static constant.
2017-09-25 22:47:52 -07:00
Mike Harris
252af9c1bd Remove the debug strings.xml definition of application_id.
This is handled by gradle, we don't need a separate strings.xml for
debug.
2017-09-25 22:20:52 -07:00
JosJuice
85ab968136 Android: Adjust position of floating action button 2017-09-21 15:48:17 +02:00
Markus Wick
4a124868d6 Merge pull request #6034 from JonnyH/WIP/fix-android-null-SettingsSection-crash
Fix some Android UI crashes opening 'settings' menus
2017-09-10 11:11:51 +02:00
JosJuice
7fa20cb1be Remove trailing spaces from Android files
Android Studio wants to correct these automatically when editing files.
2017-09-09 11:34:28 +02:00
Jonathan Hamilton
ec96a5d8bc Android UI: remove some unnecessary null pointer catches
These can no longer happen during 'normal' use (IE if the setting was
missing)
2017-09-08 10:11:04 -07:00
Jonathan Hamilton
3f247eefae Android SettingsFragmentParser - remove ad-hoc SettingSection construction
Now the SettingsSection map constructs a new SettingsSection at .get()
time, these are no longer needed
2017-09-08 10:06:53 -07:00
Jonathan Hamilton
221462808d Avoid crashes due to null SettingsSections
If a SettingsFile had at least one section, it was assumed all sections
were correctly filled out. This caused crashes when opening the settings
menus if that was not the case - for example the GFX.ini settings empty
sections are removed by the main dolphin app, putting the .ini file in a
state that would crash the settings window if at least one setting was
changed in it from the default, some sections were left as default.

This adds a subclass of HashMap<String, SettingSection> that constructs a
new SettingSection instead of returning 'null' if the key isn't found,
so the mSettings.get(FILE).get(SECTION).get(SETTING) pattern can be
safely used.
2017-09-08 10:06:53 -07:00
Markus Wick
ce670c1851 Merge pull request #5959 from mahdihijazi/tv_version_number
[Android] Show the version number on the title for the Android TV UI
2017-09-08 12:17:06 +02:00
Leo Lam
1705d15d6f Merge pull request #5969 from JosJuice/android-filename
MainAndroid: Remove s_filename
2017-08-28 21:03:26 +02:00
Jonathan Hamilton
5a361fd6b3 Make the Android settings parser a bit more robust
It would fail on lines line "Value =" - IE a value set to emptystring.

This would cause the app to crash when trying to open the corresponding
settings window.
2017-08-23 15:50:21 -07:00
JosJuice
f8703f90e3 MainAndroid: Remove s_filename
This fits better as a function parameter than as global state.
2017-08-23 22:36:21 +02:00
mahdihijazi
9918d6e333 [Android] Show the version number on the title for the Android TV UI
- Stop reading version number from native code and use the one from BuildConfig
- Show the version number on the title for the Android TV UI
2017-08-21 22:00:56 +02:00
mahdihijazi
a1d713c589 [Android] Cleanup unused resources & code 2017-08-20 15:49:39 +02:00
JosJuice
1fc910b3ea Convert to/from old EFB scale numbering 2017-08-08 12:09:50 +02:00
JosJuice
f090a94319 Remove non-integer IRs 2017-08-08 12:09:50 +02:00
Stenzek
134b0ca940 Android: Fix ubershader hybrid setting 2017-08-01 00:38:26 +10:00
Stenzek
901bf9c257 VideoConfig: Add config options for ubershaders 2017-07-30 17:43:59 +10:00
shuffle2
b9b3b1dc19 Merge pull request #5347 from JosJuice/do-not-translate-button-names
Don't translate button names
2017-06-05 19:05:09 -07:00
Pierre Bourdon
d486904e9b build.gradle: do not change the output filename, our CI relies on it 2017-05-20 05:54:55 +02:00
Sean Maas
3e33c99f4c Android: Initialize video backend setting on first run 2017-05-18 08:44:45 -04:00
Sean Maas
d4728807e0 Android: Add pressed dpad images for other DPIs 2017-05-15 08:32:22 -04:00
Sean Maas
3bd8890486 Android: Prevent stuck on-screen buttons 2017-05-15 08:32:07 -04:00
Sean Maas
6190b1c4e2 Android: Animate onscreen joystick
Invalidate more often, display nub as pressed when in use, and implement
basic nub bounds.
2017-05-14 15:29:47 -04:00
Mahdi Hijazi
216a7ceea8 Android: Add pressed state to the on-screen controllers
Now the buttons will be shown in different color to indicate a press event
2017-05-14 18:41:04 +02:00
JosJuice
0146456af0 Don't translate button names
Since these button names are printed on all real controllers,
we should show them in the same way as they are printed on
the controllers, regardless of the user's language. It seems
like this was intended all along (except for "Start"), but the
_ markers in TASInputDlg.cpp (accidentally?) led to the button
names in the controller configs also becoming translatable.

I'm making exceptions for "L" and "R" because translators
may want to mark them in some way (for instance "L-Digital")
to clarify the difference from "L-Analog" and "R-Analog".

I'm also making an exception for START/PAUSE because it's
referred to as スタート in Japanese games.

I'm changing "Home" and "Start" to uppercase for consistency
with how Nintendo refers to those buttons, and because someone
who isn't familiar with the Latin script might not know the
connection between the lowercase and uppercase letters (most
users likely do know the connection, but we shouldn't assume it),
and because leaving "Start" as "Start" makes it "collide" with
unrelated strings, such as the string for the button that starts
a netplay session.

To rename "Start" and "Home" without breaking INI
compatibility, I added a ui_name variable like in f5c82ad.
2017-05-06 16:29:10 +02:00