AlertDialogPro icon indicating copy to clipboard operation
AlertDialogPro copied to clipboard

Changing texts' typeface

Open bluemix opened this issue 10 years ago • 3 comments

I am wondering if there is a way to change the typefaces of all the texts that appear in the dialogs. Thanks in advance.

bluemix avatar Dec 15 '15 11:12 bluemix

For now, there isn't a simple API to approach this if the typeface you want to set isn't the android's built-in typeface.

But your can implement your own dialog layout (You can copy and modify based on this file: https://github.com/fengdai/AlertDialogPro/blob/master/alertdialogpro-theme-material/src/main/res/layout/adp_alert_dialog_material.xml). And replace all TextView/Button to CustomTextView/CustomButton which use your typeface (http://stackoverflow.com/questions/29497464/best-way-to-assign-font-typeface-to-textview). Then apply the layout to AlertDialogPro with adpLayout attribute.

<item name="adpLayout">@layout/your_alert_dialog_layout</item>

fengdai avatar Dec 15 '15 12:12 fengdai

ah, I see now :+1: thanks a lot @fengdai for your quick reply.

bluemix avatar Dec 15 '15 12:12 bluemix

You're welcome.

fengdai avatar Dec 15 '15 12:12 fengdai