本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);