View Issue Details

IDProjectCategoryView StatusLast Update
0000958NoesisGUIUnity3Dpublic2018-11-22 19:09
Reporternokola Assigned Tosfernandez  
PrioritylowSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version1.2.6f5 
Summary0000958: With PanningMode=Both in ScrollViewer buttons don't update background when tapped on Android
DescriptionWith PanningMode=Both in ScrollViewer buttons don't update background when tapped on Android
Steps To Reproduce1. Open https://1drv.ms/f/s!AspGCVZdWgTBuup9b2_-mTFV5_06EA and download ButtonPanningModeBug.zip
2. Open in Unity
Note the Assets\Examples\style_NOK and style_OK
3. Run on Android
Expected:
when tapping buttons, the background changes to the "pressed" color bg

Actual:
nothing happens
4. Change Noesis style to style_OK - works
Additional InformationThe issue happens because of this line:
        <Setter Property="PanningMode" Value="Both"/>

Removing it fixes it. However, we now can't pan our scrollviewer as expected.
For the moment this is not a blocking issue for us, thus I set it to low pri (the TextBox issue I reported separately is blocking)
TagsNo tags attached.
PlatformAny

Activities

sfernandez

sfernandez

2016-10-19 13:28

manager   ~0004176

Hi,

We've been analyzing the Behavior in NoesisGUI and it matches exactly what WPF does. Let me try to explain what is happening:

When touch events are used inside a control that handles manipulation (as ScrollViewer does when PanningMode != None), then it captures touch events (raising ManipulationStarting event) until you move or release the touch.

OPTION 1: COMPLETED MANIPULATION

If touch is moved enough, then a manipulation starts (raising ManipulationStarted event, and subsequent ManipulationDelta events). Until touch is released (possibly raising ManipulationInertiaStarting event followed by some more ManipulationDelta events, and finally the ManipulationCompleted event).

This scenario can be better understood with the following MSDN image:
https://i-msdn.sec.s-msft.com/dynimg/IC392642.jpeg

OPTION 2: CANCELLED MANIPULATION

If you release the touch without moving it, then manipulation is cancelled, and previous touch events are promoted to mouse events. That means that the button will receive MouseDown, MouseMove and MouseUp events all in the same frame. So no visible change is seen in the button, but the Click event is always raised.

In a future release we want to change this behavior to something similar to UWP, that is better prepared for touch and multitouch environments than WPF.

Meanwhile, if you want to see a visual response when a Button receives a touch, maybe you can add an EventTrigger for the TouchDown event that animates the backgrounds color:

...
<ControlTemplate.Triggers>
    <EventTrigger RoutedEvent="UIElement.TouchDown">
        <BeginStoryboard>
            <Storyboard>
                <ObjectAnimationUsingKeyFrames
                  Storyboard.TargetProperty="Fill"
                  Storyboard.TargetName="ButtonBackground">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
                    <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Null}"/>
                </ObjectAnimationUsingKeyFrames>
            </Storyboard>
        </BeginStoryboard>
    </EventTrigger>
</ControlTemplate.Triggers>
...


Hope this helps.
jsantos

jsantos

2016-10-21 19:28

manager   ~0004180

This is the plan we have to improve Touching in 1.3 (basically, doing in like UWP)

https://trello.com/c/zN2r19h4/260-improve-manipulations
nokola

nokola

2016-10-28 13:15

reporter   ~0004196

Thanks, sounds good! Given that multitouch is a huge part of the market (phones, tablets) it's important and welcome change.
Thanks for the workarounds!

Issue History

Date Modified Username Field Change
2016-10-02 23:18 nokola New Issue
2016-10-04 23:22 sfernandez Assigned To => sfernandez
2016-10-04 23:22 sfernandez Status new => assigned
2016-10-19 13:28 sfernandez Note Added: 0004176
2016-10-19 13:28 sfernandez Status assigned => feedback
2016-10-21 19:28 jsantos Note Added: 0004180
2016-10-28 13:15 nokola Note Added: 0004196
2016-10-28 13:15 nokola Status feedback => assigned
2018-11-01 02:14 jsantos View Status public => private
2018-11-22 19:09 sfernandez View Status private => public
2018-11-22 19:09 sfernandez Platform => Any