/** * Created by yhao on 2017/12/23. * https://github.com/yhaolpz */ public class Screen { public static final int width = 0; public static final int height = 1; @IntDef({width, height}) @Retention(RetentionPolicy.SOURCE) @interface screenType { } }
/** * Created by yhao on 2017/12/22. * https://github.com/yhaolpz */ public class MoveType { static final int fixed = 0; public static final int free = 1; public static final int active = 2; public static final int slide = 3; public static final int back = 4; @IntDef({fixed, free, active, slide, back}) @Retention(RetentionPolicy.SOURCE) @interface MOVE_TYPE { } }
/** * Created by yhao on 2017/12/23. * https://github.com/yhaolpz */ public class Screen { public static final int width = 0; public static final int height = 1; @IntDef({width, height}) @Retention(RetentionPolicy.SOURCE) @interface screenType { } }
public class LocateState { public static final int LOCATING = 123; public static final int SUCCESS = 132; public static final int FAILURE = 321; @IntDef({SUCCESS, FAILURE}) @Retention(RetentionPolicy.SOURCE) public @interface State{} }
public class Flash { public static final int FLASH_ON = 0; public static final int FLASH_OFF = 1; public static final int FLASH_AUTO = 2; @IntDef({FLASH_ON, FLASH_OFF, FLASH_AUTO}) @Retention(RetentionPolicy.SOURCE) public @interface FlashMode { } }
public class MediaAction { public final static int ACTION_PHOTO = 0; public final static int ACTION_VIDEO = 1; @IntDef({ACTION_PHOTO, ACTION_VIDEO}) @Retention(RetentionPolicy.SOURCE) public @interface MediaActionState { } }
public class Record { public static final int TAKE_PHOTO_STATE = 0; public static final int READY_FOR_RECORD_STATE = 1; public static final int RECORD_IN_PROGRESS_STATE = 2; @IntDef({TAKE_PHOTO_STATE, READY_FOR_RECORD_STATE, RECORD_IN_PROGRESS_STATE}) @Retention(RetentionPolicy.SOURCE) public @interface RecordState { } }
public class Camera { public static final int CAMERA_TYPE_FRONT = 0; public static final int CAMERA_TYPE_REAR = 1; @IntDef({CAMERA_TYPE_FRONT, CAMERA_TYPE_REAR}) @Retention(RetentionPolicy.SOURCE) public @interface CameraType { } }
/** Lifetime represents how long a Job should last. */ public final class Lifetime { /** The Job should be preserved until the next boot. This is the default. */ public static final int UNTIL_NEXT_BOOT = 1; /** The Job should be preserved "forever." */ public static final int FOREVER = 2; @Retention(RetentionPolicy.SOURCE) @IntDef({FOREVER, UNTIL_NEXT_BOOT}) @interface LifetimeConstant {} }
@IntDef({State.SCROLLING, State.DATA_CHANGES}) @interface State { int SCROLLING = 0;
public static final int ENABLE_WRITE_AHEAD_LOGGING = 0x1; public static final int ENABLE_FOREIGN_KEY_CONSTRAINTS = 0x2; @IntDef( value = { ENABLE_WRITE_AHEAD_LOGGING, ENABLE_FOREIGN_KEY_CONSTRAINTS }, flag = true)
/** * Created by yhao on 2017/12/22. * https://github.com/yhaolpz */ public class MoveType { static final int fixed = 0; public static final int inactive = 1; public static final int active = 2; public static final int slide = 3; public static final int back = 4; @IntDef({fixed, inactive, active, slide, back}) @Retention(RetentionPolicy.SOURCE) @interface MOVE_TYPE { } }
@IntDef({STATUS_UNINITIALIZED, STATUS_IN_RANGE, STATUS_OUT_OF_RANGE}) public @interface WorkingRangeStatus {}
/** * Thrown when a {@link MergingMediaSource} cannot merge its sources. */ public static final class IllegalMergeException extends IOException { /** The reason the merge failed. One of {@link #REASON_PERIOD_COUNT_MISMATCH}. */ @Documented @Retention(RetentionPolicy.SOURCE) @IntDef({REASON_PERIOD_COUNT_MISMATCH}) public @interface Reason {} /** * The sources have different period counts. */ public static final int REASON_PERIOD_COUNT_MISMATCH = 0; /** * The reason the merge failed. */ @Reason public final int reason; /** * @param reason The reason the merge failed. */ public IllegalMergeException(@Reason int reason) { this.reason = reason; } }
/** * Interface which you can implement if you want to provide a custom Network callback. * Make sure you also implement {@link NetworkEventProvider} for best performance. */ public interface NetworkUtil { /** * Order of these constant values matter as they are relied upon to be incrementing in terms * of availability. */ @Retention(RetentionPolicy.SOURCE) @IntDef({DISCONNECTED, METERED, UNMETERED}) @interface NetworkStatus {} int DISCONNECTED = 0; int METERED = 1; int UNMETERED = 2; /** * Returns the current connection status. If you cannot detect granular network type, return * {@link #UNMETERED} if there is an internet connection or {@link #DISCONNECTED} if there is no * connection. * * @param context The application context * * @return The current connection status. It should be one of {@link #DISCONNECTED}, * {@link #METERED} or {@link #UNMETERED}. */ @NetworkStatus int getNetworkStatus(Context context); }
@IntDef({TYPE_OPEN, TYPE_READ, TYPE_CLOSE}) public @interface Type {}
@IntDef({REASON_INVALID_PERIOD_COUNT, REASON_NOT_SEEKABLE_TO_START, REASON_START_EXCEEDS_END}) public @interface Reason {}
@IntDef({REASON_UNSUPPORTED_SCHEME, REASON_INSTANTIATION_ERROR}) public @interface Reason {}
private static final int DATA_SOURCE_NETWORK = 3; @IntDef({DATA_SOURCE_MEMORY, DATA_SOURCE_DISK, DATA_SOURCE_NETWORK}) @interface DataSource {