MDButton.java 文件源码

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

项目:material-dialogs 作者:
/**
 * 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 (this.stacked != stacked || force) {

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

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

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


问题


面经


文章

微信
公众号

扫码关注公众号