当前位置: 首页>>代码示例>>Java>>正文


Java GravityEnum.END属性代码示例

本文整理汇总了Java中com.afollestad.materialdialogs.GravityEnum.END属性的典型用法代码示例。如果您正苦于以下问题:Java GravityEnum.END属性的具体用法?Java GravityEnum.END怎么用?Java GravityEnum.END使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.afollestad.materialdialogs.GravityEnum的用法示例。


在下文中一共展示了GravityEnum.END属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resolveGravityEnum

public static GravityEnum resolveGravityEnum(Context context,
                                             @AttrRes int attr,
                                             GravityEnum defaultGravity) {
    TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{attr});
    try {
        switch (a.getInt(0, gravityEnumToAttrInt(defaultGravity))) {
            case 1:
                return GravityEnum.CENTER;
            case 2:
                return GravityEnum.END;
            default:
                return GravityEnum.START;
        }
    } finally {
        a.recycle();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:DialogUtils.java

示例2: invertGravityIfNecessary

private void invertGravityIfNecessary() {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
    return;
  }
  Configuration config = getResources().getConfiguration();
  if (config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
    switch (buttonGravity) {
      case START:
        buttonGravity = GravityEnum.END;
        break;
      case END:
        buttonGravity = GravityEnum.START;
        break;
    }
  }
}
 
开发者ID:afollestad,项目名称:material-dialogs,代码行数:16,代码来源:MDRootLayout.java

示例3: resolveGravityEnum

public static GravityEnum resolveGravityEnum(
    Context context, @AttrRes int attr, GravityEnum defaultGravity) {
  TypedArray a = context.getTheme().obtainStyledAttributes(new int[] {attr});
  try {
    switch (a.getInt(0, gravityEnumToAttrInt(defaultGravity))) {
      case 1:
        return GravityEnum.CENTER;
      case 2:
        return GravityEnum.END;
      default:
        return GravityEnum.START;
    }
  } finally {
    a.recycle();
  }
}
 
开发者ID:afollestad,项目名称:material-dialogs,代码行数:16,代码来源:DialogUtils.java

示例4: invertGravityIfNecessary

private void invertGravityIfNecessary() {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) return;
    Configuration config = getResources().getConfiguration();
    if (config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
        switch (buttonGravity) {
            case START:
                buttonGravity = GravityEnum.END;
                break;
            case END:
                buttonGravity = GravityEnum.START;
                break;
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:MDRootLayout.java

示例5: invertGravityIfNecessary

private void invertGravityIfNecessary() {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) return;
    Configuration config = getResources().getConfiguration();
    if (config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
        switch (mButtonGravity) {
            case START:
                mButtonGravity = GravityEnum.END;
                break;
            case END:
                mButtonGravity = GravityEnum.START;
                break;
        }
    }
}
 
开发者ID:susong7519,项目名称:EasyFrame,代码行数:14,代码来源:MDRootLayout.java

示例6: resolveGravityEnum

public static GravityEnum resolveGravityEnum(Context context, @AttrRes int attr, GravityEnum defaultGravity) {
    TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{attr});
    try {
        switch (a.getInt(0, gravityEnumToAttrInt(defaultGravity))) {
            case 1:
                return GravityEnum.CENTER;
            case 2:
                return GravityEnum.END;
            default:
                return GravityEnum.START;
        }
    } finally {
        a.recycle();
    }
}
 
开发者ID:susong7519,项目名称:EasyFrame,代码行数:15,代码来源:DialogUtils.java

示例7: init

private void init(Context context) {
    stackedEndPadding = context.getResources()
            .getDimensionPixelSize(R.dimen.md_dialog_frame_margin);
    stackedGravity = GravityEnum.END;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:MDButton.java

示例8: init

private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    mStackedEndPadding = context.getResources()
            .getDimensionPixelSize(R.dimen.md_dialog_frame_margin);
    mStackedGravity = GravityEnum.END;
}
 
开发者ID:susong7519,项目名称:EasyFrame,代码行数:5,代码来源:MDButton.java

示例9: init

private void init(Context context) {
  stackedEndPadding =
      context.getResources().getDimensionPixelSize(R.dimen.md_dialog_frame_margin);
  stackedGravity = GravityEnum.END;
}
 
开发者ID:afollestad,项目名称:material-dialogs,代码行数:5,代码来源:MDButton.java


注:本文中的com.afollestad.materialdialogs.GravityEnum.END属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。