# PopupMenu items textSize

**URL:** <https://discourse.processing.org/t/popupmenu-items-textsize/26111>\
**Category:** Processing for Android\
**Created:** [December 10, 2020, 12:36pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111 "2020-12-10T12:36:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [December 10, 2020, 12:36pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/1 "2020-12-10T12:36:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 10, 2020, 12:49pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/2 "2020-12-10T12:49:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [December 10, 2020, 1:23pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/3 "2020-12-10T13:23:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 11, 2020, 1:10pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/4 "2020-12-11T13:10:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [December 11, 2020, 1:51pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/5 "2020-12-11T13:51:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 11, 2020, 2:39pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/6 "2020-12-11T14:39:27Z")

</div>

[Here you have it](https://drive.google.com/file/d/1z_1jpjmyaxlr_okYRMTt8RaD3Ringw34/view?usp=sharing). 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](https://github.com/EmmanuelPil/Android-java-code-utilities-widgets-for-Processing-for-Android).

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 11, 2020, 3:12pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/7 "2020-12-11T15:12:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [December 13, 2020, 9:55am UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/8 "2020-12-13T09:55:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 13, 2020, 10:10am UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/9 "2020-12-13T10:10:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [December 13, 2020, 10:22am UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/10 "2020-12-13T10:22:56Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 13, 2020, 10:31am UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/11 "2020-12-13T10:31:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 13, 2020, 11:41am UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/12 "2020-12-13T11:41:04Z")

</div>

@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.](https://github.com/EmmanuelPil/Android-java-code-utilities-widgets-for-Processing-for-Android/blob/master/mandelbrot.pde) Do not forget to give the WRITE\_EXTERNAL\_STORAGE permission!

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [December 13, 2020, 12:02pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/13 "2020-12-13T12:02:00Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [December 13, 2020, 2:23pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/14 "2020-12-13T14:23:25Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 13, 2020, 3:01pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/15 "2020-12-13T15:01:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 13, 2020, 3:07pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/16 "2020-12-13T15:07:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [December 13, 2020, 4:33pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/17 "2020-12-13T16:33:52Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [December 13, 2020, 5:14pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/18 "2020-12-13T17:14:31Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![paturn](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@paturn](https://discourse.processing.org/u/paturn)\
**Post date:** [December 13, 2020, 6:17pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/19 "2020-12-13T18:17:47Z")

</div>

@akenaton Is that running in Processing or APDE?

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 13, 2020, 7:00pm UTC](https://discourse.processing.org/t/popupmenu-items-textsize/26111/20 "2020-12-13T19:00:17Z")

</div>

> [@noel](#):
>
> What libraries are you using?

> [@paturn](#):
>
> Within APDE I have dex converted a jar file (17KB) to one of the same name (10KB)

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.

[Next page](https://discourse.processing.org/t/popupmenu-items-textsize/26111.md?page=2)
