Re: How to access non standard objects in Elemental2?

2020-08-19 Thread 'Michael Harray' via GWT Users
Great thank you, works a treat :)

On Monday, August 17, 2020 at 9:53:28 AM UTC+12 t.br...@gmail.com wrote:

>
>
> On Sunday, August 16, 2020 at 11:41:18 PM UTC+2, Michael Harray wrote:
>>
>> Hello, I'm currently working on PWA functionality in our GWT app, trying 
>> to utilise Elemental2 / JSInterop where possible instead of writing 
>> javascript. To detect if the app is launched in PWA mode on IOS, this is 
>> the recommended javascript:
>>
>>
>> const isInStandaloneMode = () => ('standalone' in window.navigator) && 
>> (window.navigator.standalone);  
>>
>> However there appears to be no DomGlobal.window.navigator.standalone 
>> object in Elemental2, as I'm guessing it has not been standardised. 
>>
>> So my question is, is there a recommended way to define this object so 
>> that I can replicate the above javascript without resorting to JSNI? Or is 
>> there another way to achieve this?
>>
>
> I would simply use jsinterop-base' JsPropertyMap: 
> https://javadoc.io/doc/com.google.jsinterop/base/latest/jsinterop/base/JsPropertyMap.html
> Something like:
>
> public static boolean isInStandaloneMode() {
>   var navigator = Js.asPropertyMap(DomGlobale.window.navigator);
>   return navigator.has("standalone") && Js.isTruthy(navigator.get(
> "standalone"));
> }
>
> The navigator.get("standalone") translates to navigator["standalone"] 
> rather than navigator.standalone, but that should be strictly equivalent 
> (navigator is a browser object, so you're never really sure, but IIRC 
> things were only "strange" in IE). You could use JsInterop for that part if 
> needed.
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/418d0be7-48de-46eb-b43d-62497a8dbdd1n%40googlegroups.com.


Re: Do Google Web Toolkit's touch events support Windows tablets?

2020-08-19 Thread Craig Mitchell
I had a lot of problems with touch events.  However, they weren't GWT's 
fault, just different browsers doing different things.

I ended up with this:
// Listen for the screen touch start
mainPanel.addDomHandler(event -> {
handleScreenTouches(event.getChangedTouches(), true);
}, TouchStartEvent.getType());

// Listen for the screen touch move
mainPanel.addDomHandler(event -> {
handleScreenTouches(event.getChangedTouches(), true);
}, TouchMoveEvent.getType());

// Listen for the screen touch end
mainPanel.addDomHandler(event -> {
handleScreenTouches(event.getChangedTouches(), false);
}, TouchEndEvent.getType());

And then kept my own array of what touches are occurring.

I'm not sure if it works fine with a surface pro.  You can try if you like  
https://drift.team/  if the game controls work fine (especially with multi 
touch), then all good.

On Tuesday, 28 July 2020 at 6:56:59 pm UTC+10 paul.andr...@gmail.com wrote:

> When I looked at this 6 years ago (in relation to MGWT, which is dead 
> although we still use it in legacy products) Pointer events were the way to 
> go and are supported on all browsers now as far as I am aware.
>
> There was talk of a single touch/pointer API system in GWT similar to what 
> MGWT did where it took mouse, touch and pointer events and converted to a 
> single touch event system. Hence you coded to MGWT's touch system and it 
> worked on all devices.
>
> No idea if GWT did this in the end.
>
> I assume you are using an old IE Edge? Latest Edge uses webkit under the 
> hood and so your problems may go away with this browser. Older IE Edge as 
> far as I can remember does not support touch events but does support 
> Pointer events.
>
> Take what I say with a pinch of salt. It has been many years but I believe 
> that is why you have an issue.
>
>
> On Tue, 28 Jul 2020 at 07:37, Frank  wrote:
>
>> Maybe you can Google for : JS surface touch events
>> Or something like that. But for JS. Maybe that can point you in the right 
>> direction.
>> Op maandag 27 juli 2020 om 22:02:20 UTC+2 schreef m.conr...@gmail.com:
>>
>>> you will need to check and see what event is actually generated for the 
>>> windows 10 tablet in the dom and hook those.
>>>
>>> On Mon, Jul 27, 2020 at 2:52 PM Andy Langer  wrote:
>>>
 Hi all. Currently working on a webapp using GWT. I currently have a 
 feature working with touch events on a Canvas. The feature itself works 
 perfectly fine on every device but windows tablets (surface pro). Is there 
 something special I have to do for this, or does GWT have no way of doing 
 this?

 -- 
 You received this message because you are subscribed to the Google 
 Groups "GWT Users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to google-web-tool...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/google-web-toolkit/940db851-82c2-4f1a-99b8-8ef653d1dadao%40googlegroups.com
  
 
 .

>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-tool...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-web-toolkit/af7c625a-85ef-4e21-95e3-8520bbc7d10cn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/0a6636d9-7266-4f9f-8789-b7f8be9a60f3n%40googlegroups.com.


Re: GWT Server and debug

2020-08-19 Thread Craig Mitchell
> When I still used Eclipse I always used the plugin from  Brandon 
Donnelson :  https://github.com/gwt-plugins/gwt-eclipse-plugin 

I'm guessing that's the same one that's in the install instructions:  
http://www.gwtproject.org/usingeclipse.html#installing  

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/837374f0-a578-4dec-a95e-3b0ca744276bn%40googlegroups.com.