Android : new GameBrowser #925

Merged
merged 10 commits into from Aug 6, 2016

Projects

None yet

5 participants

@BlisterB
Member
BlisterB commented Jul 10, 2016 edited

Hello everyone!

Here is the result of those two days of works :

  • I made a new GameBrowser for API > 15, hope you'll like it!
  • Now we target API 23 but I managed to keep the min SDK to 10. I needed to adapt a lot of things but this sounds to works good ^^.
  • I cleaned some part of code (this part is not over).
  • I fixed some bug not reported.
  • I've put a beautiful flashy setting button on the main activity, at the sight of everyone.

This pull request is not over, but I prefer to do this pull request to collect some feedbacks before finish it (I can't code for a week).

What remains to :

  • Deal with the new permission system of Android 6
    <!> : If you are running on Android 6+, you have to manually give permission to the app (in Android Preferences). If you don't do this, the app cannot access to internal and external storage (don't forget we're dealing with Android platform hahaha).
  • Do the "Share" feature
  • Collect feedback and bugreport.
  • Continue to clean the code.
  • Refund the Settings Activity (with category and a uniform UI with the main activity)
  • The .nomedia seems to not be added to new game directory
BlisterB added some commits Jul 9, 2016
@BlisterB BlisterB Add the new gamebrowser's activity template 03df34a
@BlisterB BlisterB Add features to the new GameBrowser e4361e7
@BlisterB BlisterB Improve UI a8606f3
@BlisterB BlisterB Add missing files
434c2ed
@BlisterB
Member

Oh, we will probably have to slightly change the build script, to fit with the new target sdk.

@Ghabry
Member
Ghabry commented Jul 10, 2016 edited

Sounds cool. Can you show some screenshots of the new browser?

@BlisterB
Member

Of course, here are some screenshots :


@Ghabry
Member
Ghabry commented Jul 11, 2016 edited

May I get the new Android build line? :)

@Ghabry Ghabry commented on an outdated diff Jul 11, 2016
...rc/main/java/org/easyrpg/player/DirectoryChooser.java
@@ -201,7 +204,11 @@ public static String dirListToPath(LinkedList<String> l) {
public boolean isReadable(String path) {
File file = new File(path);
- return file.canRead();
+ boolean canRead = file.canRead();
+ if (!canRead) {
+ Log.e("isReadable", "Current context not allowed to read : " + path);
+ }
+ return canRead;
@Ghabry
Ghabry Jul 11, 2016 Member

Please fix the whitespace everywhere (TAB for idendation)

@Ghabry
Member
Ghabry commented Jul 11, 2016

I installed on the server (in the toolchain dir, will push this to buildscripts when ready :D):

android update sdk -u -a -t android-23
android update sdk -u -a -t extra-android-support

Which is API23 and Android Support Lib

A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.android.support:appcompat-v7:23.2.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/appcompat-v7/23.2.1/appcompat-v7-23.2.1.pom
         https://jcenter.bintray.com/com/android/support/appcompat-v7/23.2.1/appcompat-v7-23.2.1.jar
     Required by:
         android:app:unspecified
   > Could not find com.android.support:design:23.2.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/design/23.2.1/design-23.2.1.pom
         https://jcenter.bintray.com/com/android/support/design/23.2.1/design-23.2.1.jar
     Required by:
         android:app:unspecified
   > Could not find com.android.support:cardview-v7:23.2.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.pom
         https://jcenter.bintray.com/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.jar
     Required by:
         android:app:unspecified
   > Could not find com.android.support:recyclerview-v7:23.2.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/recyclerview-v7/23.2.1/recyclerview-v7-23.2.1.pom
         https://jcenter.bintray.com/com/android/support/recyclerview-v7/23.2.1/recyclerview-v7-23.2.1.jar
     Required by:
         android:app:unspecified
@ItsSchoko
ItsSchoko commented Jul 11, 2016 edited

Hey there, good to see that someone is going the same way. :D

I've just made a short demo clip of the current status:
https://youtu.be/-U3OpDch92E

For some inspiration, I also add my mockup graphic which I created before programming the UI:
-- outdated, will update this picture later on --

The UI itself is minSDK10 and maxSDK23, had some minor problems like white backgrounds and stuff, because 4.4 doesn't inherit the background.

I also plan to make a second list view option for larger screens (e.g. TV), like in your screenshots.

And here's a DropBox link to an APK of the current status:
https://www.dropbox.com/sh/0zqznc8x7v7sar5/AABKnTtuuWQRa9Dbmh2mJZN6a/UI/APK

@BlisterB
Member

@Ghabry : I've updated the dependencies following this stack :
http://stackoverflow.com/questions/29284236/failed-to-resolve-com-android-supportappcompat-v722-and-com-android-supportre

@ItsSchoko : Your UI is nice, I'm curious to see the final result, especially for the settings activity (I don't have the time to redo it).
Nevertheless I don't really like the new Button Layout, I like the current one which stay discreet.

@BlisterB
Member
BlisterB commented Jul 11, 2016 edited

I had the time to watch the video. This is really nice.
Considering this work, I'll cut some functionality for this Pull Request and just do the permission asking (don't do the Share functionnality and remake the Settings activity). This GameBrowser will be avaible until @ItsSchoko will finish his own, to decide which one will be our futur base work.

