Try adding an includeInLayout property in overlayRect. The way you have it, the 
overlay is there, just not visible and on Android it may be "eating" the tap 
event. 

Erik

Erik Thomas
Chief Architect
Office: 541.247.2995 / Mobile: 303.304.1466



http://linqto.com <http://linqto.com/>

This email may contain confidential and privileged material for the sole use of 
the intended recipient. Any review or distribution by others is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
and delete all copies.

On Jan 12, 2018, at 11:55 AM, bilbosax <waspenc...@comcast.net> wrote:

Interesting quirk in Android that I can't figure out.  I have an itemRenderer
in a mobile AIR project that contains a button called "viewButton". On iOS,
when this button is clicked, two things happen 1) The itemRender enters its
"selected" state and causes an overlay to appear over the entire renderer
and 2) an event is dispatched when the viewButton is clicked.  This is
exactly what I want to happen.

On Android, the itemRender enters its "selected" state and causes the
overlay to appear, but the viewButton does not fire a clicked event EVEN
THOUGH ITS SKIN STATE CHANGES STATE SO YOU CAN TELL IT WAS CLICKED. I
actually have to to click the button a second time on every renderer to get
it to recognize that the button was clicked.  If I put a trace in my button
skin, it shows that it entered the "down" state even though no click event
is fired by the button.  How is this possible?

I suppose I could dispatch my event from within the button skin, but that
feel like a hack that should be unnecessary. Here is the code for my
itemRenderer.  Please let me know if you can see any reason why my button
would have to be clicked a second time before it fires a click event.

Thanks!!

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"; 
                                xmlns:s="library://ns.adobe.com/flex/spark" 
                                xmlns:mx="library://ns.adobe.com/flex/mx" 
                                autoDrawBackground="false" 
dataChange="setValues(event)"
xmlns:fxgAssets="fxgAssets.*" initialize="initializeHandler(event)">
        <fx:Script>
                
        </fx:Script>
        
        <fx:Declarations>
                <s:Fade id="fadeIn" duration="3000" target="{noImage}" 
alphaFrom="0"
alphaTo="1"/>
        </fx:Declarations>
        
        <s:states>
                <s:State name="normal" 
enterState="normalEnterStateHandler(event)"/>
                <s:State name="hovered" />
                <s:State name="selected" 
enterState="selectedEnterStateHandler(event)"/>
        </s:states>
        
        <s:BitmapImage id="noImage" source="@Embed('assets/noPhoto.jpg')"
smooth="true" smoothingQuality="high"/>
        <s:BitmapImage id="propertyImage" smooth="true" 
smoothingQuality="high"/>
        
        <s:Rect id="highlightRect" x="0" y="0">
                <s:fill>
                        <s:LinearGradient rotation="90">
                                <s:GradientEntry color="#515151" alpha=".8" 
ratio="0"/>
                                <s:GradientEntry color="#515151" alpha=".8" 
ratio=".3"/>
                                <s:GradientEntry color="#000000" alpha="0" 
ratio="1"/>
                        </s:LinearGradient>
                </s:fill>
        </s:Rect>
        
        <s:Rect id="overlayRect" x="0" y="0" alpha=".3" visible="false">
                <s:fill>
                        <s:SolidColor color="#A30000"/>
                </s:fill>
        </s:Rect>
        
        <s:Label id="statusLabel" color="#FFFFFF" paddingLeft="10"
paddingRight="10" paddingTop="5" paddingBottom="5"/>
        
        <s:HGroup id="textGroup" gap="0">
                <s:VGroup id="priceGroup" gap="0">
                        <s:Label id="priceLabel" color="#FFFFFF" 
styleName="titleMedium"
fontWeight="bold" paddingLeft="5"/>
                        <s:Label id="addressLabel" color="#FFFFFF" 
styleName="titleSmall"
maxDisplayedLines="1" paddingLeft="5"/>
                        <s:Label id="cityLabel" color="#FFFFFF" 
styleName="titleSmall"
maxDisplayedLines="1" paddingLeft="5"/>
                </s:VGroup>
                
                <s:Label id="sqftLabel" color="#FFFFFF" textAlign="right"
styleName="titleSmall" paddingRight="5"/>
                <fxgAssets:propertySplitter id="splitter1"/>
                <s:Label id="bedsLabel" color="#FFFFFF" textAlign="right"
styleName="titleSmall" paddingRight="5"/>
                <fxgAssets:propertySplitter id="splitter2"/>
                <s:Label id="bathsLabel" color="#FFFFFF" textAlign="right"
styleName="titleSmall" paddingRight="5"/>
        </s:HGroup>
        <s:Label id="mlsLabel" color="#FFFFFF" textAlign="right"
styleName="titleSmall" paddingRight="5"/>
        <s:Button id="viewButton" skinClass="skins.viewButtonSkin"
click="viewButtonClickHandler(event)"/>
        
</s:ItemRenderer>



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/


Reply via email to