package com.mylhyl.circledialog.params; import android.os.Parcel; import android.os.Parcelable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import androidx.annotation.IntDef; /** * Created by hupei on 2019/1/16 14:14. */ public class CloseParams implements Parcelable { /** * 关闿Œ‰é’®åœ¨ä¸Šå·¦ */ public static final int CLOSE_TOP_LEFT = 351; /** * 关闿Œ‰é’®åœ¨ä¸Šå³ */ public static final int CLOSE_TOP_RIGHT = 353; /** * 关闿Œ‰é’®åœ¨ä¸Šä¸ */ public static final int CLOSE_TOP_CENTER = 349; /** * 关闿Œ‰é’®åœ¨ä¸‹å·¦ */ public static final int CLOSE_BOTTOM_LEFT = 783; /** * 关闿Œ‰é’®åœ¨ä¸‹å³ */ public static final int CLOSE_BOTTOM_RIGHT = 785; /** * 关闿Œ‰é’®åœ¨ä¸‹ä¸ */ public static final int CLOSE_BOTTOM_CENTER = 781; public static final Parcelable.Creator<CloseParams> CREATOR = new Parcelable.Creator<CloseParams>() { @Override public CloseParams createFromParcel(Parcel source) { return new CloseParams(source); } @Override public CloseParams[] newArray(int size) { return new CloseParams[size]; } }; public int closeResId; /** * å…³é—å›¾æ ‡çš„å¤§å° dp */ public int closeSize; /** * 关闿Œ‰é’®çš„å†…é—´è· dp * int left, int top, int right, int bottom */ public int[] closePadding; /** * 关闿Œ‰é’®ä½ç½® */ public @CloseGravity int closeGravity = CLOSE_TOP_RIGHT; /** * 与边框的连接线宽度,默认0ï¼Œåªæœ‰å¤§äºŽ0æ‰æ˜¾ç¤º dp */ public int connectorWidth; /** * 与边框的连接线高度 dp */ public int connectorHeight; /** * 与边框的连接线颜色值 RGB */ public int connectorColor = 0xFFFFFFFF; public CloseParams() { } protected CloseParams(Parcel in) { this.closeResId = in.readInt(); this.closeSize = in.readInt(); this.closePadding = in.createIntArray(); this.closeGravity = in.readInt(); } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(this.closeResId); dest.writeInt(this.closeSize); dest.writeIntArray(this.closePadding); dest.writeInt(this.closeGravity); } @IntDef({CLOSE_TOP_LEFT, CLOSE_TOP_RIGHT, CLOSE_TOP_CENTER , CLOSE_BOTTOM_LEFT, CLOSE_BOTTOM_RIGHT, CLOSE_BOTTOM_CENTER}) @Retention(RetentionPolicy.SOURCE) public @interface CloseGravity { } }