當前位置: 首頁>>代碼示例>>Java>>正文


Java Duration類代碼示例

本文整理匯總了Java中com.github.javiersantos.materialstyleddialogs.enums.Duration的典型用法代碼示例。如果您正苦於以下問題:Java Duration類的具體用法?Java Duration怎麽用?Java Duration使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Duration類屬於com.github.javiersantos.materialstyleddialogs.enums包,在下文中一共展示了Duration類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Builder

import com.github.javiersantos.materialstyleddialogs.enums.Duration; //導入依賴的package包/類
public Builder(Context context) {
    this.context = context;
    this.style = Style.HEADER_WITH_ICON;
    this.isIconAnimation = true;
    this.isDialogAnimation = false;
    this.isDialogDivider = false;
    this.isDarkerOverlay = false;
    this.duration = Duration.NORMAL;
    this.isCancelable = true;
    this.primaryColor = UtilsLibrary.getPrimaryColor(context);
    this.isScrollable = false;
    this.maxLines = 5;
    this.isAutoDismiss = true;
    this.headerScaleType = ImageView.ScaleType.CENTER_CROP;
}
 
開發者ID:sega4revenge,項目名稱:Sega,代碼行數:16,代碼來源:MaterialStyledDialog.java

示例2: Builder

import com.github.javiersantos.materialstyleddialogs.enums.Duration; //導入依賴的package包/類
public Builder(Context context) {
    this.context = context;
    this.style = Style.HEADER_WITH_ICON;
    this.isIconAnimation = true;
    this.isDialogAnimation = false;
    this.isDialogDivider = false;
    this.isDarkerOverlay = false;
    this.duration = Duration.NORMAL;
    this.isCancelable = true;
    this.primaryColor = UtilsLibrary.getPrimaryColor(context);
    this.isScrollable = false;
    this.maxLines = 5;
    this.isAutoDismiss = true;
    this.headerScaleType = AppCompatImageView.ScaleType.CENTER_CROP;
}
 
開發者ID:javiersantos,項目名稱:MaterialStyledDialogs,代碼行數:16,代碼來源:MaterialStyledDialog.java

示例3: initMaterialStyledDialog

import com.github.javiersantos.materialstyleddialogs.enums.Duration; //導入依賴的package包/類
@UiThread
private MaterialDialog initMaterialStyledDialog(final Builder builder) {
    final MaterialDialog.Builder dialogBuilder = new MaterialDialog.Builder(builder.context).theme(Theme.LIGHT);

    // Set cancelable
    dialogBuilder.cancelable(builder.isCancelable);

    // Set style
    dialogBuilder.customView(initStyle(builder), false);

    // Set positive button
    if (builder.positive != null && builder.positive.length() != 0)
        dialogBuilder.positiveText(builder.positive);
    if (builder.positiveCallback != null)
        dialogBuilder.onPositive(builder.positiveCallback);

    // set negative button
    if (builder.negative != null && builder.negative.length() != 0)
        dialogBuilder.negativeText(builder.negative);
    if (builder.negativeCallback != null)
        dialogBuilder.onNegative(builder.negativeCallback);

    // Set neutral button
    if (builder.neutral != null && builder.neutral.length() != 0)
        dialogBuilder.neutralText(builder.neutral);
    if (builder.neutralCallback != null)
        dialogBuilder.onNeutral(builder.neutralCallback);

    // Set auto dismiss when touching the buttons
    dialogBuilder.autoDismiss(builder.isAutoDismiss);

    // Build the dialog with the previous configuration
    MaterialDialog materialDialog = dialogBuilder.build();

    // Set dialog animation and animation duration
    if (builder.isDialogAnimation) {
        if (builder.duration == Duration.NORMAL) {
            materialDialog.getWindow().getAttributes().windowAnimations = R.style.MaterialStyledDialogs_DialogAnimationNormal;
        } else if (builder.duration == Duration.FAST) {
            materialDialog.getWindow().getAttributes().windowAnimations = R.style.MaterialStyledDialogs_DialogAnimationFast;
        } else if (builder.duration == Duration.SLOW) {
            materialDialog.getWindow().getAttributes().windowAnimations = R.style.MaterialStyledDialogs_DialogAnimationSlow;
        }
    }

    return materialDialog;
}
 
開發者ID:sega4revenge,項目名稱:Sega,代碼行數:48,代碼來源:MaterialStyledDialog.java

示例4: withDialogAnimation

import com.github.javiersantos.materialstyleddialogs.enums.Duration; //導入依賴的package包/類
@Override
public Builder withDialogAnimation(Boolean withAnimation, Duration duration) {
    this.isDialogAnimation = withAnimation;
    this.duration = duration;
    return this;
}
 
開發者ID:sega4revenge,項目名稱:Sega,代碼行數:7,代碼來源:MaterialStyledDialog.java

示例5: withDialogAnimation

import com.github.javiersantos.materialstyleddialogs.enums.Duration; //導入依賴的package包/類
/**
 * Set if the dialog will be displayed with an open and close animation, with custom duration. Default: false, Duration.NORMAL.
 *
 * @param withAnimation true to enable animation, false otherwise
 * @return this
 * @see com.github.javiersantos.materialstyleddialogs.enums.Duration
 */
MaterialStyledDialog.Builder withDialogAnimation(Boolean withAnimation, Duration duration);
 
開發者ID:sega4revenge,項目名稱:Sega,代碼行數:9,代碼來源:IBuilder.java


注:本文中的com.github.javiersantos.materialstyleddialogs.enums.Duration類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。