AHQuickAction library - Nice looking popup menus

Smee

Well-Known Member
Licensed User
Longtime User
I am trying to create a menu programmatically. It works but i am unable to clear items that have been added previously. Is there a way to do this?
 

Smee

Well-Known Member
Licensed User
Longtime User
Thanks Marcus,

So how do you destroy it and recreate from Code? I tried initialising in a sub routine instead of Activity_Create but that does not seem to work. I wopuld rather use this menu instead of a list box because there are only going to be 3 or four items at any time and it looks so much more professional

TIA

Joe
 

William Hunter

Active Member
Licensed User
Longtime User
Popup problem with showing

I have a similar problem to Smee. These popup menus are a joy to behold. I’ve worked for hours to find a way to initialize a popup menu programmatically, without the anchor button, and I’ve concluded that it’s not possible. I don’t have the knowledge to work at the level of the author, so my comments are not meant as undue criticism. I think that there must be an inbuilt weakness in Android that forces limitations to this library. If only it were not so.
 

Smee

Well-Known Member
Licensed User
Longtime User
I have a similar problem to Smee. These popup menus are a joy to behold. I’ve worked for hours to find a way to initialize a popup menu programmatically, without the anchor button, and I’ve concluded that it’s not possible. I don’t have the knowledge to work at the level of the author, so my comments are not meant as undue criticism. I think that there must be an inbuilt weakness in Android that forces limitations to this library. If only it were not so.


But how would you position without an anchor point or call it? It does not need to be a button. I have anchored to a label so it could be called from code by pressing somewhere else.

Cheers
 

bluedude

Well-Known Member
Licensed User
Longtime User
Different font size

Hi,

I noticed that the font size is pretty small on many devices, can it be changed?

Cheers,
 

William Hunter

Active Member
Licensed User
Longtime User
AHQuickAction library

But how would you position without an anchor point or call it? It does not need to be a button. I have anchored to a label so it could be called from code by pressing somewhere else.

Cheers
Thank you for the additional info. We all have something on our wish list, and mine is a floating toolbar that can be called from code. I was surprised to find there is no native toolbar in Android. Android devices have relatively small screens and I hate to give up screen real estate unnecessarily. I try to keep the clutter down to a minimum.
 

bluedude

Well-Known Member
Licensed User
Longtime User
Different resolutions

Hi,

I noticed on my Galaxy Nexus that there is a gap on the right side when using quickaction. So the horizontal quick action bar does not fill the whole space and that looks a little weird.

A solution would be to display it centered (that would look nicer). On smaller screens it is fine.
 

corwin42

Expert
Licensed User
Longtime User
So how do you destroy it and recreate from Code? I tried initialising in a sub routine instead of Activity_Create but that does not seem to work. I wopuld rather use this menu instead of a list box because there are only going to be 3 or four items at any time and it looks so much more professional

Should be possible with Dimming the object again.
 

Smee

Well-Known Member
Licensed User
Longtime User
Should be possible with Dimming the object again.

i tried that but i get an error at the line QAMenu2.addActionItem(ai)

B4X:
Dim QAMenu2 As AHQuickAction3D ' Redim to clear
For i = 1 To 3
   Dim ai As AHActionItem
   Dim bd As BitmapDrawable
   Dim Filename, Text As String

   Select i
   Case 1         
      Text = "Product Code " & i
   Case 2         
      Text = "Product Code " & i
   Case 3         
      Text = "Product Code " & i
   End Select
      
   ai.Initialize(i, Text, Null)
   ai.Selected = True
   
   QAMenu2.addActionItem(ai)
Next

this is the error

java.lang.NullPointerException

UPDATE:

OK Got it sorted
adding this line QAMenu2.Initialize("QAMenu2", QAMenu2.VERTICAL)
after the Dim statement and it works.
Now for the font size
 
Last edited:

Smee

Well-Known Member
Licensed User
Longtime User
Hi,

I noticed that the font size is pretty small on many devices, can it be changed?

Cheers,

I found that too. I am using a tablet and the font size is too small

i tried editing the file ahqa_action_item.xml and changed the font size from 12sp to 24sp but it made no difference
 

corwin42

Expert
Licensed User
Longtime User
i tried editing the file ahqa_action_item.xml and changed the font size from 12sp to 24sp but it made no difference

You have to edit ahqa_action_item_vertical.xml and add a android:textSize property to the TextView.
 

Smee

Well-Known Member
Licensed User
Longtime User
Thank you Marcus. That does the trick. Now for the padding

For any one else's benefit I tried using the "sp" units but it made no difference to my font size so i switched to "pt" and it works great.

Looking better and better everyday.

A big Thanks to all library writers that are making this software something spectacular

Joe
 

Smee

Well-Known Member
Licensed User
Longtime User
I am trying to increase the space between items. I have used padding at the top only, bottom only and top and bottom

B4X:
     android:paddingTop="10dip"
     android:paddingBottom="10dip"

Unfortunately it either hides the text or makes it unreadable. Any ideas on how to fix this one?

The file i am editing is ahqa_action_item_vertical.xml

TIA

Joe
 

corwin42

Expert
Licensed User
Longtime User
You should add the padding to the LinearLayout, not the TextView:

B4X:
<LinearLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="horizontal"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:paddingTop="15dp"
   android:paddingBottom="15dp"
   android:clickable="true"
   android:focusable="true"
   android:background="@drawable/ahqa_action_item_btn">
           
   <ImageView
      android:id="@+id/iv_icon" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"/>

   <TextView 
      android:id="@+id/tv_title"
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:gravity="center_vertical"
      android:paddingLeft="5dip"
      android:paddingRight="10dip"
      android:textSize="24sp"
      android:text="Chart"
      android:textColor="#fff"/>
                                    
</LinearLayout>

Don't forget to "Clean project" every time you make changes to a resource file.
 

Attachments

  • screenshot-1330414487747.jpg
    screenshot-1330414487747.jpg
    10.4 KB · Views: 454

Smee

Well-Known Member
Licensed User
Longtime User
Marcus,

Truly Excellent now. Thank you so much for this, it really adds to the professional look of the product.
 

bluedude

Well-Known Member
Licensed User
Longtime User
Full UI based on Quickaction, Actionbar.

Hi,

Just wanted to share a screenshot of a full UI that features:

- actionbar;
- quickaction;
- pager.

It still has some bugs but it works pretty nice on several phones. One bug is in the pager library, for some reason while swiping, the pagerTabs texts don't change color on my galaxy Nexus. On the Nexus one it works.

I can say for the first time that will all the UI libraries I can create a professional app. Before it wasn't really possible and good looking.

Cheers.
 

Attachments

  • Screenshot_2012-02-28-10-48-50[1].jpg
    Screenshot_2012-02-28-10-48-50[1].jpg
    9.1 KB · Views: 529

Smee

Well-Known Member
Licensed User
Longtime User
yes these libraries really enhance a great product
 

corwin42

Expert
Licensed User
Longtime User
Just wanted to share a screenshot of a full UI that features:

- actionbar;
- quickaction;
- pager.

Thanks for sharing. Nice to see that it works in real life apps. :)
 

bluedude

Well-Known Member
Licensed User
Longtime User
Indeed

Yeah, although it was a lot of work to get everything really looking nice on all types of phones (no tablets).

The swiping interface comes natural to most people (even babies) so I want to use it more. This "template" application features almost all that is needed to create a great app.:

-fluid UI;
-location manager for GPS and CellID;
-backend API's and calling these api's in a secure manner through JSON;
-scaling;
- local encrypted caching;
- qr scanning and handling;
-NFC handling;
-Sharing;
-state management;
-preferences;
-backend CMS (POI management);

and lots more.

This wasn't possible with the stuff you wrote.
This is my mobile framework to create all apps on.
 
Top