Clone Views in Android

374 views Asked by At

I need to define something like view classes at runtime in Android. May an example be a TextView with a defined text size and color (definition is not inside the app, it must be outside). Then I want to instantiate some of those same looking views.

My first idea was using javassist-android, but that seems not to be working for Android views.
My second idea to make an instance of the TextView (with defined text size and color) and clone this instance when I need a TextView. But cloning (instances of) views also doesn't seem to be possible for Android views.
My third idea, inflating views, only works for inflating elements via xml...

Does anyone have an idea how to solve this?

Best regards

0

There are 0 answers