AHQuickAction library - Nice looking popup menus

bluedude

Well-Known Member
Licensed User
Longtime User

Attachments

  • Screenshot_2012-02-28-16-24-21[1].jpg
    Screenshot_2012-02-28-16-24-21[1].jpg
    7.3 KB · Views: 653

latcc

Banned
You should press on Tools - Clean project. This deletes an automatically generated file and forces the compiler to recreate it.
When i choose Tools/Clean Project and then copy the 'res' folder into my object folder, it still gives an error that I need to declare the resources.

So this lovely library is not usable for me.
 

corwin42

Expert
Licensed User
Longtime User
When i choose Tools/Clean Project and then copy the 'res' folder into my object folder, it still gives an error that I need to declare the resources.

So this lovely library is not usable for me.

Read the instructions carefully:

Copy the whole "res" directory structure to the "Objects" directory of your B4A project and VERY IMPORTANT: make them READ ONLY! Otherwise B4A will delete them when compiling.

You have to make the files read only.
 

corwin42

Expert
Licensed User
Longtime User
Do you know how to solve this?

http://www.b4x.com/forum/additional...ary-nice-looking-popup-menus-5.html#post87419

Centered would be better or even better width filled. See the gap on the screenshot for a Galaxy nexus.

I have no idea why there is this strange gap on the galaxy nexus. I have tried with 7" and 10" resolutions in the emulator. They all show the popup in the full screen width. Just the GN resolution has the problem.

I have started an issue on the github repository for the original library. Perhaps they will find out what happens here.
 

latcc

Banned
Read the instructions carefully: You have to make the files read only.
Yes, thanks...

I did that by setting the properties of 'res' and its included files/folders to read-only.

But strangely, although Windows 7 reported the res folder tree as read-only, the files/folders within it were actually NOT set as read-only. I had to go inside the res folder and repeat the procedure to get it to genuinely set the files as read-only

So it might be a file properties setting issue with windows 7. (Will test this on Winxp.)
 

mkvidyashankar

Active Member
Licensed User
Longtime User
out of bound exception error

I am trying to add items dynamically to ActionItems menu
It is working fine for the first time, if i call sub secondtime it is giving error
java.lang.IndexOutOfBoundsException: index=6 count=0
in line menu_listalbums.addActionItem(album1)

There are 5 items ( 0 to 5) in dirlist

where i am erring pl help

B4X:
Sub Button_changealbum_Click
   Dim jj As Int 
   Dim album1 As AHActionItem
   Dim bd As BitmapDrawable
   dirlist.Initialize
   alllist.Initialize
   
   ' alllist.Clear
   ' dirlist.Clear
   
    
    alllist=File.ListFiles(File.DirRootExternal & "/CameraGPX/")
    For jfile=0 To alllist.Size-1
       If File.IsDirectory(File.DirRootExternal & "/CameraGPX/",alllist.Get(jfile)) Then
         dirlist.Add(alllist.get(jfile))
      End If
    Next
    dirlist.Sort(True)
    'menu_listalbums
    menu_listalbums.Initialize("menu_listalbums",menu_listalbums.VERTICAL)
    
        
    
    For jj= 0 To dirlist.Size-1
         bd.Initialize(LoadBitmap(File.DirAssets, "bullet.png"))
         album1.Initialize(jj, dirlist.Get(jj), bd)
         album1.selected = True
         album1.Sticky = False
          menu_listalbums.addActionItem(album1)
    Next
      menu_listalbums.show(button_changealbum)
End Sub
 

bluedude

Well-Known Member
Licensed User
Longtime User
Permissions to use libraries

Hi,

I have sent you a private message for the use of your libraries.

Cheers,
 

corwin42

Expert
Licensed User
Longtime User
@Vidyashankar:

Thats a common mistake many developers do.

First: Just calling Initialize for a QuickAction does not clear the actions. You have to Dim it again.

Next ist that your have to put the "Dim album1 As AHActionItem" into the for loop. Otherwise you are adding the same item again and again. With Dim you create a new object. With Initialize you initialize the same object again.
 

mitsusdev

Member
Licensed User
Longtime User
A better solution using Reflection library:
B4X:
Sub ListView1_ItemClick (Position As Int, Value As Object)
   ac1.Show(GetViewAtPos(Sender, Position))
End Sub

Sub GetViewAtPos(LV As ListView, Position As Int) As View
   Dim r As Reflector
   Dim v As View
   r.Target = LV
   Dim first As Int
   first = r.RunMethod("getFirstVisiblePosition")
   v = r.RunMethod2("getChildAt", Position - first, "java.lang.int")
   Return v
