Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
10
Erster Beitrag:
vor 6 Jahren, 5 Monaten
Letzter Beitrag:
vor 4 Jahren, 10 Monaten
Beteiligte Autoren:
Arie, RAUL2, Ruben Sanchez Peña , Georgio, Kingdr

Android and modal windows

Startbeitrag von Arie am 28.01.2012 21:04

Hi,
Android does not have the concept of opening a window in MODAL mode.
But coming from Windows I am very much used to it.
There are situations where they are very handy. Do I need to mimic a modal window?

Can someone explain to me what the Android way of a "modal window" is?

How do you Wm developers handle this situation?

Antworten:

BTW
Error(), Warning() and Info() seems to be MODAL. So how is this done?

von Arie - am 28.01.2012 21:08
Android does well with java, thought wm16 has it or
try this as below:

Dialog d = new AlertDialog.Builder(Buddies.this,AlertDialog.THEME_HOLO_LIGHT)
.setTitle("Create New")
.setNegativeButton("Cancel", null)
.setItems(new String[]{"mySheet", "Sheet1","",""},
new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dlg, int position)
{
if ( position == 0 )
{
}
else if(position == 1){
}
else if(position == 2){
}
}
})
.create();
d.show();

von Kingdr - am 28.01.2012 21:37
Well, the dialogs such as Info() and Error() are already modal in WM. This is ok.
I'm talking about windows of my own, say CustomerEdit or OrderInfo or whatever.
They cannot be opened modal.
If you open such a window and it is not maximized, you can click on the window underneath.
At the moment I use a few tricks:
1. placing a transparant image in frontm before showing the second window, which blocks the user-access for the first window
2. using only maximized windows, so one cannot see window1 when window2 is active
3. using planes

von Arie - am 30.01.2012 08:03
Hi Arie,

I believe the concept of modal dialogs are mostly found in windows programming.
You can implement "modal-like" behavior but ... eeehhh .. you need access to
the AndroidManifest.xml file ... which isn't available yet.

The code above has to be modified for WM. (You cannot declare methods in WM or
@override parent classes in which Windev has yet to create -- as part of the APK
generation).

If you want some help on this, let me know.

Thanks!
Georgio

von Georgio - am 30.01.2012 20:05
Hi.

Have you tried WinStatus with the Above parameter?

Rubén

von Ruben Sanchez Peña - am 26.02.2012 20:27
Ruben,
I actually do use WinStatus, but not on the opened window.
I gray out the parent window in cases, where the child window is smaller. And therefore the part of the parent window are still visible/accesible.
Some other windows are already fullscreen, so I dont have that problem in the first place.
btw parent/child windows are not the right terms i guess. There are just windows in Android so to speak.

von Arie - am 26.02.2012 21:02
Quote
Arie Mars
Ruben,
I actually do use WinStatus, but not on the opened window.
I gray out the parent window in cases, where the child window is smaller. And therefore the part of the parent window are still visible/accesible.
Some other windows are already fullscreen, so I dont have that problem in the first place.
btw parent/child windows are not the right terms i guess. There are just windows in Android so to speak.

Hi Arie, did you found a solution for this?

I'm actually looking for something else: returnedvalue. I know it's rather easy to get rid of it and user a workaround, but I'm trying to understand if there's a away for using parameters with windows in Android. Anyway, it would be useful to know if you could make some kind of modal windows in Android.

Kind regards.

von RAUL2 - am 09.09.2013 20:42
Hi Raul,
I don't have a modal dialog yet.
if you search google for "android modal" you will get lots of hits.
I came across setFinishOnTouchOutside(false), which seems to do the trick.
Atm I;m not able to do some testing I'm afraid. Maybe you can and let us know?

von Arie - am 10.09.2013 09:37
Quote
Arie Mars
Hi Raul,
I don't have a modal dialog yet.
if you search google for "android modal" you will get lots of hits.
I came across setFinishOnTouchOutside(false), which seems to do the trick.
Atm I;m not able to do some testing I'm afraid. Maybe you can and let us know?


I'm working on API level 8. I've found it's nessesary API 11 for this. Anyway, I don't understand anything of Java (never touched it). Maybe it is useful in the future, right now I don't have the time. Anyway, if I touch it again I'll post here.

Regards.

von RAUL2 - am 10.09.2013 19:50
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.