@ItsSchoko
ItsSchoko commented Jul 11, 2016 edited

@BlisterB I'm curious too, it's still a long way to go.
This Button Layout is part of some extra button sets I've created, I'm just too lazy to use the old ones inside the mockup project. (There are also flat discreet ones)
My Plan is to rework the Button Layout Editor, which then should work with .svg files, color change, scaling, etc.

A lot of comments on the Playstore just scream for better usability, which I try to reach.
I know a lot of you guys are busy with core features, so I decided to help in creating a better enduser UI experience with my first app.

EDIT: One minor detail, the app itself can't start games for now, so the "games" you see are just some dummy list entries, still have to combine a lot of the core features with the UI.

@Ghabry
Member
Ghabry commented Jul 11, 2016

@BlisterB
https://gradleplease.appspot.com/
Could you try this settings? (change the file, do a "git commit -a --amend" and "git push -f") ;)

I installed now also the 2 maven repos, no change.

@BlisterB
Member

Yeah until recently we were unable to use external dependencies so it was impossible to use something API > 10 and it was difficult to do beautifull things. And as I am not student anymore my time si shorter :/.

Your UI is really nice, but please pay attention with the dependencies that we can found on the web : they must be compliant with our licences (which is a beautifull bottleneck hahaha).

@Ghabry : Okay!

@ItsSchoko
ItsSchoko commented Jul 11, 2016 edited

@BlisterB Already got that covered.

  • the Navigation Menu icons are Google system icons https://design.google.com/icons/index.html
  • the game icons are just there to illustrate what you will see, so in the end only content from the games you have "installed" are loaded into the list.
  • and the rest are my own creations (mockup phones, buttons sets etc.) or from EasyRPG (two exceptions: facebook and twitter logo, which later should also get some copyright entries)
@BlisterB @BlisterB BlisterB fix android dependencies
Android Use 23.4.0 dependencies
fe54c1b
@BlisterB
Member

Okay, sounds cool!

@Ghabry : I did what you've asked :).

@Ghabry
Member
Ghabry commented Jul 11, 2016

@BlisterB
Do I have to install Maven and download the support library dependencies manually? Because the repository folder is almost empty.

@BlisterB
Member

Nope, everything works with gradle,
I think you're right, this is what seems to tell this PR : http://stackoverflow.com/questions/36222111/android-could-not-find-com-android-supportsupport-v423-2-1 .

@Ghabry
Member
Ghabry commented Jul 11, 2016 edited
@Ghabry
Member
Ghabry commented Jul 11, 2016 edited

One obvious problem of your Title folder scanning is: It will pick the wrong one when there is more then 1 file in it... But to get the correct one you would need to parse the RPG_RT.ldb :D

And guess the encoding... lets wait for a liblcf update, too much hassle to code in Java again.

Oh and @BlisterB could you make a small change to the "Select Layout" game menu? A button "Edit layout" that scrolls to the layout settings of the settings ui would be useful.

@fdelapena fdelapena added the Android label Jul 11, 2016
@BlisterB
Member

