• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Product color list in android kotlin app

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to display a list of product color in my interface as the following image.
The attribute colors of product is a list of string.
Should i use a recyclerview horizontal and an item adapter with cercle shape ?
Capture-du-2019-07-25-08-22-56.png
[Thumbnail for Capture-du-2019-07-25-08-22-56.png]
 
Ranch Foreman
Posts: 376
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on you. You can achieve it by just using LinearLayout too if the number of color button are fixed.
 
Maha Sakka
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i use the adapter, which elemnt should i use an imageview, textview, buttton ...??
 
Randy Tong
Ranch Foreman
Posts: 376
4
Android Tomcat Server Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For me I will use button. Just create a cirular button with a specific color.
 
Maha Sakka
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please i need  your help,
i have a model ProductData which have an attribute colors[String]
in my class adapter, i want to get the array of colors of product.How can i do it ?


 
Randy Tong
Ranch Foreman
Posts: 376
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't store in ArrayList?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!