Hey Guys I wanna Create Something like this in Recycler View
I already has a class named HomeStep
data class HomeStep(
val icon: Int,
val circle: Int,
val textName: String)
I already store icon (Green One) and circle as integer Array in string.xml
<integer-array name="icon_drawble">
<item>@drawable/icon_1</item>
<item>@drawable/icon_2</item>
<item>@drawable/icon_3</item>
<item>@drawable/icon_4</item>
</integer-array>
<integer-array name="circle_drawble">
<item>@drawable/circle_1</item>
<item>@drawable/circle_2</item>
<item>@drawable/circle_3</item>
<item>@drawable/circle_4</item>
</integer-array>
I have already stored icon and circle as string Array in string.xml also
<string-array name="list_step">
<item>@string/step_1_text</item>
<item>@string/step_2_text</item>
<item>@string/step_3_text</item>
<item>@string/step_4_text</item>
</string-array>
Is it possible to add my Integer-array and string-array in Collection ?
val listHomeStep = ArrayList<HomeStep>()
val layoutManager = LinearLayoutManager(context, RecyclerView.VERTICAL, false)
val adapter = HomeStepAdapter()
var icon: Int
var circle: Int
var textName: String
var i = 0
while (i < listHomeStep.size) {
icon = resources.getIntArray(R.array.icon_drawble)[i]
circle = resources.getIntArray(R.array.circle_drawable)[i]
textName = resources.getStringArray(R.array.list_step)[i]
i++
}
listHomeStep.addAll(icon, circle, textName)
adapter.setDataList(listHomeStep)