Ghabry : yeeees the title screen is very dumb I agree but it would be a mess to integrate ldb parsing and terrible for performances :p.
I'll do the select layout feature for the game menu :).

@BlisterB BlisterB Android : Ask for storage permission
2cf7c3c
@BlisterB
Member

@Ghabry Now the app ask for storage permission (this thing is awfull to handle in android code).
For the edit button in the select layout, I checked and this is always not possible to do this quickly without creating a whole new class.
Because I won't be free for a week I think I'm over for this PR and I add the things I didn't in the Android to do list thread.
Of course if something bother you don't hesitate to tell me :).

@Ghabry
Member
Ghabry commented Jul 11, 2016

Okay I will keep this PR on hold then until I have time to do more testing. Pushing this directly to the Android users is a bit risky because it's workweek :D

@BlisterB
Member

Hi everyone, I'm back with an Java 8 OCA in my pocket hihihi ^^.

@Ghabry Do you have suggestions for this PR?

@Ghabry
Member
Ghabry commented Jul 21, 2016

@BlisterB
Imo the game title graphics in your tile view should depend on the screen size... Currently gigantic and small displays get 2 games per row. And the aspect ratio isn't correct (title graphics are cut, not the whole 320x240 graphic is rendered).

But my bigger worry is that some users will probably hate this view and show all there hate with 1 star ratings!
Maybe you could add a button to toggle between tile and list view? Basicly like in the mockup of Schoko. Small title graphic on the left, followed by game title. Is more space friendly.
But really depends on who you ask, both view options make sense.

@BlisterB
Member
BlisterB commented Jul 22, 2016 edited

I agree with you for the switch layout button.
For the moment it's pretty cool with few games in portrait mode, but that would me to heavy with more than 5 games. I also like the Schoko mockup.
@ItsSchoko where is the advancement of your work, do you have any idea of when it will be ready for a pull request? I don't really want to do a double work since I found your result better.

@Ghabry Ghabry added this to the 0.6.0 milestone Jul 22, 2016
@Ghabry
Member
Ghabry commented Jul 22, 2016 edited

@BlisterB
I think your GUI changes are optimal for getting initial feedback from the PlayStore users. I see yours as a perfect gap filler until Schokos GUI is ready. And you already wrote some useful code for getting the title graphic e.g.

Lets scratch the list layout part because Schoko already did it but is it possible without too much work to make the tile view resolution aware? To render more stuff per row on larger displays? Because Schokos Ui doesn't offer this view it would be a nice addition and we can merge it in his Ui later.
After this being added I think we can approve this PR and push it to the store 👍 and wait for angry Samsung users 😆

@Ghabry Ghabry modified the milestone: 0.5.0, 0.6.0 Jul 22, 2016
@BlisterB
Member

That was in my initial plans to improve the layout in further PR, but this isn't difficult, I'll just have to do some tests with different screen size VM :).

@BlisterB
Member

I adapted the grid layout depending on the horizontal size. A thumbnail now has a minimum size of 200dpi, I just have a smartphone so I can't test on a tablet. Can someone tell me I I should slightly minify the thumbnail size ?

@Ghabry
Member
Ghabry commented Jul 27, 2016

You can test using an emulator. ;)

I just tested it on my smartphone and it worked, will have access to a tablet in the evening.

Could you give the top-pane with the EasyRPG text a green color? Blue doesn't fit at all in our corporate design g

@BlisterB
Member

I changed the color to match with the toolbar :).

@Ghabry
Member
Ghabry commented Jul 29, 2016

Uhm now everything is blue instead of green.

Anyway some screens from my tablet:
screenshot_2016-07-29-23-17-33

screenshot_2016-07-29-23-17-10

An obvious problem is the settings button. The text flows under it. That looks bad. Any idea how to solve this?

@Ghabry
Member
Ghabry commented Jul 29, 2016

The heuristic also works surprisingly well if the game does not contain the rtp title graphics. And yume nikki uses xyz files

@BlisterB
Member
BlisterB commented Jul 29, 2016 edited

Apologies for the blue thing, I did a mistake reading your post huhuhu. I'll fix it tomorrow, and move the preferences button in the toolbar :).