End Sub

Hi Erel,
i've a question.

i've tryed to use AHQuickAction inside CustonScrollView example. I want (for each item of ScrollView) when i open the QuickAction, print at screen (Es. using ToastMessage) the row that i've clicked and the ItemID of AHQuickAction.

Is it possible?

Below my code:
B4X:
Sub AC_Click (Position As Int, ActionItemID As Int)
   Dim action As AHActionItem

   action = ac1.getActionItem(Position)
   ToastMessageShow(action.Title & " pressed" & ActionItemID, False)
End Sub

'Event Sub when popup window is just dismissed
Sub AC_Dismiss
   ToastMessageShow("Dismissed", False)
End Sub

Sub View_Click
   Dim Send As View
   Dim row, Obj As Int
   Send=Sender
   
   row=Floor(Send.Tag/10)
   Obj=Send.Tag-row*10
   Select Obj
   Case 0
      Activity.Title="Row = "&row&"  Panel"
      
   Case 1,2,3,4,5
      Activity.Title="Row = "&row&"  Label = "&Obj
   Case 6
      Activity.Title="Row = "&row&"  Image"
      ac1.show(Send)

   End Select   
End Sub

I'm able to show ac1 on correct position, but i'm not able to show row into AC_Click event or into View_Click event.

Regards
 

moster67

Expert
Licensed User
Longtime User
@Markus/bluedude

Were you able to fix the gap, perhaps by centering it?

On a 10-inch tablet (both in portrait and landscape), the gap is more noticeable and it looks a bit strange.

Markus, this is a super add-on. I love it! Thank you so much


Do you know how to solve this?

http://www.b4x.com/forum/additional...ary-nice-looking-popup-menus-5.html#post87419

Centered would be better or even better width filled. See the gap on the screenshot for a Galaxy nexus.

Cheers,

10631d1330442753-ahquickaction-library-nice-looking-popup-menus-screenshot_2012-02-28-16-24-21-1-.jpg
 

corwin42

Expert
Licensed User
Longtime User
I'm able to show ac1 on correct position, but i'm not able to show row into AC_Click event or into View_Click event.

I think the easiest way would be to store the row in a global variable and then you have access to it in AC_Click event.

@Markus/bluedude

Were you able to fix the gap, perhaps by centering it?

Sorry, no. I talked with the author of the original QuickAction library and we both have no idea why this happens.
 

moster67

Expert
Licensed User
Longtime User
Yes, I have seen others too with same problem although for instance Tapatalk handles it correctly.

I just saw Markus' reply so I guess for now that is the way it is gonna be :)

Hey moster67, I think that's the way it is, I've seen some other apps with the same "problem", and I mean non-B4A apps.
 

moster67

Expert
Licensed User
Longtime User
Another thing:

I would like to change the background color of the quickaction (where you put text and images). I wanted to change it from white into a greenish color maintaining the black text-color.

I think the image is "ahqa_textfield_default.9.png" found in the following folders "drawable-hdpi" and "drawable-mdpi". I made a copy of the file, changed the color and replaced the original one with my new one. Then I set it as Read-only. I compiled and got no errors but the image is still white so it didn't work :BangHead:

Maybe it is the wrong procedure? Perhaps the color is being set using the xml-files? Or maybe I edited the wrong file?

:sign0163:
 

moster67

Expert
Licensed User
Longtime User
I noted a small graphic-glitch.

My QuickAction-menu (Tapatalk-style) is composed of 3 buttons (using only text-mode) and very often the third and last button on the right just after the click has taken place becomes transparent (and you can see the background) before executing the click-event?

Is this only happening to me? Is there any workaround to fix this problem?
 

barx

Well-Known Member
Licensed User
Longtime User
Quick query that would make me very happy if sorted.

I add a menu to my app and show it with following code:
B4X:
Sub btnConfig_Click
   ActionMenu.show(btnConfig)
End Sub

On a phone this looks awesome and the view is anchored fine

QuickActionPhone.jpg

But on a tablet the same app / code looks bad, the menu pops up to the far left of screen and so doesn't reach the view to anchor.

QuickActionTablet.jpg

Is there any way to sot this. Would think it would be a xml edit, but a pointer in the right direction?

Thanks
 

barx

Well-Known Member
Licensed User
Longtime User
OK, here is a little teaser on a possible fix. This is the same tablet as above. A little more tweaking and testing and it should be there.

fix.jpg
 
Top