Skip to content

Hybrid List #111

Closed
Closed

Description

@Al4He6

V033
Hybrid List setting actionTextColor to textPrimary or textSecondary gives error
(for icon and avatar)
Failed prop type ...

var main,lst,list, lay2
export class Main extends App {
        onStart() {
            main = ui.addLayout( "main", "Linear", "left,Top", 1, 1 )
            list = [
                [ "favorite", "Title", "Text" , "more" ],
                [ "favorite", "Javascript", "This is a sample body text." , "add" ],
                [ "person", "Java", "This is a sample body text." , "cake" ],
                [ "settings", "Python", "This is a sample body text." , "flag"],
                [ "menu", "Menu", "text" , "euro_symbol"],
                [ "directions", "Title2", "text2" , "hourglass_full"]
            ]
           lst = ui.addList( main, list, "Icon", 0.8 )
           lst.actionIconColor = "textPrimary" 
           lst.bodyTextColor = "textPrimary"
           lst.checkboxColor = "textSecondary" 
           lst.iconColor = "action"
           lst.textColor = "primary"
           lst.titleTextColor = "textSecondary"       
           lst.setItemPadding(0,0,0,0)
 
           lay2 = ui.addLayout(main,"Linear","top,left,scrolly",0.95,0.55)
 
            bt('lst.actionTextColor = "textPrimary" //failed prop type')
            bt('lst.actionTextColor = "textSecondary"//failed prop type')
            bt('lst.setList(list)')
            bt('alert(lst.popItem())')
            bt('alert(lst.shiftItem())')
            bt('alert(lst.getItemByIndex(2))')
            bt('alert(lst.getItem("Menu"))')            
            bt('lst.setItem("Javascript","sI Title","sI Text","image","info")')
            bt('lst.setItemByIndex(2,"sIBI Title","sIBI Text","folder" , "filter_1")')

            bt('lst.setTitleTextByIndex(3,"setTitleTextByIndex")')
            bt('lst.setBodyTextByIndex(3,"setBodyTextByIndex")')
            bt('lst.setIconByIndex(3,"person")')
            bt('lst.setActionIconByIndex(3,"filter_3")')

            bt('lst.setTitleText("Title","setTitleText")')
            bt('lst.setBodyText("Title","setBodyText")')
            bt('lst.setIcon("Title","help")')
            bt('lst.setActionIcon("Title","filter_4")')
            
            bt('lst.addItem("addItemTitle","addItem text","more",1)')
            bt('lst.setSelectable(true)')
            
            lst.setOnTouch(function (a,b,c,d,e,f) {
                    alert ("TOUCH\n"+a+"\n"+b+"\n"+c+"\n"+d+"\n"+e+"\n"+JSON.stringify(f))
            })
            lst.setOnLongTouch(function (a,b,c,d,e,f) {
                    alert ("LONG TOUCH\n"+a+"\n"+b+"\n"+c+"\n"+d+"\n"+e+"\n"+JSON.stringify(f))
            })
            lst.setOnAction(function (icon,index) {
                    alert ("ACTION\n"+icon+"\n"+index)
            })
            lst.setOnSelect(function (a,b,c) {
                    alert ("SELECT\n"+a+"\n"+b+"\n"+c)
                    alert(this.getSelectedItems())
                    alert(this.getSelectedTitles())
            })
        } // onstart
 } // class
 function bt (str) {
   var temp = ui.addText(lay2,str,"keepcase,medium") 
   temp.setMargins(2,2,0,0,"px")
   temp.setPadding(0,0,0,0)
   temp.backColor="cyan"
   temp.setOnTouch(touched)
 }
 function touched() {
   eval(this.text)
 }

Activity

  1. enjine-io commented on Oct 9, 2026

    @enjine-io
    Collaborator

    Thanks, this is now Fixed in 2.81

    lst.actionTextColor = "textPrimary" or "textSecondary" no longer gives a "Failed prop type" error on Icon and Avatar lists. The action icons take the same text colours as text actions do (and follow the dark theme).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions