Hi i want to create a viewpager so i follow this tutorial : https://blog.mindorks.com/android-viewpager-in-kotlin. But when i try to set up the array of color in res.colors :
<array name=”bg_color”>
<item name=”bg_screen1">#f64c73</item>
<item name=”bg_screen2">#20d2bb</item>
<item name=”bg_screen3">#3395ff</item>
<item name=”bg_screen4">#c873f4</item>
</array>
This doesn't compile, i got Attribute value expected on = of the first line. And i got type attribute should be define on all other lines. I assume that i should define a type of the array, but which type should i use for colors? and how to declare it ?
EDIT
To use it you have to declare and IntArray then select the good position :
val bg_color = resources.getIntArray(R.array.bg_color)
webView.setBackgroundColor(bg_color[pos])
Exemple for a web view where pos is an int