Some java help here?

Hey guys. Sorry to bother you guys, but is there any way I could make a drop down element in the designer kind of like the one down below in java? I am pretty new to all this java stuff and could really use some help. Thanks.
Dropdown

1 Like

Look for @DesignerProperty in the sources:

I don’t get it. As I said, I am am a beginner and don’t understand most of it. Can any of you create a little snippet of how to do it? Thanks anyway.

It would also be just as helpful for you guys to say what kind of data type it is. Is it a array? Is it a list?

Also see:

Are you specifically looking to make one for Typeface?

No, I want custom items in the list. Sorry. I should of told you that at the beginning. Also what is a “PropertyTypeConstants”?

I don't know how to do this, I've only ever used the built in property types

Just saying, I want operators in the list(+,-,x,Ă·). Thank you for the detailed answer. I am only ten.

1 Like

Good question.
I’m really interested in this now for myself.

Hopefully someone with knowledge of this will respond.

From what I understand, it’s not possible to make custom choice property editors for extensions.

The instructions listed here include changes to source files that won’t be packaged in the extension, hence breaking the property as these files won’t be present in the online App Inventor service.

https://docs.google.com/document/u/0/d/1ukpZXcd0fIn1fV0cNp4J00wrfwwA1daswU1yY6dqqfs/mobilebasic

4 Likes

Thanks for the reply. It’s unfortunate that it is not possible.Thanks. :disappointed_relieved: :disappointed_relieved:

1 Like

my dear friend it is possible with extension.

  @DesignerProperty(editorType = "choices", defaultValue = "", editorArgs = {"", "", "", ""})
  @SimpleProperty(description = "")
  public void YourPropertyName(String propertyVariable) {
       //Write your code.
}
1 Like
@DesignerProperty(editorType = "choices", defaultValue = "", editorArgs = {" +", "-", "*", "/"})
  @SimpleProperty(description = "")
  public void YourPropertyName(String propertyVariable) {
       //Write your code.
}
3 Likes

@Nick Thanks for answering! Just asking, what does the “propertyVariable” contain? Does it contain the option the user chose? Thank you so much!

no no just simple variable when you want to use properly set by user.
for ex.
if user set + in designer property and u want to use this in your code you can use this by propertyVariable .

@DesignerProperty(editorType = "choices", defaultValue = "-", editorArgs = {" +", "-", "*", "/"})
  @SimpleProperty(description = "")
  public void YourPropertyName(String propertyVariable) {
      if(propertyVariable == "+") {
       //some code
     }                                                                               
}
4 Likes

Thank you so much! It worked! Keep up the good work!

You can do almost any design if you use webviewer and develop your drop down menu as a webpage. I did it using animations and adding gif to the drop down menu

mark it as a Sulotion :slight_smile: