[LAMW]- change the background JsRecyclerView item lazarus / 43-Android ---------------------------------------------------------------------- juank1971 · 2020-11-27 14:52 Hi. I need to change the background color of an item in a JsRecyclerView I try setItemBackgroundColor but I couldn't, it didn't work ---------------------------------------------------------------------- juank1971 · 2020-11-28 01:34 Or other option is try to configure one example to the jsRecyclerView with the cfPanel itemcontent Because the AppCompactRecyclerViewDemo1 no show how use this content cfPanel Y try bat i have some errors. I try use cfPanel to bacground the item and change color. To this widget. Any idea ---------------------------------------------------------------------- juank1971 · 2020-11-28 02:14 I try to see the code in the jsRecyclerView.java In the setItemBackgroundColor procedure Bat I do not understand the the way to pass the color parameters and I don't understand what the parametr int round means. Is this:    public void SetItemBackgroundColor( int position, int color, int round ){        int countpanel = itemList.get(position).countpanel;            if( countpanel > 0 )           itemList.get(position).panel[0] = Integer.toString(color)+"@"+Integer.toString(round);                  } ---------------------------------------------------------------------- jmpessoa · 2020-12-01 00:47 Hi,  @ADiV !! Can you help here? What about a simple demo? ---------------------------------------------------------------------- ADiV · 2020-12-01 17:22 Quote from: jmpessoa on December 01, 2020, 01:47:19 am Hi,  @ADiV !! Can you help here? What about a simple demo? First you must create a "Panel" object that encompasses all the objects of the "ReciclerView". This is the one that will change the background color, see this code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);begin  //jsRecyclerView1.SetClipToPadding(False);  jsRecyclerView1.SetItemContentLayout(jPanel1.View,  True {cardview}); //custom item view!   //jsRecyclerView1.SetItemContentDelimiter('|');    //default   //the sequence maps the order of the content added on  "jsRecyclerView1.Add(....)"  //jsRecyclerView1.SetItemContentFormat(' IMAGE|TEXT|TEXT|CHECK|RATING|SWITCH');   //or  jsRecyclerView1.ClearItemContentFormat; // Need for reinit activity  jsRecyclerView1.AddItemContentFormat(cfPanel);  jsRecyclerView1.AddItemContentFormat(cfImage);  jsRecyclerView1.AddItemContentFormat(cfText);   // one text  jsRecyclerView1.AddItemContentFormat(cfText);   // another text  jsRecyclerView1.AddItemContentFormat(cfCheck);  jsRecyclerView1.AddItemContentFormat(cfRating);  jsRecyclerView1.AddItemContentFormat(cfSwitch);  jsRecyclerView1.SetItemContentFormat();   jsRecyclerView1.Add( intToStr(GetARGBJava(Fcustomcolor, colbrWhite)) + '@20|don_quixote@drawable|Do you see friend Sancho...|thirty or forty hulking giants?|OK@0|2.5|ON:OFF@0');  jsRecyclerView1.Add( intToStr(GetARGBJava(Fcustomcolor, colbrWhite)) + '@20|lance.png@assets|Take care...|there are not giants but windmills...|OK@0|3.5|Sound@0');   (*Notes:   .Image source [possibility] example:         lance.png@assets            <---- project folder  "assets"        ic_launcher@drawable      <---- project folder  "res/drawable" dont use the file extension!!!        url@http://icons.iconarchive.com/icons/alecive/flatwoken/128/Apps- Google-Chrome-App-List-icon.png    <-- get from url/location        picture21.png@download         <----- device folder download [need run time permission!]        image007.png@sdcard            <----- device sdcard [need run time permission!]    .Check: OK@1 --> set caption=OK  and:  1=checked, 0=unchecked      --initial state   .Rating: 2.5 --> stars settings     --initial state   .Switch: OFF:ON@0 --> set slide text ("OFF" or "ON" by state) and:  0=unchecked/Off  --initial state   .Switch: Sound@1 --> set caption=Sound  and: 1=checked/On    --initial state  *) end; And to change the color just do this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   jsRecyclerView1.SetItemBackgroundColor(itemPosition, colbrRed, 20);  jsRecyclerView1.Refresh(itemPosition);  I use the same thing in my app "Listacom": https://play.google.com/store/apps/details?id=tr3e.MarkListFree to select a list if you long click on an item. ---------------------------------------------------------------------- juank1971 · 2020-12-01 20:15 ok thank you very much I will try it, ---------------------------------------------------------------------- juank1971 · 2020-12-02 02:08 beautiful, the result  , works perfect. thanks .