MDButton.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:EasyFrame 作者:
/**
 * Set if the button should be displayed in stacked mode.
 * This should only be called from MDRootLayout's onMeasure, and we must be measured
 * after calling this.
 */
/* package */ void setStacked(boolean stacked, boolean force) {
    if (mStacked != stacked || force) {

        setGravity(stacked ? (Gravity.CENTER_VERTICAL | mStackedGravity.getGravityInt()) : Gravity.CENTER);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            //noinspection ResourceType
            setTextAlignment(stacked ? mStackedGravity.getTextAlignment() : TEXT_ALIGNMENT_CENTER);
        }

        DialogUtils.setBackgroundCompat(this, stacked ? mStackedBackground : mDefaultBackground);
        if (stacked) {
            setPadding(mStackedEndPadding, getPaddingTop(), mStackedEndPadding, getPaddingBottom());
        } /* Else the padding was properly reset by the drawable */

        mStacked = stacked;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号