B4A Library [Class] CustomInput

I have created a custom input dialog (non modal) that allows customization.

This is version 1

It requires the IME library.

The attached project shows how to use it.

I will spend some more time on it when I wake up.

regards, Ricky
 

Attachments

  • CustomInput.zip
    8 KB · Views: 441
  • CustomInput1.1.zip
    8.8 KB · Views: 384
Last edited:

pluton

Active Member
Licensed User
Longtime User
This is great. I love animation effect on the list.
Love it.
Only I need to edit some cenetring with panel because on my Lg Optimus P500 don't show whole screen

Here is screenshoot:
 

Ricky D

Well-Known Member
Licensed User
Longtime User
I have coded it to suit my Samsung s2 which is 800x480 at 1.5 scale. I only write stuff for myself.

You can change it to suit your device. What are the specs of your phone? I could test it on the emulator. I have to admit I don't know much about different screen sizes and programming for them.

Regards, Ricky
 

pluton

Active Member
Licensed User
Longtime User
Don't worry Ricky D
I have edited to see how it looks on my resolution 320x480

I edited just some left,top position :)
B4X:
   pnl.AddView(lTitle, 0dip, 0dip, 100%x, 40dip)
   pnl.AddView(aceInput, 0dip, 80dip, 320dip, 80dip)
   pnl.AddView(bOk, 0dip, 200dip, 160dip, 80dip)
   pnl.AddView(bCancel, 160dip, 200dip, 160dip, 80dip)
   
   m_act.AddView(pnl, 0, 0, 100%x, 100%y)

Here is screenshoot:

 

Ricky D

Well-Known Member
Licensed User
Longtime User
Well done.

I'll try to find out the INPUT_TYPE enumeration so we don't need to use

B4X:
Dim et As EditText
inp. setInputType(et. INPUT_TYPE_TEXT)

It would look like

B4X:
inp. setInputType(inp. INPUT_TYPE_TEXT)

I'll look at it after I get up from sleep later. I'll incorporate the changes you made

Regards, Ricky
 

Ricky D

Well-Known Member
Licensed User
Longtime User
v1.1

Tidied up the ui

Added some setTitle methods

Incorporated the INPUT_TYPE

Added a new parameter to Initialize - allowreturn as boolean
set this to false if you don't want the ReturnFrom sub to fire if NotInList fires

Added autodocumentation
 
Last edited:

Ricky D

Well-Known Member
Licensed User
Longtime User
How do I make my 1.1 version appear in the 1st post?

regards, Ricky
 

Ricky D

Well-Known Member
Licensed User
Longtime User
Edit mode doesn't give me a way to add an attachment.

Any ideas?

regards, Ricky
 

stevel05

Expert
Licensed User
Longtime User
Click the 'Go Advanced' button, it's in there.
 

Ricky D

Well-Known Member
Licensed User
Longtime User
I've tried that and this is what happens

View attachment 12324I have created a custom input dialog (non modal) that allows customization.

This is version 1

It requires the IME library.

The attached project shows how to use it.

I will spend some more time on it when I wake up.

regards, Ricky

P.S Latest version is 1.1 in post #6


the 12324 is hightlighted inside tags

This happens when I click on the little paperclip then a little popup comes saying manage the item.

What am I supposed to do?

I can't delete or re-add anything.

regards, Ricky
 
Last edited:

Ricky D

Well-Known Member
Licensed User
Longtime User
Ok I got it sorted.

1.1 is now on post #1.

Original is still there too

regards, Ricky
 

Ricky D

Well-Known Member
Licensed User
Longtime User
You might have code like

B4X:
Dim i As Int
Msgbox("we don't have a way to get user input from code. "," ") 
'so we use an object to get it

If we are working on an activity then using an EditText would be fine but I have times when I need to get something from me when there isn't an activity to put one on.

Regards, Ricky
 

stevel05

Expert
Licensed User
Longtime User
You can pass the activity to the class and add views (see attached), but by having the views as globals in the class, it becomes an activity object and cannot be Dimmed as a process global.

I don't think this will break integrity perhaps someone will comment if it does.
 

Attachments

  • test.zip
    7 KB · Views: 217
Last edited:

Ricky D

Well-Known Member
Licensed User
Longtime User
I'm not sure what you mean.

regards, Ricky
 

stevel05

Expert
Licensed User
Longtime User
Perhaps I misunderstood you, I thought you were saying that you couldn't use an edit text in a class.
 

Ricky D

Well-Known Member
Licensed User
Longtime User
Ok. You did misunderstand lol. But then again I'm not the best at explaining myself.

This class contains an autocompleteeditext view.

Regards, Ricky
 
Top