@Ghabry
Member
Ghabry commented Jul 29, 2016

You read wrong again. The global button (pink circle) is fine. I mean the per-game settings.
See Vampires Dawn

@BlisterB
Member
BlisterB commented Jul 30, 2016 edited

I fixed the text overlapping problem and I changed the color scheme, I also set the pink color to the complementary of the blue in the toolbar : yellow.

@carstene1ns
Member

current_colors
I say it again, our color is GREEN, not BLUE.

@BlisterB
Member

Wow, I must had a unconscious blockage against the green color, or a color blindness condition.
This is now all GREEN.

@Ghabry
Member
Ghabry commented Jul 30, 2016 edited

Good. Now I ask you to remove the redundant color commits.

Make a backup of your easyrpg folder just to be save

Then, open a shell and go into the easyrpg directory and run

git rebase -i HEAD~5

You will get an editor listing with the last 5 commits, all set to "pick" in the first column:
screenshot_20160730_134227

Edit it so that the 2nd and the 3rd commit are changed to "fixup" and the 5th to "squash" like in this screenshot:

screenshot_20160730_134342

Save (in nano strg+O) and exit (Strg+X)

Another editor open, just close it, is for editing the commit message.

Now run git log and confirm that the commits are gone.

Finally do a forced push git push -f

BlisterB added some commits Jul 25, 2016
@BlisterB BlisterB [Android] : Adapt the gamebrowser layout with horizontal size 19aca2a
@BlisterB BlisterB [Android] Fix the text overlapping problem in the gamebrowser & chang…
…e the color scheme
b2ad0e1
@Ghabry
Member
Ghabry commented Jul 30, 2016 edited

@BlisterB stop it, it's correct now

xxx

@BlisterB
Member

Hahaha

@Ghabry
Member
Ghabry commented Jul 30, 2016 edited

One minor issue:
When the browser starts in landscape (or you return from a game while in landscape) the left and right padding is much bigger then when starting in Portrait and rotating to landscape #Android -.-

screenshot_2016-07-30-16-05-18

For compare the correct padding (portrait and rotated then)
screenshot_2016-07-29-23-17-33

@Ghabry Ghabry and 1 other commented on an outdated diff Jul 30, 2016
builds/android/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+<resources>
+ <!-- Example customization of dimensions originally defined in res/values/dimens.xml
+ (such as screen margins) for screens with more than 820dp of available width. This
+ would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
+ <dimen name="activity_horizontal_margin">64dp</dimen>
@Ghabry
Ghabry Jul 30, 2016 edited Member

You overwrite here the horizontal_margin from 16dp to 64dp for w820dp this could be a hot candidate for the issue. Just delete the file :)

@BlisterB
BlisterB Jul 30, 2016 Member

Hmm this is an auto-generated file by Android Studio, if you change it, does it solve the problem?
Because this problem doesn't occur when you rotate your device, I tend to think that the line 164 in GameBrowserActivityAPI15.java is the source of the problem:
int nbGamePerRow = configuration.screenWidthDp / THUMBNAIL_HORIZONTAL_SIZE_DPI;

@carstene1ns carstene1ns and 1 other commented on an outdated diff Jul 30, 2016
builds/android/app/src/main/res/values/strings.xml
@@ -104,4 +104,8 @@ Please tell us in detail what went wrong.\n
<string name="key_enter">Enter (Z)</string>
<string name="key_cancel">Cancel (ESC and X)</string>
<string name="key_shift">Shift</string>
+
+ <!--GameBrowserAPI15-->
+ <string name="navigation_drawer_open">Open navigation drawer</string>
+ <string name="navigation_drawer_close">Close navigation drawer</string>
@carstene1ns
carstene1ns Jul 30, 2016 edited Member

Please fix the white spaces here to make it <TAB> like the rest.

@BlisterB
BlisterB Jul 30, 2016 Member

Oh, I didn't saw the problem because it's indented with 4 space, and the other with tab (no difference in my IDE).
Because 4 space is the Java standard (which is stupid imho), I will try to keep this way to indent.

@BlisterB BlisterB [Android] Indentation correction of a string.xml
555733c
@BlisterB
Member

