Back to project page Aviary-Android-SDK.
The source code is released under:
AVIARY API TERMS OF USE Full Legal Agreement The following terms and conditions and the terms and conditions at http://www.aviary.com/terms (collectively, the ?Terms??) govern your use of any and ...
If you think the Android project Aviary-Android-SDK 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.aviary.android.feather.widget; /* w w w . jav a 2 s. co m*/ import android.content.Context; import android.content.res.Resources.Theme; import android.content.res.TypedArray; import android.graphics.Typeface; import android.util.AttributeSet; import android.util.Log; import android.widget.Button; import com.aviary.android.feather.R; import com.aviary.android.feather.utils.TypefaceUtils; public class AviaryButton extends Button { public AviaryButton ( Context context ) { this( context, null ); } public AviaryButton ( Context context, AttributeSet attrs ) { this( context, attrs, R.attr.aviaryPrimaryButtonStyle ); } public AviaryButton ( Context context, AttributeSet attrs, int defStyle ) { super( context, attrs, defStyle ); final Theme theme = context.getTheme(); TypedArray a = theme.obtainStyledAttributes( attrs, R.styleable.AviaryTextView, defStyle, 0 ); String font = a.getString( R.styleable.AviaryTextView_aviary_typeface ); setTypeface( font ); a.recycle(); } public void setTypeface( String name ) { if ( null != name ) { try { Typeface font = TypefaceUtils.createFromAsset( getContext().getAssets(), name ); setTypeface( font ); } catch ( Throwable t ) { } } } @Override public void setTextAppearance( Context context, int resid ) { Log.i( VIEW_LOG_TAG, "setTextAppearance: " + resid ); super.setTextAppearance( context, resid ); } }