Привет, у меня есть собственный компонент в моем XML, и он имеет статические значения для textHeader, textValue, textStatsCount, textStatsColor
это код XML
<com.my.androproject.customWidget.Textdesigner
android:layout_width="122sp"
android:layout_height="56sp"
android:layout_marginTop="50sp"
android:layout_marginLeft="25sp"
androproject:textHeader="Operations"
androproject:textValue="28"
androproject:textStatsCount="+20"
androproject:textStatsPercent="+40%"
androproject:textStatsColor="#00FF00" />
в классе Textdesigner
public class Textdesigner extends RelativeLayout {
// this constructor call will used when instantiating the object manually (not from a layout XML file).
public Textdesigner (Context context)
{
super(context);
init(context);
}
// this from xml layout
public Textdesigner (Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}
}
Я хочу установить значения для textHeader, textValue, textStatsCount, textStatsColor из кода Java (динамически).Я не знаю, как это сделать ???Пожалуйста, помогите мне ..
Я хочу создать новый компонент с помощью пользовательского класса компонентов Textdesigner ..
может любой помочь мнекак это сделать в коде Java ... любая ссылка или учебник для изучения пользовательских компонентов будет здорово .. Заранее спасибо ..