Hey guys
I'm creating a sort of preference screen as the PreferenceActivity Lib doesn't do what i need.
To create it I use a scrollview and panel containing required views for that item (e.g. 2 labels and a checkbox for a checkbox item). Got these adding nicely. Now, when an item is clicked / tapped, i want it to highlight to the touch like a listview does, I use the following code and it seems to work nice on a emulator running 2.2 froyo, but when run on a real device the color flashes for a brief second and then returns to black. Any ideas why this happens and how to get it working correctly. It's almost as though the _touch event needs 'de-bouncing'? android version tried on real device are 2.3.3. I very nearly put 2.1 as well but just remembered i flashed the backside off my x10 mini pro and put 2.3.3 on it
Thanks
I'm creating a sort of preference screen as the PreferenceActivity Lib doesn't do what i need.
To create it I use a scrollview and panel containing required views for that item (e.g. 2 labels and a checkbox for a checkbox item). Got these adding nicely. Now, when an item is clicked / tapped, i want it to highlight to the touch like a listview does, I use the following code and it seems to work nice on a emulator running 2.2 froyo, but when run on a real device the color flashes for a brief second and then returns to black. Any ideas why this happens and how to get it working correctly. It's almost as though the _touch event needs 'de-bouncing'? android version tried on real device are 2.3.3. I very nearly put 2.1 as well but just remembered i flashed the backside off my x10 mini pro and put 2.3.3 on it
B4X:
Sub Panel_Touch (Action As Int, X As Float, Y As Float) As Boolean
Dim p As Panel
p = Sender
If Action = Activity.ACTION_DOWN Then
p.Background = StockDrawable.GetAndroidDrawable("list_selector_background_pressed")
Else
p.Color = Colors.Black
End If
Return True
End Sub
Thanks