Android Question Swipe in Panel

metzeller_2013

Member
Licensed User
Longtime User
Good day to all,
I'm currently developing an app for loan collection and i want to add a calculator app to it. The thing is want a swipe gesture to move or open and close a calculator panel by dragging it from the side of the screen. Like a sort of toolbox.
I'm using some few panels and i want to be able to access the calculator panel regardless of which panel is currently active....
If someone could help me please or give me an idea on how to do it, would be much appreciated.....
Thanks in advance......
 

pauleffect

Member
Licensed User
Longtime User
try this: put a small-ish panel on top of the others. The one on the right. It will serve as a Handle.
1.png


When a user touches it, or drags it, the big calc follows it.

2.png





B4X:
#Region Buttons
Sub handle_Touch (Action As Int, X As Float, Y As Float)
    Select Action
        Case Activity.ACTION_DOWN
            'Change how the handle looks when it;s pressed, if you feel like it

        Case Activity.ACTION_UP
            handle.SetLayout(bla bla bla)
                        calcPanel.SetLayout(bla bla bla)
                    'Put these two where you want them.
End Sub

or start a timer on action_up which slides them 1dip a tick.

a third options, if you feel like dragging, is to set up an invisible panel on top. on action_move, set the left of the handle to the X of the touch. you'll need to hit it with an anti-jitter filter to counter the "noise" of the screen!

best of luck!
 
Upvote 0
Top