Android Tutorial Android Views (controls) and dialogs

Many users who start to develop Android applications may be frustrated by the fact that they don't find the control they are looking for. Its even worse, for some mysterious reason there are no "Controls" at all. Instead there are "Views".

This page shows screenshots of all the available views and dialogs:

Views


Button:

views_button.png


Checkbox:

views_checkbox.png


EditText (TextBox):
Can also be multiline.

views_edittext.png



ImageView:

views_imageview.png


Label:

views_label.png


ListView (ListBox):

views_listview.png


Panel:
Can hold other views (and load layout files).

views_panel.png



ProgressBar:

views_progressbar.png


RadioButton:

views_radiobutton.png


ScrollView:

views_scrollview.png


SeekBar (TrackBar):

views_seekbar.png


Spinner (ComboBox):

views_spinner.png


TabHost (TabControl):

views_tabhost.png


ToggleButton:

views_togglebutton.png


WebView:

views_webview.png


Dialogs

Basic4android dialogs are blocking modal dialogs. Which means that the code execution stops while the dialog is shown.

Some of the dialogs are shown by calling a keyword (like Msgbox). Other dialogs are included in Andrew's excellent dialogs library.

Internal dialogs


InputList:

views_inputlist.png


InputMultiList:

views_inputmultilist.png


Msgbox (or Msgbox2):

views_msgbox.png


Dialogs library

ColorDialog:

views_colordialog.png


ColorPickerDialog:

views_colorpickerdialog.png


DateDialog:

views_datedialog.png


InputDialog:

views_inputdialog.png


NumberDialog:

views_numberdialog.png


TimeDialog:

views_timedialog.png


FileDialog:

views_filedialog.png

 

bodycode

Member
Licensed User
Longtime User
Numberdialog doesn't seem to output decimal point in output.

The "get number" button on your numberdialog box doesn't seem to output a decimal point, it's not visible at all, not even a space between any numbers. Only an integer appears to be outputtting.

Any way to fix this? I also notice a + and minus at the beginning of the numeric input GUI but doesn't seem to have any effect. What's that for? There's also a colon output? And a minus sign at the beginning of the number? What's that about? I simply want to use a decimal number in some calculations with some variables being assigned the values (I know how to do that in a simple way).

Thanks in advance. A bit confused, I'm probably using this wrong? Thanks in advance.


Regards,
bodycode
 

JonPM

Well-Known Member
Licensed User
Longtime User
In Msgbox2 is there a way to place the cancel button on the right side? Seems weird to have it in the middle, I prefer Yes, No, Cancel (just like in all the other dialogs). I'd like to keep the code clean by keeping Dialog.Response = Cancel with the actual Cancel button (instead of swapping it with the Negative).
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
How is it that I've only just found this thread. What a great resource for beginners and old-timers like me :D
Thanks @Erel.
 

sorex

Expert
Licensed User
Longtime User
I seem to mis something.

inputlist is marked as "internal" which means it's part of a core lib?

it's not recognizing it as a valid keyword with all core libs selected and the dialog lib added to the additional libs folder?
 

barx

Well-Known Member
Licensed User
Longtime User
I seem to mis something.

inputlist is marked as "internal" which means it's part of a core lib?

it's not recognizing it as a valid keyword with all core libs selected and the dialog lib added to the additional libs folder?

Seems to work ok here sorex and I have successfully used it in the past. You don't declare an inputlist like a view, you call it like a magbox. Maybe that is where you are going wrong?

B4X:
response = InputList(ItemsList, "Select an Item", -1)
 

sorex

Expert
Licensed User
Longtime User
Ooooooooh! :)

that works indeed.

I checked the beginners & advanced(?) guide but it wasn't mentioned there either (or I missed it) so I didn't know how to access/use it.

thanks, Barx.
 

barx

Well-Known Member
Licensed User
Longtime User
Ooooooooh! :)

that works indeed.

I checked the beginners & advanced(?) guide but it wasn't mentioned there either (or I missed it) so I didn't know how to access/use it.

thanks, Barx.
You have to be 733t to use the input list
 
Top