Back to project page ExampleApp.
The source code is released under:
Copyright (c) 2014, Altinn All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redis...
If you think the Android project ExampleApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.altinn.apps.fisher.ui.component; /**/*from www .jav a 2 s.c om*/ * This class is used to support Custom font in AutoCompleteTextView */ import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.widget.AutoCompleteTextView; import com.altinn.apps.fisher.CacheManager; import com.altinn.apps.fisher.R; public class RAutoCompleteTextView extends AutoCompleteTextView { public RAutoCompleteTextView(Context context) { super(context); } public RAutoCompleteTextView(Context context, AttributeSet attrs) { super(context, attrs); parseAttributes(context,attrs); } public RAutoCompleteTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); parseAttributes(context,attrs); } /** * This method loads appropriate font and set it * @param context * @param attrs */ private void parseAttributes(Context context, AttributeSet attrs) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RAutoCompleteTextView); int typefaceValue = values.getInt(R.styleable.RAutoCompleteTextView_typeface, 0); values.recycle(); setTypeface(CacheManager.getInstance().getTypeFace(typefaceValue)); } }