AHQuickAction library - Nice looking popup menus

jfranz

Member
Licensed User
Longtime User
thanks for the quick reply. Works now.

I made the icon's read only but not the res folder. Guess I set the wrong files when I first downloaded.

Again thanks for the help and sorry for the screwup on my part. If I would have read he first post more carefully I would have gotten this easily.
 

ramesh raj

New Member
Licensed User
Longtime User
When I run the QuickActionExample I get the error
javac: file not found: src\de\amberhome\quickactionexample\designerscripts\*.java
What could I be doing wrong?
Ramesh Raj
 

corwin42

Expert
Licensed User
Longtime User
When I run the QuickActionExample I get the error
javac: file not found: src\de\amberhome\quickactionexample\designerscripts\*.java
What could I be doing wrong?
Ramesh Raj
Sorry, are you sure about the path in the error message. It does not make sense. Try Tools/Clean Project and which version of B4A are you running?
 

Dario126

Member
Licensed User
Longtime User
I can't find how to set background color for AHPopupMenu or single AHActionItem. Is this possible?

Now I get by default black background and white font (and grey like 3D lines between items). Can I change background to white, font to black (android holo theme)?
Also, is it possible to change font?
 
Last edited:

Slacker

Active Member
Licensed User
Longtime User
I think this library is a good stuff, but without the capacity to change the menu item title at Runtime without the need to re-create it (for example clicking on it and change the item title/text), is very very limited and partial.
 

peacemaker

Expert
Licensed User
Longtime User
I tried to use this lib with OpenStreetMap lib, that uses the overlay objects that are not views when tap over it.
I added a transparent Panel1 and used it as the view for PopUpMenu.Show(Panel1) - i mean - i change Panel's coords just before PopUpMenu.Show(Panel1).
But strange - menu is shown always under the previous tapped point, but not under the just tapped one...

How menu position is calculated ?
 

johndb

Active Member
Licensed User
Longtime User
I tried to use this lib with OpenStreetMap lib, that uses the overlay objects that are not views when tap over it.
I added a transparent Panel1 and used it as the view for PopUpMenu.Show(Panel1) - i mean - i change Panel's coords just before PopUpMenu.Show(Panel1).
But strange - menu is shown always under the previous tapped point, but not under the just tapped one...

How menu position is calculated ?

This is a very nice library but I have the same problem as peacemaker. I create a small invisible panel and use that as the menu's anchor point. The menu popup only shows up at the initial point where it is created even when I change the panel's location. I am using this menu in other parts of my software (listviews) without a problem but I would like to be consistent. Could someone look at this library and please fix this bug?

Thanks,

John
 

corwin42

Expert
Licensed User
Longtime User
Hmm. One of the first things done in the Show() method is AnchorView.getLocationOnScreen(); which should give the position of the anchor view on screen. Maybe if the AnchorView is moved and then Show() is called this method still returns the old position. Please try a DoEvents call just before showing the QuickAction popup.
 

johndb

Active Member
Licensed User
Longtime User
Hmm. One of the first things done in the Show() method is AnchorView.getLocationOnScreen(); which should give the position of the anchor view on screen. Maybe if the AnchorView is moved and then Show() is called this method still returns the old position. Please try a DoEvents call just before showing the QuickAction popup.

Thanks for the tip. I'll give that a try when I get home this afternoon and will post the results. Thanks again.

UPDATE: Calling DoEvents after setting the view (panel) position and before the QuickAction Show() solves the problem that I was having. Thanks Corwin42 :)
 
Last edited:

Richard Goh

Active Member
Licensed User
Longtime User
I had a strange error on below. My program work fined earlier and out of sudden when I recompile and run the program. Then I hit into this below error in ac1.Initialize("AC"). The variable is declared in Sub_Globals (Dim ac1 As AHQuickAction). I did download the sample program and test. But It's work. Any idea what is the cause?

B4X:
android.content.res.Resources$NotFoundException: Resource ID #0x0
    at android.content.res.Resources.getValue(Resources.java:1339)
    at android.content.res.Resources.loadXmlResourceParser(Resources.java:2445)
    at android.content.res.Resources.getAnimation(Resources.java:1202)
    at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:71)
    at de.amberhome.quickaction.QuickAction.Initialize(QuickAction.java:120)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:680)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:308)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
    at b4a.xxx.pd.pd.afterFirstLayout(pd.java:98)
    at b4a.xxx.pd.pd.access$100(pd.java:16)
    at b4a.xxx.pd.pd$WaitForLayout.run(pd.java:76)
    at android.os.Handler.handleCallback(Handler.java:615)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4935)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
 
Last edited:

Richard Goh

Active Member
Licensed User
Longtime User
Thanks. corwin, you are right. it's working after i copy the missing folders back and set them to readonly.
I notice after I upgraded the B4A to v3.5, this problem happened very often. The folders inside Object/res will be deleted off (except drawable, layout and xml folders). Especially when we edit the programs created in older version. And we need to manually add the folders and set it to readonly then it will not deleted.
 

Douglas Farias

Expert
Licensed User
Longtime User
how to close ?
i m opening a panel but only when i open a panel menu stay opened how to close?

exist a code to close?
 

corwin42

Expert
Licensed User
Longtime User
how to close ?
i m opening a panel but only when i open a panel menu stay opened how to close?

exist a code to close?
Be sure you have set the sticky property of your action items to false. If you set it to true the event will be fired but the popup will not close.
 

corwin42

Expert
Licensed User
Longtime User
hi,

thanks to for this library.

how i delete an item?

This is not possible. You have to reDim the object again and add all the menu items you want to have.
 
Top