Slide-Up Custom Keypad

Bill Norris

Active Member
Licensed User
Longtime User
I am utilizing a custom keyboard, on its own panel, rather than the default Android keyboard. I want the keyboard to slide up from the bottom of the screen when the user touches the textview. I've looked at some of the code in the animation tutorials and my head is spinning. Can someone out there break this down into a few basics on how to accomplish this.

Thanks,
Bill
 

margret

Well-Known Member
Licensed User
Longtime User
Here is code I use to animate windows in my app. It works fine, maybe you can adapt this code to work for you.

B4X:
Sub PanPop( mlayout As String, hc As Int, wc As Int) '( mlayout=your .bal file, hc=height offset + or -, wc=same for width )
   pnlSelect2.Initialize ( "Select2")      
   pnlInput2.Initialize ("")
   pnlInput2.LoadLayout ( mlayout )    
   pnlSelect2.Color  = Colors.ARGB (150,0,0,0)         
   Activity.AddView (pnlSelect2, 0, 0,   100%x, 100%y)   
   mh1=(pnlSelect2.Height/2) - (PanelMain.Height/2) + hc
   mw1=pnlSelect2.Width/2 - (PanelMain.Width/2) + wc
   mh2=PanelMain.Height
   mw2=PanelMain.Width
   pnlSelect2.AddView (pnlInput2, mw1, mh1, mw2, mh2)
   If ani = 1 Then  '1 set animation flag to on, 0 equals off
      pnlSelect2.Left = 601
      Do While pnlSelect2.Left > mw1
         If pnlSelect2.Left- anispd > mw1 Then
            pnlSelect2.Left = pnlSelect2.Left - anispd 'anispd is animation speed, set to around 70, larger for faster speed.
         Else
            pnlSelect2.Left = mw1
         End If
         DoEvents
      Loop
   End If
End Sub
 
Upvote 0
Top