AHQuickAction library - Nice looking popup menus

incendio

Well-Known Member
Licensed User
Longtime User
Thanks for the library.

Care to point me which XML file should be edit to change selected color in AHQuickAction3d, from Orange to red?
 

corwin42

Expert
Licensed User
Longtime User
Thanks for the library.

Care to point me which XML file should be edit to change selected color in AHQuickAction3d, from Orange to red?

I think it's the ahqa_slider_btn_pressed.9.png and ahqa_slider_btn_selected.9.png images in drawable-mdpi and drawable-hdpi folders.
 

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear friends,

before some months I have tried this library and it worked perfect. Now when I am trying the same program I get this message:

android.content.res.Resources$NotFoundException: Resource ID #0x0

and it is for the row:

B4X:
ac1.Initialize("AC")

Is it something with version of B4A?

Thank you
Best regards
p4ppc
 

corwin42

Expert
Licensed User
Longtime User
Dear friends,

before some months I have tried this library and it worked perfect. Now when I am trying the same program I get this message:

android.content.res.Resources$NotFoundException: Resource ID #0x0

and it is for the row:

B4X:
ac1.Initialize("AC")

Is it something with version of B4A?

Thank you
Best regards
p4ppc

I guess your resource files were not longer read only and B4A deleted them on compile.

Be sure to make the resource files read only or use a separate directory for them and use the #AdditionalRes attribute.
 

johndb

Active Member
Licensed User
Longtime User
Thank you very much CORWIN42 - SOLVED
Best regards,

p4ppc

I always put this statement at the beginning of my main activity. Saved me a fair bit of grief in the past.
B4X:
    ' Set the attribute of all files within the "res" folder as "Read-Only".
    #CustomBuildAction: 1, c:\windows\system32\attrib.exe, +r res\*.* /s
 

corwin42

Expert
Licensed User
Longtime User
An even better solution with the newes B4A versions is to put the resource files in a separate folder and use the #AdditionalRes attribute to reference them.
 

ValDog

Active Member
Licensed User
Longtime User
Awesome library

wow, this is such a great library, i'm loving b4android more and more, this is very awesome, i just added this library to the app i'm working on, i was using the addmenu function, but now that i added this library i can display a pop up menu when the menu key on my phone is pressed, i love it, thanks Erel!

:sign0098:
How do you link the pop up menu to the menu key?
 

Mashiane

Expert
Licensed User
Longtime User
Hi, I have added a menu to an activity

Activity.AddMenuItem3("", "cmdOpenMenu", LoadBitmap(File.DirAssets, "menu25.png"), True)

On the cmdOpenMenu_Click method, I want to open the popup e.g. like

Sub cmdOpenMenu_Click
men.Show(Sender)
End Sub

but I get an error about [...view.view], anyone has an idea how to raise the popup from a menu button click?
 

corwin42

Expert
Licensed User
Longtime User
Hi, I have added a menu to an activity

Activity.AddMenuItem3("", "cmdOpenMenu", LoadBitmap(File.DirAssets, "menu25.png"), True)

On the cmdOpenMenu_Click method, I want to open the popup e.g. like

Sub cmdOpenMenu_Click
men.Show(Sender)
End Sub

but I get an error about [...view.view], anyone has an idea how to raise the popup from a menu button click?

In this case the Sender is not a View object and can't be used as an anchor for the Popup. You can add a invisible View (Panel, Label etc.) to your layout at the position where you want to open the popup and use this as an anchor.
 

Marcob

Member
Licensed User
Longtime User
Hello, I have found this library quite interesting.

I wonder if anybody knows some trick to close a AHPopupMenu via software.
I mean, after a menu has been shown with the Show(AnchorView) method, I would need a way to programmatically close it using some code inside a timer routine.

Thank you
 

Richard Goh

Active Member
Licensed User
Longtime User
Hello, I have found this library quite interesting.

I wonder if anybody knows some trick to close a AHPopupMenu via software.
I mean, after a menu has been shown with the Show(AnchorView) method, I would need a way to programmatically close it using some code inside a timer routine.

Thank you
set the sticky property of your action items to false
 

Marcob

Member
Licensed User
Longtime User
set the sticky property of your action items to false

What I meant was I need a way to close the menu via software (in other word without tapping the finger on the screen :))
I can only open the menu with Show() but something like Hide() does't exist.
Maybe the reflection library could help here but I would need some hint about it...
 

pesquera

Active Member
Licensed User
Longtime User
Update: It appears the horizontal scroll is not working. Any solution for this? I looked into the xml and there is nothing I can do to correct it.
Hi ScanTech, did you find some solution to this problem?
I know that this library is deprecated.. but, It works very well for me! :)
Thanks!
 

Dave O

Well-Known Member
Licensed User
Longtime User
What I meant was I need a way to close the menu via software (in other word without tapping the finger on the screen :))
I can only open the menu with Show() but something like Hide() does't exist.
Maybe the reflection library could help here but I would need some hint about it...
I swapped out this library for StdActionBarHelper's PopupMenu some time ago, and I'm happy with the switch.

The latter has a Close method which looks like it will do what you want. Worth a try unless you have specific needs that StdActionBarHelper doesn't meet.
 
Top