本文整理匯總了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);