Вот разметка EditText:
Код: Выделить всё
<com.app.ui.MyEditText
android:id="@+id/x1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/edittext_selector"
android:ems="10"
android:gravity="center"
android:imeOptions="actionNext"
android:inputType="numberDecimal"
android:textColor="@android:color/black" />Код: Выделить всё
public class MyEditText extends EditText{
public MyEditText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
public MyEditText(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public MyEditText(Context context) {
super(context);
init();
}
private void init() {
if (!isInEditMode()) {
Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "fonts/PT_Sans-Caption-Web-Regular.ttf");
setTypeface(tf);
}
}
}