-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change -Dmonocle.input.touchRadius value to 2 #1183
Comments
Good remark. I think moving it from 1 to 2 does not cause harm, but there might be a more generic solution. We changed the default a number of times before, since it used to be way too large for some devices, and then too small for others. |
If it's possible to adapt the value per device it would be best of course. Right now, a value of 1 in some devices makes some controls ( |
My Pixel XL, where I don't have selection issues with input touch radius 1, reports (right after start):
@nlisker Could you to get and post those metrics from your Samsung Galaxy devices? |
This is for the S7:
|
The other device belongs to a colleague. It can take some time to obtain the info. |
I also reported on this issue and setting -Dmonocle.input.touchRadius to a higher value does work but at a trade-off that scrolling is compromised. Widgets seem to move in a choppy fashion instead of gliding on the screen. I found a software solution (encapsulated in one Java class I call GluonListViewSelectionAdapter) whereby touch is just as sensitive on a Samsung Galaxy phone as a Google Pixel, and it has nothing to do with changing -Dmonocle.input.touchRadius. My custom code looks kludge but, regardless, it demonstrates how to fix the problem. I can provide a HelloWorld app that applies my fix so that the Gluon Developer Team can see for themselves that all devices behave the same way to the users' touch events. My hope is that, after seeing how I fixed it as an application developer, the platform developers will have new insight what they need to do so that every next application developer like myself doesn't also have to repeat the same workaround code that I've applied to my apps. |
@javateer Could you provide that HelloWorld class with your fix? That would be really helpful. |
@jperedadnr @nlisker please pull my demo app from https://github.com/javateer/gluonfx-list-selection-adapter The app shows you two lists of the same data. One of the lists is denoted as Default and the other as Adapted. The Default ListView behaves as usual. The Adapted ListView makes use of my GluonListViewSelectionAdapter.java. If you run this on a Google Pixel or another non-Samsung device, both lists seem to behave the same to touch and scroll events. What's important is to deploy this app on a Samsung device. Then, you see that GluonFX ListView touch-selection events are very problematic for the Default ListView. They sometimes register but you usually don't get the expected/desired behavior. However, observing the Adapted ListView's touch events shows list item selection/deselection actions to be working consistently/reliably. Even though every runtime environment does not require my GluonListViewSelectionAdapter.java for their apps' ListView touch events to work (only Samsung devices need this fix), a developer can apply this fix and then their app will work across all environments. Note though, I say this not having tested on iOS yet. Just my Linux desktop, my Samsung phone, and my Google Pixel phone. |
@nlisker, regarding the Xed boxes you're seeing instead of the Material Design Icons - during my own development, as I made use of more of the Gluon API's surface area, I would come across another issue not exposed in the sample applications. In the forums I would find the solution (usually given by @jperedadnr) was to increment to a newer dependency release that patched the issue. However, that upgrade sometimes broke another feature that was working in the older revision. Then, as a follow-up to the reported introduction of a new bug by the code patch of repairing the earlier one, I would find a newer release to upgrade to. While I don't now still remember precisely the incremental updates I've made (and their reasons with available StackOverflow links), I can tell you that I do remember seeing my working Icons break after an upgrade, and then restored after another upgrade. This demo app I've provided (and you've test run) didn't show the Material Design Icons for me at one point, but it does now. My current build environment is:
You can see in my demo app's POM file the following configuration values. But you're running the same demo app so I expect you haven't changed these settings in your copy of the codebase's POM file.
Consider also deleting directory |
Sorry, @nlisker. My screenshot above was taken from the Desktop. I just deployed this to my Google Pixel 6 and I see boxes too. I suppose this is another regression bug. Are you still working on Gluon @johanvos? Your social media posts suggest you've stayed busy in other things. Your genius skills and attention here would be appreciated :) |
Hi @javateer , I'm totally still with Gluon and working on Substrate :) |
Typically "white empty boxes" instead of valid icons are related to a non supported font on a given device. In the past some devices didn't support Roboto Medium (but this also affected regular text, not only icons). Using an alternative font used to fix this. For instance devoxx/MyDevoxxGluon#212 was some of this cases. |
@johanvos @jperedadnr , thank you, both of you, for being so fast on the draw with your replies. I have a fix suggestion for @nlisker. The current POM file of the demo project we're referring to has the following settings in it:
I see in another project of mine I don't have the Xed boxes issues and that other project has these values for the same settings:
Now, no more boxes. Note - this screencapture below is from my Android, not Desktop. However, it is from a Pixel 6, not a Samsung. Still, though this issue #1184 is primarily about Samsung list selection(s) not working unless using my demo project's coding solution, I don't believe the Xed box icons issue is Samsung specific. You should see the icons like I'm showing you now from my phone's screen capture. @jperedadnr, to not bury the primary reason for why #1184 exists by this side chatter about Xed boxes for icons, please take notice that earlier above @nlisker verified my demo code does indeed demonstrate how a Gluon Developer can augment the Gluon software library so that list selections work on all devices, including Samsung. I have seen people report this Gluon-Samsung list selection problem on StackOverflow since many years ago. I hope you're excited to know someone (modest me) has finally solved it. @nlisker's last remark in his earlier comment above is the question, how do you suggest we proceed? I also have been waiting to learn whether you, @johanvos, and the others that maintain the GluonFX codebase will refactor the code accordingly with the insight discovered by my demo project's working code or if everyone should just choose whether to apply the same adaptive code on top of the Gluon library as I have done in my demo project. |
My problem in that regard is gluonhq/attach#341. I can't upgrade to a new Attach version because it breaks Android 8.
If Johan and/or Jose can integrate @javateer's fix we could close this issue. |
@nlisker We're looking into it. |
I've built and deployed @javateer apk (from https://github.com/javateer/gluonfx-list-selection-adapter).
Checking the changes, I see these are applied to regular ListView and also to CharmListView (Gluon Mobile). We could easily modify the latter, but doing the changes on OpenJFX for ListView (even if it is only for Android) is not that straightforward... |
@nlisker, @javateer After some testing, I've simplified the approach from https://github.com/javateer/gluonfx-list-selection-adapter, to this simple class, that works fine on a Samsung device, without any changes to OpenJFX or Gluon Mobile:
Does that make sense? |
Does the original FXML file need to be modified to be suitable for this change of the class? |
I just posted a possible implementation. The FXML file for this case is just a View with a ListView control. |
I tested it and it works well. Selection is easy and the scrolling works. One thing I noticed is that the acceleration between scrolls is not preserved (doing a scroll while the list is scrolling from a previous event resets the acceleration instead of adding to it). I think it's unrelated and that this behavior exited before also. |
Following https://stackoverflow.com/questions/74097583/combobox-makes-selection-with-touch-events-difficult, a value of 1 causes touch events to not register correctly on some devices (tested on 2 Samsung Galaxys). A value of 2 works better. I suggest changing the default for Andoird to 2 at https://github.com/gluonhq/substrate/blob/master/src/main/resources/native/android/c/launcher.c#L69.
The text was updated successfully, but these errors were encountered: