PopupMenu items textSize

I am using the PopupMenu code authored by EmmanuelPil and would like to display 16-18 items in the PopupMenu list, but can only display 13 lines maximum without scrolling. I have tried changing menuanchor.textSize(12) but this only alters the menu header textsize. I have also tried adding android:textSize=“12sp” or
style name=“PopupMenu” parent="@android:style/Widget.PopupMenu"
item name="android:textSize"12sp /item
/style

to the manifest, but it fails or crashes.

(the “<” etc formatting has been removed as this is ignored by the system, but has been included in the manifest file)

Is it possible to either reduce the item row height and/or the item text size?

Hi, this is actually my Github repository. I believe you can do this without scrolling by using sub-menus, but today I´m quite busy. If sub_menus are an acceptable solution for you, I can look into this tomorrow.

OK. Thank you Noel. I don’t think submenus will be a problem.

It’s not as easy as I expected. Do you really need that amount of menu-items?
Because you can add and remove them in the program flow, using item sets.
If you want I can post a link to a sketch using that method.
Anyway, I will continue to try.

Thank you Noel. I have been using 13 items, but on extending the project I do need the extra menu items. Any info on item sets and how to modify them could be helpful.

Here you have it. I’ve not separated the specific item-set code though. It’s a complete sketch with loading and saving images outside the data folder using listView. If you have any problems in understanding just ask here. (tested with Lollipop and Android 10)
@paturn Edit I was thinking that maybe you can solve a lot using all type of check or edit boxes, radio buttons etc… mounted on Androids AlertDialog. This has the advantage of autosizing. It’s also on my repo.

The sub menu code I had worked only on Kitkat. And it’s not pretty, such an aside placed sum-menu block. But think of it; you can make an item label that changes the whole item set, so that you can have a enormous amount of choices.

Hi Noel

I’ve tried replacing multiple menu items with fewer editboxes, but this creates a fiddly code so I am trying your Mandelbrot example.

When I open it, it tells me that main.pde file
should be in a main folder, not a Mandelbrot folder. I’ve searched the web for examples of main.pde in other projects, but can find none.

Should I rename the folder, or is there a correct solution?

Oh, that’s because you are opening the file in Processing’s IDE, where the main (first) file must have the same name as the folder wherein it resides. Just rename main to mandelbrot, and your good to go.

I have tried running it from a blank mandelbrot.pde but it just gives a blank screen, or from one containing main(); but it is asking for passed parameters of the form String[].

It also tells me that RelativeLayout is unknown (although I know it from activity_main.xml elsewhere) and it doesn’t recognize item_choise (which is declared in onStart.pde in the same folder)

Well, the easiest way would be running it on the APDE app. Just download it on the Play Store and install it within a minute. APDE is a tool that runs Processing for Android within the device itself, and compiles your code in seconds. Or start a new sketch and copy all the code to just one file.

@paturn I just remembered that the code is not adapted for devices with Android version above Lollipop (I just recently bought a new phone with Android 10 installed.)
So I added the necessary permissions code and posted it as an example sketch in one file on my repo here. Do not forget to give the WRITE_EXTERNAL_STORAGE permission!

@noel
It’s working fine in Processing for Android and APDE. Thank you Noel.

I just need to check the item set feature and adapt it for my project. I’ll try the project on APDE to see if it works on that.

@noel I am trying to run my own code in APDE but it is missing (at least) several libraries. I have copied them to [app]/library and dex installed them in [app]/library-dex but it still doesn’t see them.

The examples in APDE don’t use a library.

How should I install them? They are .jar files.

The easiest way is to just copy each complete library folder from your pc into your mobile sketchbook/libraries folder. What libraries are you using? I’m asking because libs in APDE require a dex.jar.

If there’s no folder ‘libraries’ in sketchbook, just create one.

@noel, @paturn,===
As for me (inside theP5 ide, Android mm) the code from @Noel creating a main folder withs all the elements, runs fine; as for the question of submenus i ll give a look at that ASAP

@noel. I don’t have a dex.jar on my computer, only dexlib2-2.2.1.jar. Within APDE I have dex converted a jar file (17KB) to one of the same name (10KB) and saved it in library-dex folder but APDE still doesn’t recognize it.

@akenaton Is that running in Processing or APDE?

I don’t understand what you actually meant here. When I say a dex.jar I mean a specific dex.jar for each library. If you tell me the name of the libraries I can see if they work on with APD and modify them if needed.