@Ghabry does my last commit solved your problem?
It seems this way to obtain the screen width is better than using the Configuration object.

@Ghabry
Member
Ghabry commented Jul 30, 2016

Not fixed. Maybe you could test it in an emulator?

@BlisterB
Member

Y-e-s I'm using multiple VM to test the GameBrowser. But I didn't faced this problem.
Could you give me some information about your model (screen size, android version, eventually the manufacturer if a friend have a similar model), or at least tell me if your fix (the file deletion) worked?

Please remember that Android platform is a mess, possibly every Android version/model could give a slightly different result.

@Ghabry
Member
Ghabry commented Jul 31, 2016

Oh, okay :D
It's a Android 4.1 Samsung(!) Galaxy Note.

Size 8.0 inches (~64.8% screen-to-body ratio)
Resolution 800 x 1280 pixels (~189 ppi pixel density)

@BlisterB BlisterB [Android] Fix the margin problem in Gamebrowser for some tablets
dec069a
@BlisterB
Member
BlisterB commented Aug 6, 2016

I succeed in reproducing the layout bug, please excuse me for the long waiting time, your fix was the right solution @Ghabry.
I also deleted the previous commit which became useless.

@Ghabry
Member
Ghabry commented Aug 6, 2016

In my opinion this can be merged now. Anybody with further criticism?

@carstene1ns
Member

I just hope transifex does not burp on the whitespace change, otherwise ok.

@Ghabry Ghabry merged commit 95ade95 into EasyRPG:master Aug 6, 2016

6 checks passed

Android (armeabi-v7a) Build finished.
Details
GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows (x64) Build finished.
Details
Windows (x86) Build finished.
Details
web Build finished.
Details
@Ghabry
Member
Ghabry commented Aug 6, 2016

Burped a bit. @BlisterB , any idea where these localizations are coming from? :o

screenshot_20160807_001332

@BlisterB
Member
BlisterB commented Aug 6, 2016

Wtf, where does this come from oO.

@Ghabry
Member
Ghabry commented Aug 6, 2016

wtfandroid

@Ghabry
Member
Ghabry commented Aug 6, 2016

As @carstene1ns guessed the languages are part of the appcompat lib. I just looked in one of the appcompat files with nano and found references to values-[langcode] files that match the ones on the screenshot.

@BlisterB
Member
BlisterB commented Aug 6, 2016

Hmm, is this something severe?

@Ghabry
Member
Ghabry commented Aug 6, 2016

No, we agreed on the chat to ignore it. Too much work to "solve".

@BlisterB
Member
BlisterB commented Aug 6, 2016

Okay

@BlisterB
Member
BlisterB commented Aug 6, 2016

I'm currently cleaning the Settings Activity, I'm pretty ashamed to have done something so dirty huhuhu.

@Ghabry
Member
Ghabry commented Aug 6, 2016

APK is published. I will forward all crash reports here tomorrow. Good night.

@Ghabry
Member
Ghabry commented Aug 8, 2016

@BlisterB
Users are happy. no feedback at all, neither positive nor negative. So must be good when nobody complains ;)
Also no crashes received.

@BlisterB
Member
BlisterB commented Aug 8, 2016

This is a good news ^^.
I intend to improve the code related to Preferences Activity which is actually awfull, and do an improvment of the portrait mode inspired by the ItsSchoko mock up (because the actual layout take obviously too much space). Before starting the study for the Oracle Java OCP huhuhu.

@Ghabry
Member
Ghabry commented Aug 8, 2016

You can also think about how to make it more obvious how to edit layouts because we found a user who couldn't figure out to press the "back button" to open the menu ;)

@BlisterB
Member
BlisterB commented Aug 8, 2016 edited

lol
I find nothing more relevant to say

@Ghabry
Member
Ghabry commented Aug 16, 2016

@BlisterB
A small update about how the people like the Game Browser: By now still no feedback (and no crashes) but our average rating increased over the last weeks and somehow most ratings are now 4 and 5 stars. I can't say that this is a correlation with your browser (we also had many other game fixes) but at least the amount of stupid questions reduced, looks like most people find the settings now.

One person even changed her rating to 5 stars because they were happy that adding shift is possible now m(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment