Android : how to change typeface of dialogMessage of EditTextPreference in Android?

on Saturday, January 31, 2015


How can I change typeface of dialogMessage of EditTextPreference in Android?


I want to change the default font style of the dialog, but I don't know how do it!


this is my Custom EditTextPreference:



public class MyEditTextPreferences extends EditTextPreference {

public MyEditTextPreferences(Context context) {
super(context);
}


public MyEditTextPreferences(Context context, AttributeSet attrs) {
super(context, attrs);
}


public MyEditTextPreferences(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}


@Override
protected void onBindView(View view) {
super.onBindView(view);
TextView titleView = (TextView) view.findViewById(android.R.id.title);
TextView summaryView = (TextView) view.findViewById(android.R.id.summary);
titleView.setTypeface(G.yekanfont);
summaryView.setTypeface(G.yekanfont);

}
}


and this:



<com.mydomain.mypackagename.MyEditTextPreferences
android:defaultValue="300"
android:dialogMessage="some text"
android:dialogTitle="some other text"
android:inputType="number"
android:key="DURATION_BETWEEN"
android:title="some text"
android:summary="some other text"
/>

0 comments:

Post a Comment