Android Open Source - AlertDialogPro Button Compat






From Project

Back to project page AlertDialogPro.

License

The source code is released under:

Apache License

If you think the Android project AlertDialogPro listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.alertdialogpro.material;
// w  w  w .  ja  va2 s . com
import android.content.Context;
import android.content.res.TypedArray;
import android.support.v7.internal.text.AllCapsTransformationMethod;
import android.util.AttributeSet;
import android.widget.Button;

/**
 * Introduce "textAllCaps" to Button for platform below API-14.
 */
public class ButtonCompat extends Button {
    public ButtonCompat(Context context) {
        this(context, null);
    }

    public ButtonCompat(Context context, AttributeSet attrs) {
        this(context, attrs, android.R.attr.buttonStyle);
    }

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

        TypedArray style = context
                .obtainStyledAttributes(attrs, R.styleable.CompatTextView, defStyle, 0);
        boolean allCaps = style.getBoolean(R.styleable.CompatTextView_textAllCaps, false);
        style.recycle();

        if (allCaps) {
            setTransformationMethod(new AllCapsTransformationMethod(context));
        }
    }
}




Java Source Code List

com.alertdialogpro.AlertDialogPro.java
com.alertdialogpro.ProgressDialogPro.java
com.alertdialogpro.demo.MainActivity.java
com.alertdialogpro.holo.internal.NoTintCheckedTextView.java
com.alertdialogpro.internal.AlertController.java
com.alertdialogpro.internal.DialogTitle.java
com.alertdialogpro.material.ButtonCompat.java
com.alertdialogpro.material.CheckedTextViewCompat.java
com.alertdialogpro.material.ProgressBarCompat.java
com.alertdialogpro.material.drawable.CircularAnimatedDrawable.java