gouravkhunger / AccoLib

Amazing and easy to use Accordion Library for Android built with kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow setting title and text programmatically

emleonstz opened this issue · comments

please add method for programmatically setting text when looping it like
accordion.setTitle("Hello");
accordion.setText("World");

Hi @emleonstz, the latest release v1.1.2 of the library allows you to access these properties on runtime. Please update to the latest version and let me know if this solves your use case.

Here is an example from the demo app:

val accordion: Accordion = findViewById(R.id.dynamic_accordion)
accordion.title = "Dynamic"
accordion.text = "This text is rendered dynamically."
accordion.titleColor = ContextCompat.getColor(this, android.R.color.holo_orange_dark)
accordion.textColor = ContextCompat.getColor(this, android.R.color.holo_blue_dark)
accordion.titleSize = 24.toFloat()
accordion.textSize = 14.toFloat()