18 | * The main purpose of this method is to indicate that you believe a method can be called 19 | * from any thread; static tools can then check that nothing you call from within this method 20 | * or class have more strict threading requirements. 21 | *
22 | * Example: 23 | *
24 | * @AnyThread
25 | * public void deliverResult(D data) { ... }
26 | *
27 | */
28 | @Documented
29 | @Retention(CLASS)
30 | @Target({METHOD, CONSTRUCTOR, TYPE, PARAMETER})
31 | public @interface AnyThread
32 | {
33 | }
34 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/AppIdInt.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.FIELD;
23 | import static java.lang.annotation.ElementType.METHOD;
24 | import static java.lang.annotation.ElementType.PARAMETER;
25 | import static java.lang.annotation.RetentionPolicy.SOURCE;
26 |
27 | /**
28 | * Denotes that the annotated element is a multi-user application ID. This is
29 | * not the same as a UID.
30 | *
31 | * @hide
32 | */
33 | @Retention(SOURCE)
34 | @Target({METHOD, PARAMETER, FIELD})
35 | public @interface AppIdInt
36 | {
37 | }
38 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/ArrayRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be an array resource reference (e.g. {@code android.R.array.phoneTypes}).
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface ArrayRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/AttrRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | @Documented
14 | @Retention(CLASS)
15 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
16 | public @interface AttrRes
17 | {
18 | }
19 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/BinderThread.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.CONSTRUCTOR;
8 | import static java.lang.annotation.ElementType.METHOD;
9 | import static java.lang.annotation.ElementType.PARAMETER;
10 | import static java.lang.annotation.ElementType.TYPE;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | @Documented
14 | @Retention(CLASS)
15 | @Target({METHOD, CONSTRUCTOR, TYPE, PARAMETER})
16 | public @interface BinderThread
17 | {
18 | }
19 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/BoolRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be a boolean resource reference.
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface BoolRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/BroadcastBehavior.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import android.content.Intent;
20 |
21 | import java.lang.annotation.ElementType;
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 | import java.lang.annotation.Target;
25 |
26 | /**
27 | * Description of how the annotated broadcast action behaves.
28 | *
29 | * @hide
30 | */
31 | @Target({ElementType.FIELD})
32 | @Retention(RetentionPolicy.SOURCE)
33 | public @interface BroadcastBehavior
34 | {
35 | /**
36 | * This broadcast will only be delivered to an explicit target.
37 | *
38 | * @see Intent#setPackage(String)
39 | * @see Intent#setComponent(android.content.ComponentName)
40 | */
41 | boolean explicitOnly() default false;
42 |
43 | /**
44 | * This broadcast will only be delivered to registered receivers.
45 | *
46 | * @see Intent#FLAG_RECEIVER_REGISTERED_ONLY
47 | */
48 | boolean registeredOnly() default false;
49 |
50 | /**
51 | * This broadcast will include all {@code AndroidManifest.xml} receivers
52 | * regardless of process state.
53 | *
54 | * @see Intent#FLAG_RECEIVER_INCLUDE_BACKGROUND
55 | */
56 | boolean includeBackground() default false;
57 |
58 | /**
59 | * This broadcast is protected and can only be sent by the OS.
60 | */
61 | boolean protectedBroadcast() default false;
62 | }
63 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/BytesLong.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.FIELD;
23 | import static java.lang.annotation.ElementType.METHOD;
24 | import static java.lang.annotation.ElementType.PARAMETER;
25 | import static java.lang.annotation.RetentionPolicy.SOURCE;
26 |
27 | /**
28 | * @memberDoc Value is a non-negative number of bytes.
29 | * @paramDoc Value is a non-negative number of bytes.
30 | * @returnDoc Value is a non-negative number of bytes.
31 | * @hide
32 | */
33 | @Retention(SOURCE)
34 | @Target({METHOD, PARAMETER, FIELD})
35 | public @interface BytesLong
36 | {
37 | }
38 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/CallSuper.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.METHOD;
8 | import static java.lang.annotation.RetentionPolicy.CLASS;
9 |
10 | /**
11 | * Denotes that any overriding methods should invoke this method as well.
12 | * 13 | * Example: 14 | *
15 | * @CallSuper
16 | * public abstract void onFocusLost();
17 | *
18 | */
19 | @Documented
20 | @Retention(CLASS)
21 | @Target({METHOD})
22 | public @interface CallSuper
23 | {
24 | }
25 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/CallbackExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.Target;
21 | import java.util.concurrent.Executor;
22 |
23 | import static java.lang.annotation.ElementType.PARAMETER;
24 | import static java.lang.annotation.RetentionPolicy.SOURCE;
25 |
26 | /**
27 | * @paramDoc Callback and listener events are dispatched through this
28 | * {@link Executor}, providing an easy way to control which thread is
29 | * used. To dispatch events through the main thread of your
30 | * application, you can use
31 | * {@link android.content.Context#getMainExecutor() Context.getMainExecutor()}.
32 | * To dispatch events through a shared thread pool, you can use
33 | * {@link android.os.AsyncTask#THREAD_POOL_EXECUTOR AsyncTask#THREAD_POOL_EXECUTOR}.
34 | * @hide
35 | */
36 | @Retention(SOURCE)
37 | @Target(PARAMETER)
38 | public @interface CallbackExecutor
39 | {
40 | }
41 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/CheckResult.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.METHOD;
8 | import static java.lang.annotation.RetentionPolicy.CLASS;
9 |
10 | /**
11 | * Denotes that the annotated method returns a result that it typically is
12 | * an error to ignore. This is usually used for methods that have no side effect,
13 | * so calling it without actually looking at the result usually means the developer
14 | * has misunderstood what the method does.
15 | * 16 | * Example: 17 | *
{@code
18 | * public @CheckResult String trim(String s) { return s.trim(); }
19 | * ...
20 | * s.trim(); // this is probably an error
21 | * s = s.trim(); // ok
22 | * }
23 | */
24 | @Documented
25 | @Retention(CLASS)
26 | @Target({METHOD})
27 | public @interface CheckResult
28 | {
29 | /**
30 | * Defines the name of the suggested method to use instead, if applicable (using
31 | * the same signature format as javadoc.) If there is more than one possibility,
32 | * list them all separated by commas.
33 | * 34 | * For example, ProcessBuilder has a method named {@code redirectErrorStream()} 35 | * which sounds like it might redirect the error stream. It does not. It's just 36 | * a getter which returns whether the process builder will redirect the error stream, 37 | * and to actually set it, you must call {@code redirectErrorStream(boolean)}. 38 | * In that case, the method should be defined like this: 39 | *
40 | * @CheckResult(suggest="#redirectErrorStream(boolean)")
41 | * public boolean redirectErrorStream() { ... }
42 | *
43 | */
44 | String suggest() default "";
45 | }
46 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/ColorInt.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that the annotated element represents a packed color
15 | * int, {@code AARRGGBB}. If applied to an int array, every element
16 | * in the array represents a color integer.
17 | * 18 | * Example: 19 | *
{@code
20 | * public abstract void setTextColor(@ColorInt int color);
21 | * }
22 | */
23 | @Documented
24 | @Retention(CLASS)
25 | @Target({PARAMETER, METHOD, LOCAL_VARIABLE, FIELD})
26 | public @interface ColorInt
27 | {
28 | }
29 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/ColorLong.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.SOURCE;
12 |
13 | /**
14 | * Denotes that the annotated element represents a packed color 15 | * long. If applied to a long array, every element in the array 16 | * represents a color long. For more information on how colors 17 | * are packed in a long, please refer to the documentation of 18 | * the {@link android.graphics.Color} class.
19 | * 20 | *Example:
21 | * 22 | *{@code
23 | * public void setFillColor(@ColorLong long color);
24 | * }
25 | *
26 | * @see android.graphics.Color
27 | */
28 | @Documented
29 | @Retention(SOURCE)
30 | @Target({PARAMETER, METHOD, LOCAL_VARIABLE, FIELD})
31 | public @interface ColorLong
32 | {
33 | }
34 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/ColorRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be a color resource reference (e.g. {@code android.R.color.black}).
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface ColorRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/Colour.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Target;
6 |
7 | @Target({ElementType.PARAMETER})
8 | @Documented
9 | public @interface Colour
10 | {
11 | //format 6 digits - HEX without '#'
12 | }
13 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/Condemned.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.CONSTRUCTOR;
23 | import static java.lang.annotation.ElementType.FIELD;
24 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
25 | import static java.lang.annotation.ElementType.METHOD;
26 | import static java.lang.annotation.ElementType.PACKAGE;
27 | import static java.lang.annotation.ElementType.PARAMETER;
28 | import static java.lang.annotation.ElementType.TYPE;
29 | import static java.lang.annotation.RetentionPolicy.SOURCE;
30 |
31 | /**
32 | * A program element annotated @Condemned is one that programmers are
33 | * blocked from using, typically because it's about to be completely destroyed.
34 | * 35 | * This is a stronger version of @Deprecated, and it's typically used to 36 | * mark APIs that only existed temporarily in a preview SDK, and which only 37 | * continue to exist temporarily to support binary compatibility. 38 | * 39 | * @hide 40 | */ 41 | @Retention(SOURCE) 42 | @Target(value = {CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE}) 43 | public @interface Condemned 44 | { 45 | } 46 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/ContentView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 ZeoFlow SRL 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.zeoflow.annotation; 18 | 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.Target; 21 | 22 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 23 | import static java.lang.annotation.RetentionPolicy.CLASS; 24 | 25 | /** 26 | * Annotation that can be attached to a constructor with a single {@link LayoutRes} parameter 27 | * to denote what layout the component intends to inflate and set as its content. 28 | *
29 | * It is strongly recommended that components that support this annotation specifically call 30 | * it out in their documentation. 31 | *
32 | * public class MainFragment extends Fragment {
33 | * public MainFragment() {
34 | * // This constructor is annotated with @ContentView
35 | * super(R.layout.main);
36 | * }
37 | * }
38 | *
39 | */
40 | @Retention(CLASS)
41 | @Target({CONSTRUCTOR})
42 | public @interface ContentView
43 | {
44 | }
45 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/Credential.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Target;
6 |
7 | @Target({ElementType.PARAMETER})
8 | @Documented
9 | public @interface Credential
10 | {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/CurrentTimeMillisLong.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.FIELD;
23 | import static java.lang.annotation.ElementType.METHOD;
24 | import static java.lang.annotation.ElementType.PARAMETER;
25 | import static java.lang.annotation.RetentionPolicy.SOURCE;
26 |
27 | /**
28 | * @memberDoc Value is a non-negative timestamp measured as the number of
29 | * milliseconds since 1970-01-01T00:00:00Z.
30 | * @paramDoc Value is a non-negative timestamp measured as the number of
31 | * milliseconds since 1970-01-01T00:00:00Z.
32 | * @returnDoc Value is a non-negative timestamp measured as the number of
33 | * milliseconds since 1970-01-01T00:00:00Z.
34 | * @hide
35 | */
36 | @Retention(SOURCE)
37 | @Target({METHOD, PARAMETER, FIELD})
38 | public @interface CurrentTimeMillisLong
39 | {
40 | }
41 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/CurrentTimeSecondsLong.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.FIELD;
23 | import static java.lang.annotation.ElementType.METHOD;
24 | import static java.lang.annotation.ElementType.PARAMETER;
25 | import static java.lang.annotation.RetentionPolicy.SOURCE;
26 |
27 | /**
28 | * @memberDoc Value is a non-negative timestamp measured as the number of
29 | * seconds since 1970-01-01T00:00:00Z.
30 | * @paramDoc Value is a non-negative timestamp measured as the number of
31 | * seconds since 1970-01-01T00:00:00Z.
32 | * @returnDoc Value is a non-negative timestamp measured as the number of
33 | * seconds since 1970-01-01T00:00:00Z.
34 | * @hide
35 | */
36 | @Retention(SOURCE)
37 | @Target({METHOD, PARAMETER, FIELD})
38 | public @interface CurrentTimeSecondsLong
39 | {
40 | }
41 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/DimenRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be a dimension resource reference (e.g. {@code android.R.dimen.app_icon_size}).
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface DimenRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/Dimension.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
8 | import static java.lang.annotation.ElementType.FIELD;
9 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
10 | import static java.lang.annotation.ElementType.METHOD;
11 | import static java.lang.annotation.ElementType.PARAMETER;
12 | import static java.lang.annotation.RetentionPolicy.CLASS;
13 |
14 | /**
15 | * Denotes that an integer parameter, field or method return value is expected
16 | * to represent a dimension.
17 | */
18 | @Documented
19 | @Retention(CLASS)
20 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE, ANNOTATION_TYPE})
21 | public @interface Dimension
22 | {
23 | int DP = 0;
24 | int PX = 1;
25 | int SP = 2;
26 |
27 | @DimensionUnit
28 | int unit() default PX;
29 | }
30 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/DimensionUnit.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Retention;
4 |
5 | import static java.lang.annotation.RetentionPolicy.SOURCE;
6 |
7 | /**
8 | * @hide
9 | */
10 | @IntDef({Dimension.PX,
11 | Dimension.DP,
12 | Dimension.SP}
13 | // Important: If updating these constants, also update
14 | // ../../../../external-annotations/android/support/annotation/annotations.xml
15 | )
16 | @RestrictTo(RestrictTo.Scope.LIBRARY)
17 | @Retention(SOURCE)
18 | @interface DimensionUnit
19 | {
20 | }
21 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/DoNotInline.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Retention;
4 | import java.lang.annotation.Target;
5 |
6 | import static java.lang.annotation.ElementType.METHOD;
7 | import static java.lang.annotation.RetentionPolicy.CLASS;
8 |
9 | /**
10 | * Denotes that the annotated method should not be inlined when
11 | * the code is optimized at build time. This is typically used
12 | * to avoid inlining purposely out-of-line methods that are
13 | * intended to be in separate classes.
14 | * 15 | * Example: 16 | *
17 | * @DoNotInline
18 | * public void foo() {
19 | * ...
20 | * }
21 | *
22 | */
23 | @Retention(CLASS)
24 | @Target({METHOD})
25 | public @interface DoNotInline
26 | {
27 | }
28 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/DrawableRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be a drawable resource reference (e.g. {@code android.R.attr.alertDialogIcon}).
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface DrawableRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/DurationMillisLong.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.FIELD;
23 | import static java.lang.annotation.ElementType.METHOD;
24 | import static java.lang.annotation.ElementType.PARAMETER;
25 | import static java.lang.annotation.RetentionPolicy.SOURCE;
26 |
27 | /**
28 | * @memberDoc Value is a non-negative duration in milliseconds.
29 | * @paramDoc Value is a non-negative duration in milliseconds.
30 | * @returnDoc Value is a non-negative duration in milliseconds.
31 | * @hide
32 | */
33 | @Retention(SOURCE)
34 | @Target({METHOD, PARAMETER, FIELD})
35 | public @interface DurationMillisLong
36 | {
37 | }
38 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/ElapsedRealtimeLong.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import android.os.SystemClock;
20 |
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.Target;
23 |
24 | import static java.lang.annotation.ElementType.FIELD;
25 | import static java.lang.annotation.ElementType.METHOD;
26 | import static java.lang.annotation.ElementType.PARAMETER;
27 | import static java.lang.annotation.RetentionPolicy.SOURCE;
28 |
29 | /**
30 | * @memberDoc Value is a non-negative timestamp in the
31 | * {@link SystemClock#elapsedRealtime()} time base.
32 | * @paramDoc Value is a non-negative timestamp in the
33 | * {@link SystemClock#elapsedRealtime()} time base.
34 | * @returnDoc Value is a non-negative timestamp in the
35 | * {@link SystemClock#elapsedRealtime()} time base.
36 | * @hide
37 | */
38 | @Retention(SOURCE)
39 | @Target({METHOD, PARAMETER, FIELD})
40 | public @interface ElapsedRealtimeLong
41 | {
42 | }
43 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/EnclosingClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2008 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * A system annotation used to provide part of the {@code InnerClasses} attribute.
26 | */
27 | @Retention(RetentionPolicy.RUNTIME)
28 | @Target(ElementType.ANNOTATION_TYPE)
29 | @interface EnclosingClass
30 | {
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/EnclosingMethod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2008 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * A system annotation used to provide the {@code EnclosingMethod} attribute.
26 | */
27 | @Retention(RetentionPolicy.RUNTIME)
28 | @Target(ElementType.ANNOTATION_TYPE)
29 | @interface EnclosingMethod
30 | {
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/ErrorCode.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Target;
6 |
7 | @Target({ElementType.PARAMETER})
8 | @Documented
9 | public @interface ErrorCode
10 | {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/ErrorMessage.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Target;
6 |
7 | @Target({ElementType.PARAMETER})
8 | @Documented
9 | public @interface ErrorMessage
10 | {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/FloatRange.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
8 | import static java.lang.annotation.ElementType.FIELD;
9 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
10 | import static java.lang.annotation.ElementType.METHOD;
11 | import static java.lang.annotation.ElementType.PARAMETER;
12 | import static java.lang.annotation.RetentionPolicy.CLASS;
13 |
14 | /**
15 | * Denotes that the annotated element should be a float or double in the given range
16 | * 17 | * Example: 18 | *
19 | * @FloatRange(from=0.0,to=1.0)
20 | * public float getAlpha() {
21 | * ...
22 | * }
23 | *
24 | */
25 | @Documented
26 | @Retention(CLASS)
27 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE, ANNOTATION_TYPE})
28 | public @interface FloatRange
29 | {
30 | /**
31 | * Smallest value. Whether it is inclusive or not is determined
32 | * by {@link #fromInclusive}
33 | */
34 | double from() default Double.NEGATIVE_INFINITY;
35 |
36 | /**
37 | * Largest value. Whether it is inclusive or not is determined
38 | * by {@link #toInclusive}
39 | */
40 | double to() default Double.POSITIVE_INFINITY;
41 |
42 | /**
43 | * Whether the from value is included in the range
44 | */
45 | boolean fromInclusive() default true;
46 |
47 | /**
48 | * Whether the to value is included in the range
49 | */
50 | boolean toInclusive() default true;
51 | }
52 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/FontRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be a font resource reference (e.g. {@code R.font.myfont}).
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface FontRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/ForceInline.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Oracle designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Oracle in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 | * or visit www.oracle.com if you need additional information or have any
23 | * questions.
24 | */
25 |
26 | package com.zeoflow.annotation;
27 |
28 | import java.lang.annotation.ElementType;
29 | import java.lang.annotation.Retention;
30 | import java.lang.annotation.RetentionPolicy;
31 | import java.lang.annotation.Target;
32 |
33 | /**
34 | * A method or constructor may be annotated as "force inline" if the standard
35 | * inlining metrics are to be ignored when the HotSpot VM inlines the method
36 | * or constructor.
37 | * 38 | * This annotation must be used sparingly. It is useful when the only 39 | * reasonable alternative is to bind the name of a specific method or 40 | * constructor into the HotSpot VM for special handling by the inlining policy. 41 | * This annotation must not be relied on as an alternative to avoid tuning the 42 | * VM's inlining policy. In a few cases, it may act as a temporary workaround 43 | * until the profiling and inlining performed by the HotSpot VM is sufficiently 44 | * improved. 45 | * 46 | * @implNote This annotation only takes effect for methods or constructors of classes 47 | * loaded by the boot loader. Annotations on methods or constructors of classes 48 | * loaded outside of the boot loader are ignored. 49 | */ 50 | @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) 51 | @Retention(RetentionPolicy.RUNTIME) 52 | public @interface ForceInline 53 | { 54 | } 55 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/FractionRes.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.FIELD; 8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 9 | import static java.lang.annotation.ElementType.METHOD; 10 | import static java.lang.annotation.ElementType.PARAMETER; 11 | import static java.lang.annotation.RetentionPolicy.CLASS; 12 | 13 | /** 14 | * Denotes that an integer parameter, field or method return value is expected 15 | * to be a fraction resource reference. 16 | */ 17 | @Documented 18 | @Retention(CLASS) 19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) 20 | public @interface FractionRes 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/GuardedBy.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Denotes that the annotated method or field can only be accessed when holding the referenced lock. 10 | *
11 | * Example: 12 | *
13 | * final Object objectLock = new Object();
14 | *
15 | * {@literal @}GuardedBy("objectLock")
16 | * volatile Object object;
17 | *
18 | * Object getObject() {
19 | * synchronized (objectLock) {
20 | * if (object == null) {
21 | * object = new Object();
22 | * }
23 | * }
24 | * return object;
25 | * }
26 | */
27 | @Target({ElementType.FIELD, ElementType.METHOD})
28 | @Retention(RetentionPolicy.CLASS)
29 | public @interface GuardedBy
30 | {
31 | String value();
32 | }
33 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/HalfFloat.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.SOURCE;
12 |
13 | /**
14 | * Denotes that the annotated element represents a half-precision floating point
15 | * value. Such values are stored in short data types and can be manipulated with
16 | * the android.util.Half class. If applied to an array of short, every
17 | * element in the array represents a half-precision float.
Example:
20 | * 21 | *{@code
22 | * public abstract void setPosition(@HalfFloat short x, @HalfFloat short y, @HalfFloat short z);
23 | * }
24 | */
25 | @Documented
26 | @Retention(SOURCE)
27 | @Target({PARAMETER, METHOD, LOCAL_VARIABLE, FIELD})
28 | public @interface HalfFloat
29 | {
30 | }
31 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/Hide.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
24 | import static java.lang.annotation.ElementType.CONSTRUCTOR;
25 | import static java.lang.annotation.ElementType.FIELD;
26 | import static java.lang.annotation.ElementType.METHOD;
27 | import static java.lang.annotation.ElementType.PACKAGE;
28 | import static java.lang.annotation.ElementType.TYPE;
29 |
30 | /**
31 | * Indicates that an API is hidden by default, in a similar fashion to the
32 | * @hidejavadoc tag. 33 | * 34 | *
Note that, in order for this to work, metalava has to be invoked with 35 | * the flag {@code --hide-annotation Hide}. 36 | * 37 | * @hide 38 | */ 39 | @Target({TYPE, FIELD, METHOD, CONSTRUCTOR, ANNOTATION_TYPE, PACKAGE}) 40 | @Retention(RetentionPolicy.CLASS) 41 | public @interface Hide 42 | { 43 | } 44 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/IdRes.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.FIELD; 8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 9 | import static java.lang.annotation.ElementType.METHOD; 10 | import static java.lang.annotation.ElementType.PARAMETER; 11 | import static java.lang.annotation.RetentionPolicy.CLASS; 12 | 13 | /** 14 | * Denotes that an integer parameter, field or method return value is expected 15 | * to be an id resource reference (e.g. {@code android.R.id.copy}). 16 | */ 17 | @Documented 18 | @Retention(CLASS) 19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) 20 | public @interface IdRes 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/Immutable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.zeoflow.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Annotation type used to mark a class which is immutable. 26 | */ 27 | @Target(ElementType.TYPE) 28 | @Retention(RetentionPolicy.CLASS) 29 | public @interface Immutable 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/InnerClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.zeoflow.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * A system annotation used to provide part of the {@code InnerClasses} attribute. 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.ANNOTATION_TYPE) 29 | @interface InnerClass 30 | { 31 | } 32 | 33 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/IntDef.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE; 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | /** 10 | * Denotes that the annotated element of integer type, represents 11 | * a logical type and that its value should be one of the explicitly 12 | * named constants. If the IntDef#flag() attribute is set to true, 13 | * multiple constants can be combined. 14 | *
15 | * Example: 16 | *
17 | * @Retention(SOURCE)
18 | * @IntDef({NAVIGATION_MODE_STANDARD, NAVIGATION_MODE_LIST, NAVIGATION_MODE_TABS})
19 | * public @interface NavigationMode {}
20 | * public static final int NAVIGATION_MODE_STANDARD = 0;
21 | * public static final int NAVIGATION_MODE_LIST = 1;
22 | * public static final int NAVIGATION_MODE_TABS = 2;
23 | * ...
24 | * public abstract void setNavigationMode(@NavigationMode int mode);
25 | * @NavigationMode
26 | * public abstract int getNavigationMode();
27 | *
28 | * For a flag, set the flag attribute:
29 | *
30 | * @IntDef(
31 | * flag = true,
32 | * value = {NAVIGATION_MODE_STANDARD, NAVIGATION_MODE_LIST, NAVIGATION_MODE_TABS})
33 | *
34 | *
35 | * @see LongDef
36 | */
37 | @Retention(SOURCE)
38 | @Target({ANNOTATION_TYPE})
39 | public @interface IntDef
40 | {
41 | /**
42 | * Defines the allowed constants for this element
43 | */
44 | int[] value() default {};
45 |
46 | /**
47 | * Defines whether the constants can be used as a flag, or just as an enum (the default)
48 | */
49 | boolean flag() default false;
50 |
51 | /**
52 | * Whether any other values are allowed. Normally this is
53 | * not the case, but this allows you to specify a set of
54 | * expected constants, which helps code completion in the IDE
55 | * and documentation generation and so on, but without
56 | * flagging compilation warnings if other values are specified.
57 | */
58 | boolean open() default false;
59 |
60 | /**
61 | * Defines the constant prefix for this element
62 | */
63 | String[] prefix() default {};
64 |
65 | /**
66 | * Defines the constant suffix for this element
67 | */
68 | String[] suffix() default {};
69 | }
70 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/IntRange.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
8 | import static java.lang.annotation.ElementType.FIELD;
9 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
10 | import static java.lang.annotation.ElementType.METHOD;
11 | import static java.lang.annotation.ElementType.PARAMETER;
12 | import static java.lang.annotation.RetentionPolicy.CLASS;
13 |
14 | /**
15 | * Denotes that the annotated element should be an int or long in the given range
16 | * 17 | * Example: 18 | *
19 | * @IntRange(from=0,to=255)
20 | * public int getAlpha() {
21 | * ...
22 | * }
23 | *
24 | */
25 | @Documented
26 | @Retention(CLASS)
27 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE, ANNOTATION_TYPE})
28 | public @interface IntRange
29 | {
30 | /**
31 | * Smallest value, inclusive
32 | */
33 | long from() default Long.MIN_VALUE;
34 |
35 | /**
36 | * Largest value, inclusive
37 | */
38 | long to() default Long.MAX_VALUE;
39 | }
40 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/IntegerRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be an integer resource reference (e.g. {@code android.R.integer.config_shortAnimTime}).
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface IntegerRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/InterpolatorRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be an interpolator resource reference (e.g. {@code android.R.interpolator.cycle}).
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface InterpolatorRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/IntraCoreApi.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
24 | import static java.lang.annotation.ElementType.CONSTRUCTOR;
25 | import static java.lang.annotation.ElementType.FIELD;
26 | import static java.lang.annotation.ElementType.METHOD;
27 | import static java.lang.annotation.ElementType.TYPE;
28 |
29 | /**
30 | * Indicates an API is part of a contract within the "core" set of libraries, some of which may
31 | * be mmodules.
32 | *
33 | * This annotation should only appear on either (a) classes that are hidden by
@hide34 | * javadoc tags or equivalent annotations, or (b) members of such classes. It is for use with 35 | * metalava's {@code --show-single-annotation} option and so must be applied at the class level and 36 | * applied again each member that is to be made part of the API. Members that are not part of the 37 | * API do not have to be explicitly hidden. 38 | * 39 | * @hide 40 | */ 41 | @IntraCoreApi // @IntraCoreApi is itself part of the intra-core API 42 | @Target({TYPE, FIELD, METHOD, CONSTRUCTOR, ANNOTATION_TYPE}) 43 | @Retention(RetentionPolicy.SOURCE) 44 | public @interface IntraCoreApi 45 | { 46 | } 47 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/Keep.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE; 7 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 8 | import static java.lang.annotation.ElementType.FIELD; 9 | import static java.lang.annotation.ElementType.METHOD; 10 | import static java.lang.annotation.ElementType.PACKAGE; 11 | import static java.lang.annotation.ElementType.TYPE; 12 | import static java.lang.annotation.RetentionPolicy.CLASS; 13 | 14 | /** 15 | * Denotes that the annotated element should not be removed when 16 | * the code is minified at build time. This is typically used 17 | * on methods and classes that are accessed only via reflection 18 | * so a compiler may think that the code is unused. 19 | *
20 | * Example: 21 | *
22 | * @Keep
23 | * public void foo() {
24 | * ...
25 | * }
26 | *
27 | */
28 | @Retention(CLASS)
29 | @Target({PACKAGE, TYPE, ANNOTATION_TYPE, CONSTRUCTOR, METHOD, FIELD})
30 | public @interface Keep
31 | {
32 | }
33 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/KeepForApi.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Target;
6 |
7 | @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
8 | @Documented
9 | public @interface KeepForApi
10 | {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/KnownFailure.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2008 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * Marks a test case as a known failure. This means the underlying
26 | * implementation should be fixed. Seems to be similar to {@code @ToBeFixed}, so
27 | * maybe the two can be merged at some point.
28 | *
29 | * @hide
30 | */
31 | @Retention(RetentionPolicy.RUNTIME)
32 | @Target({ElementType.METHOD})
33 | public @interface KnownFailure
34 | {
35 |
36 | /**
37 | * Plain text reason for adding this annotation.
38 | */
39 | String value();
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/LayoutRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be a layout resource reference (e.g. {@code android.R.layout.list_content}).
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface LayoutRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/LongDef.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Retention;
4 | import java.lang.annotation.Target;
5 |
6 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
7 | import static java.lang.annotation.RetentionPolicy.SOURCE;
8 |
9 | /**
10 | * Denotes that the annotated long element represents
11 | * a logical type and that its value should be one of the explicitly
12 | * named constants. If the LongDef#flag() attribute is set to true,
13 | * multiple constants can be combined.
14 | * 15 | * Example: 16 | *
17 | * @Retention(SOURCE)
18 | * @LongDef({NAVIGATION_MODE_STANDARD, NAVIGATION_MODE_LIST, NAVIGATION_MODE_TABS})
19 | * public @interface NavigationMode {}
20 | * public static final long NAVIGATION_MODE_STANDARD = 0;
21 | * public static final long NAVIGATION_MODE_LIST = 1;
22 | * public static final long NAVIGATION_MODE_TABS = 2;
23 | * ...
24 | * public abstract void setNavigationMode(@NavigationMode long mode);
25 | * @NavigationMode
26 | * public abstract long getNavigationMode();
27 | *
28 | * For a flag, set the flag attribute:
29 | *
30 | * @LongDef(
31 | * flag = true,
32 | * value = {NAVIGATION_MODE_STANDARD, NAVIGATION_MODE_LIST, NAVIGATION_MODE_TABS})
33 | *
34 | *
35 | * @see IntDef
36 | */
37 | @Retention(SOURCE)
38 | @Target({ANNOTATION_TYPE})
39 | public @interface LongDef
40 | {
41 | /**
42 | * Defines the allowed constants for this element
43 | */
44 | long[] value() default {};
45 |
46 | /**
47 | * Defines whether the constants can be used as a flag, or just as an enum (the default)
48 | */
49 | boolean flag() default false;
50 |
51 | /**
52 | * Whether any other values are allowed. Normally this is
53 | * not the case, but this allows you to specify a set of
54 | * expected constants, which helps code completion in the IDE
55 | * and documentation generation and so on, but without
56 | * flagging compilation warnings if other values are specified.
57 | */
58 | boolean open() default false;
59 | }
60 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/MainThread.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.CONSTRUCTOR;
8 | import static java.lang.annotation.ElementType.METHOD;
9 | import static java.lang.annotation.ElementType.PARAMETER;
10 | import static java.lang.annotation.ElementType.TYPE;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that the annotated method should only be called on the main thread.
15 | * If the annotated element is a class, then all methods in the class should be called
16 | * on the main thread.
17 | * 18 | * Example: 19 | *
20 | * @MainThread
21 | * public void deliverResult(D data) { ... }
22 | *
23 | *
24 | * Note: Ordinarily, an app's main thread is also the UI 25 | * thread. However, under special circumstances, an app's main thread 26 | * might not be its UI thread; for more information, see 27 | * Thread 28 | * annotations. 29 | */ 30 | @Documented 31 | @Retention(CLASS) 32 | @Target({METHOD, CONSTRUCTOR, TYPE, PARAMETER}) 33 | public @interface MainThread 34 | { 35 | } 36 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/MemberClasses.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.zeoflow.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * A system annotation used to provide the {@code MemberClasses} attribute. 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.ANNOTATION_TYPE) 29 | @interface MemberClasses 30 | { 31 | } 32 | 33 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/MenuRes.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.FIELD; 8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 9 | import static java.lang.annotation.ElementType.METHOD; 10 | import static java.lang.annotation.ElementType.PARAMETER; 11 | import static java.lang.annotation.RetentionPolicy.CLASS; 12 | 13 | /** 14 | * Denotes that an integer parameter, field or method return value is expected 15 | * to be a menu resource reference. 16 | */ 17 | @Documented 18 | @Retention(CLASS) 19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) 20 | public @interface MenuRes 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/NavigationRes.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.FIELD; 8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 9 | import static java.lang.annotation.ElementType.METHOD; 10 | import static java.lang.annotation.ElementType.PARAMETER; 11 | import static java.lang.annotation.RetentionPolicy.CLASS; 12 | 13 | /** 14 | * Denotes that an integer parameter, field or method return value is expected 15 | * to be a navigation resource reference (e.g. {@code R.navigation.flow}). 16 | */ 17 | @Documented 18 | @Retention(CLASS) 19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) 20 | public @interface NavigationRes 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/NonNull.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE; 8 | import static java.lang.annotation.ElementType.FIELD; 9 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 10 | import static java.lang.annotation.ElementType.METHOD; 11 | import static java.lang.annotation.ElementType.PACKAGE; 12 | import static java.lang.annotation.ElementType.PARAMETER; 13 | import static java.lang.annotation.RetentionPolicy.CLASS; 14 | 15 | /** 16 | * Denotes that a parameter, field or method return value can never be null. 17 | *
18 | * This is a marker annotation and it has no specific attributes. 19 | */ 20 | @Documented 21 | @Retention(CLASS) 22 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE}) 23 | public @interface NonNull 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/NotNull.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.FIELD; 8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 9 | import static java.lang.annotation.ElementType.METHOD; 10 | import static java.lang.annotation.ElementType.PARAMETER; 11 | import static java.lang.annotation.RetentionPolicy.CLASS; 12 | 13 | /** 14 | * Denotes that a parameter, field or method return value can never be null. 15 | *
16 | * This is a marker annotation and it has no specific attributes. 17 | */ 18 | @Documented 19 | @Retention(CLASS) 20 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) 21 | public @interface NotNull 22 | { 23 | String value() default ""; 24 | } 25 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/Nullable.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE; 8 | import static java.lang.annotation.ElementType.FIELD; 9 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 10 | import static java.lang.annotation.ElementType.METHOD; 11 | import static java.lang.annotation.ElementType.PACKAGE; 12 | import static java.lang.annotation.ElementType.PARAMETER; 13 | import static java.lang.annotation.RetentionPolicy.CLASS; 14 | 15 | /** 16 | * Denotes that a parameter, field or method return value can be null. 17 | *
18 | * When decorating a method call parameter, this denotes that the parameter can 19 | * legitimately be null and the method will gracefully deal with it. Typically 20 | * used on optional parameters. 21 | *
22 | * When decorating a method, this denotes the method might legitimately return 23 | * null. 24 | *
25 | * This is a marker annotation and it has no specific attributes. 26 | */ 27 | @Documented 28 | @Retention(CLASS) 29 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE}) 30 | public @interface Nullable 31 | { 32 | } 33 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/OWNERS: -------------------------------------------------------------------------------- 1 | tnorbye@google.com 2 | aurimas@google.com 3 | per-file UnsupportedAppUsage.java = mathewi@google.com, satayev@google.com, andreionea@google.com 4 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/PluralsRes.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.FIELD; 8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 9 | import static java.lang.annotation.ElementType.METHOD; 10 | import static java.lang.annotation.ElementType.PARAMETER; 11 | import static java.lang.annotation.RetentionPolicy.CLASS; 12 | 13 | /** 14 | * Denotes that an integer parameter, field or method return value is expected 15 | * to be a plurals resource reference. 16 | */ 17 | @Documented 18 | @Retention(CLASS) 19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) 20 | public @interface PluralsRes 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/ProductionVisibility.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | 5 | import static java.lang.annotation.RetentionPolicy.SOURCE; 6 | 7 | /** 8 | * Typedef for the {@link acom.zeoflow.zsdkndroidx.annotation.VisibleForTesting#otherwise} attribute. 9 | * 10 | * @hide 11 | */ 12 | @IntDef({VisibleForTesting.PRIVATE, 13 | VisibleForTesting.PACKAGE_PRIVATE, 14 | VisibleForTesting.PROTECTED, 15 | VisibleForTesting.NONE} 16 | ) 17 | @RestrictTo(RestrictTo.Scope.LIBRARY) 18 | @Retention(SOURCE) 19 | @interface ProductionVisibility 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/Px.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.FIELD; 8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 9 | import static java.lang.annotation.ElementType.METHOD; 10 | import static java.lang.annotation.ElementType.PARAMETER; 11 | import static java.lang.annotation.RetentionPolicy.CLASS; 12 | 13 | /** 14 | * Denotes that an integer parameter, field or method return value is expected 15 | * to represent a pixel dimension. 16 | */ 17 | @Documented 18 | @Retention(CLASS) 19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) 20 | @Dimension(unit = Dimension.PX) 21 | public @interface Px 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/RawRes.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.FIELD; 8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 9 | import static java.lang.annotation.ElementType.METHOD; 10 | import static java.lang.annotation.ElementType.PARAMETER; 11 | import static java.lang.annotation.RetentionPolicy.CLASS; 12 | 13 | /** 14 | * Denotes that an integer parameter, field or method return value is expected 15 | * to be a raw resource reference. 16 | */ 17 | @Documented 18 | @Retention(CLASS) 19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) 20 | public @interface RawRes 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/RequiresApi.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 8 | import static java.lang.annotation.ElementType.FIELD; 9 | import static java.lang.annotation.ElementType.METHOD; 10 | import static java.lang.annotation.ElementType.PACKAGE; 11 | import static java.lang.annotation.ElementType.TYPE; 12 | import static java.lang.annotation.RetentionPolicy.CLASS; 13 | 14 | /** 15 | * Denotes that the annotated element should only be called on the given API level or higher. 16 | * 17 | *
This is similar in purpose to the older {@code @TargetApi} annotation, but more clearly 18 | * expresses that this is a requirement on the caller, rather than being used to "suppress" warnings 19 | * within the method that exceed the {@code minSdkVersion}. 20 | */ 21 | @Documented 22 | @Retention(CLASS) 23 | @Target({TYPE, METHOD, CONSTRUCTOR, FIELD, PACKAGE}) 24 | public @interface RequiresApi 25 | { 26 | /** 27 | * The API level to require. Alias for {@link #api} which allows you to leave out the {@code 28 | * api=} part. 29 | */ 30 | @IntRange(from = 1) 31 | int value() default 1; 32 | 33 | /** 34 | * The API level to require 35 | */ 36 | @IntRange(from = 1) 37 | int api() default 1; 38 | } 39 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/RequiresFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 ZeoFlow SRL 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.zeoflow.annotation; 17 | 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.Target; 20 | 21 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 22 | import static java.lang.annotation.ElementType.FIELD; 23 | import static java.lang.annotation.ElementType.METHOD; 24 | import static java.lang.annotation.ElementType.TYPE; 25 | import static java.lang.annotation.RetentionPolicy.SOURCE; 26 | 27 | /** 28 | * Denotes that the annotated element requires one or more features. This is used to auto-generate 29 | * documentation, and more importantly: to ensure correct usage in application code, where lint and 30 | * Android Studio can check that calls marked with this annotation is surrounded by has-feature 31 | * calls, referenced via the {@link RequiresFeature#enforcement()} attribute. 32 | */ 33 | @Retention(SOURCE) 34 | @Target({TYPE, FIELD, METHOD, CONSTRUCTOR}) 35 | public @interface RequiresFeature 36 | { 37 | /** 38 | * The name of the feature that is required. 39 | */ 40 | String name(); 41 | 42 | /** 43 | * Defines the name of the method that should be called to check whether the feature is 44 | * available, using the same signature format as javadoc. 45 | * The feature checking method can have multiple parameters, but the feature name parameter must 46 | * be of type String and must also be the first String-type parameter. 47 | */ 48 | String enforcement(); 49 | } 50 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/Sampled.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 ZeoFlow SRL 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.zeoflow.annotation 18 | 19 | /** 20 | * Denotes that the annotated function is considered a sample function, and is linked to from the 21 | * KDoc of a source module that matches one of the two permitted directory structures: 22 | * 23 | * 1. The source module is an ancestor of the sample module, for example: 24 | * ``` 25 | * library/src/.. // Source file here that links to a sample 26 | * library/samples/src/.. // Sample file here that is linked to by the source file 27 | * ``` 28 | * 29 | * 2. The source module is a sibling to the sample module, for example: 30 | * ``` 31 | * library/library-subfeature/src/.. // Source file here that links to a sample 32 | * library/samples/src/.. // Sample file here that is linked to by the source file 33 | * ``` 34 | * 35 | * There are corresponding lint checks ensuring that functions referred to from KDoc with a @sample 36 | * tag are annotated with this annotation, and also to ensure that any functions annotated with this 37 | * annotation are linked to from a @sample tag. 38 | */ 39 | @Target(AnnotationTarget.FUNCTION) 40 | @Retention(AnnotationRetention.SOURCE) 41 | annotation class Sampled 42 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/SdkConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.zeoflow.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Indicates a constant field value should be exported to be used in the SDK tools. 26 | * 27 | * @hide 28 | */ 29 | @Target({ElementType.FIELD}) 30 | @Retention(RetentionPolicy.SOURCE) 31 | public @interface SdkConstant 32 | { 33 | SdkConstantType value(); 34 | 35 | enum SdkConstantType 36 | { 37 | ACTIVITY_INTENT_ACTION, BROADCAST_INTENT_ACTION, SERVICE_ACTION, INTENT_CATEGORY, FEATURE 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/Signature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.zeoflow.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * A system annotation used to provide the {@code Signature} attribute. 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.ANNOTATION_TYPE) 29 | @interface Signature 30 | { 31 | } 32 | 33 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/Size.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE; 8 | import static java.lang.annotation.ElementType.FIELD; 9 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 10 | import static java.lang.annotation.ElementType.METHOD; 11 | import static java.lang.annotation.ElementType.PARAMETER; 12 | import static java.lang.annotation.RetentionPolicy.CLASS; 13 | 14 | /** 15 | * Denotes that the annotated element should have a given size or length. 16 | * Note that "-1" means "unset". Typically used with a parameter or 17 | * return value of type array or collection. 18 | *
19 | * Example: 20 | *
{@code
21 | * public void getLocationInWindow(@Size(2) int[] location) {
22 | * ...
23 | * }
24 | * }
25 | */
26 | @Documented
27 | @Retention(CLASS)
28 | @Target({PARAMETER, LOCAL_VARIABLE, METHOD, FIELD, ANNOTATION_TYPE})
29 | public @interface Size
30 | {
31 | /**
32 | * An exact size (or -1 if not specified)
33 | */
34 | long value() default -1;
35 |
36 | /**
37 | * A minimum size, inclusive
38 | */
39 | long min() default Long.MIN_VALUE;
40 |
41 | /**
42 | * A maximum size, inclusive
43 | */
44 | long max() default Long.MAX_VALUE;
45 |
46 | /**
47 | * The size must be a multiple of this factor
48 | */
49 | long multiple() default 1;
50 | }
51 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/SourceDebugExtension.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * A system annotation used to provide the {@code SourceDebugExtension} attribute.
26 | */
27 | @Retention(RetentionPolicy.RUNTIME)
28 | @Target(ElementType.ANNOTATION_TYPE)
29 | @interface SourceDebugExtension
30 | {
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/StringDef.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Retention;
4 | import java.lang.annotation.Target;
5 |
6 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
7 | import static java.lang.annotation.RetentionPolicy.SOURCE;
8 |
9 | /**
10 | * Denotes that the annotated String element, represents a logical
11 | * type and that its value should be one of the explicitly named constants.
12 | * 13 | * Example: 14 | *
15 | * @Retention(SOURCE)
16 | * @StringDef({
17 | * POWER_SERVICE,
18 | * WINDOW_SERVICE,
19 | * LAYOUT_INFLATER_SERVICE
20 | * })
21 | * public @interface ServiceName {}
22 | * public static final String POWER_SERVICE = "power";
23 | * public static final String WINDOW_SERVICE = "window";
24 | * public static final String LAYOUT_INFLATER_SERVICE = "layout_inflater";
25 | * ...
26 | * public abstract Object getSystemService(@ServiceName String name);
27 | *
28 | */
29 | @Retention(SOURCE)
30 | @Target({ANNOTATION_TYPE})
31 | public @interface StringDef
32 | {
33 | /**
34 | * Defines the allowed constants for this element
35 | */
36 | String[] value() default {};
37 |
38 | /**
39 | * Whether any other values are allowed. Normally this is
40 | * not the case, but this allows you to specify a set of
41 | * expected constants, which helps code completion in the IDE
42 | * and documentation generation and so on, but without
43 | * flagging compilation warnings if other values are specified.
44 | */
45 | boolean open() default false;
46 | }
47 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/StringRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be a String resource reference (e.g. {@code android.R.string.ok}).
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface StringRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/StyleRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be a style resource reference (e.g. {@code android.R.style.TextAppearance}).
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface StyleRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/StyleableRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be a styleable resource reference (e.g. {@code android.R.styleable.TextView_text}).
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface StyleableRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/SuppressAutoDoc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.CONSTRUCTOR;
23 | import static java.lang.annotation.ElementType.FIELD;
24 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
25 | import static java.lang.annotation.ElementType.METHOD;
26 | import static java.lang.annotation.ElementType.PARAMETER;
27 | import static java.lang.annotation.ElementType.TYPE;
28 | import static java.lang.annotation.RetentionPolicy.SOURCE;
29 |
30 | /**
31 | * Denotes that any automatically generated documentation should be suppressed
32 | * for the annotated method, parameter, or field.
33 | *
34 | * @hide
35 | */
36 | @Retention(SOURCE)
37 | @Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
38 | public @interface SuppressAutoDoc
39 | {
40 | }
41 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/SuppressLint.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.zeoflow.annotation;
17 |
18 | import java.lang.annotation.Retention;
19 | import java.lang.annotation.RetentionPolicy;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.CONSTRUCTOR;
23 | import static java.lang.annotation.ElementType.FIELD;
24 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
25 | import static java.lang.annotation.ElementType.METHOD;
26 | import static java.lang.annotation.ElementType.PARAMETER;
27 | import static java.lang.annotation.ElementType.TYPE;
28 |
29 | /**
30 | * Indicates that Lint should ignore the specified warnings for the annotated element.
31 | */
32 | @Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
33 | @Retention(RetentionPolicy.CLASS)
34 | public @interface SuppressLint
35 | {
36 | /**
37 | * The set of warnings (identified by the lint issue id) that should be
38 | * ignored by lint. It is not an error to specify an unrecognized name.
39 | */
40 | String[] value();
41 | }
42 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/SystemService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.TYPE;
23 | import static java.lang.annotation.RetentionPolicy.SOURCE;
24 |
25 | /**
26 | * Description of a system service available through
27 | * {@link android.content.Context#getSystemService(Class)}. This is used to auto-generate
28 | * documentation explaining how to obtain a reference to the service.
29 | *
30 | * @hide
31 | */
32 | @Retention(SOURCE)
33 | @Target(TYPE)
34 | public @interface SystemService
35 | {
36 | /**
37 | * The string name of the system service that can be passed to
38 | * {@link android.content.Context#getSystemService(String)}.
39 | *
40 | * @see android.content.Context#getSystemServiceName(Class)
41 | */
42 | String value();
43 | }
44 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/TargetApi.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.zeoflow.annotation;
17 |
18 | import java.lang.annotation.Retention;
19 | import java.lang.annotation.RetentionPolicy;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.CONSTRUCTOR;
23 | import static java.lang.annotation.ElementType.FIELD;
24 | import static java.lang.annotation.ElementType.METHOD;
25 | import static java.lang.annotation.ElementType.TYPE;
26 |
27 | /**
28 | * Indicates that Lint should treat this type as targeting a given API level, no matter what the
29 | * project target is.
30 | */
31 | @Target({TYPE, METHOD, CONSTRUCTOR, FIELD})
32 | @Retention(RetentionPolicy.CLASS)
33 | public @interface TargetApi
34 | {
35 | /**
36 | * This sets the target api level for the type..
37 | */
38 | int value();
39 | }
40 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/TestApi.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
24 | import static java.lang.annotation.ElementType.CONSTRUCTOR;
25 | import static java.lang.annotation.ElementType.FIELD;
26 | import static java.lang.annotation.ElementType.METHOD;
27 | import static java.lang.annotation.ElementType.PACKAGE;
28 | import static java.lang.annotation.ElementType.TYPE;
29 |
30 | /**
31 | * Indicates an API is exposed for use by CTS.
32 | * 33 | * These APIs are not guaranteed to remain consistent release-to-release, 34 | * and are not for use by apps linking against the Android SDK. 35 | *
36 | * 37 | * @hide 38 | */ 39 | @Target({TYPE, FIELD, METHOD, CONSTRUCTOR, ANNOTATION_TYPE, PACKAGE}) 40 | @Retention(RetentionPolicy.SOURCE) 41 | public @interface TestApi 42 | { 43 | } 44 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/TestTarget.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.zeoflow.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Defines an annotation used be used within the TestInfo annotation. It 26 | * specifies a single method target for the test (but can be used multiple 27 | * times). 28 | * 29 | * @deprecated Obsolete. 30 | */ 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target({ElementType.ANNOTATION_TYPE}) 33 | @Deprecated 34 | public @interface TestTarget 35 | { 36 | 37 | /** 38 | * Specifies the name of the method that is being tested. 39 | */ 40 | String methodName() default ""; 41 | 42 | /** 43 | * Specifies the name of a concept being tested. Use this if 44 | * {@code methodName} is not accurate enough. E.g. for 45 | * {@link java.util.regex.Pattern#compile(String)} {@code methodName} is not 46 | * sufficient since the String contains a pattern with its own syntax which 47 | * has to be tested with different aspects. Areas concerned are e.g. JDBC 48 | * (SELECT, INSERT, UPDATE, DELETE, ...), regex (character sets, 49 | * operators,...), formatters (DecimalFormat, DateFormat, ChoiceFormat, 50 | * ...), ... 51 | */ 52 | String conceptName() default ""; 53 | 54 | /** 55 | * Specifies the signature of the method that is being tested, in terms of 56 | * Java classes. 57 | */ 58 | Class>[] methodArgs() default {}; 59 | 60 | } 61 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/TestTargetClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.zeoflow.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Defines an annotation for test classes that allows to link them to the class 26 | * that is being tested. The current assumption is that the test are somewhat 27 | * organized according to the API classes they test. Might be too strict for 28 | * some cases. 29 | * 30 | * @deprecated Obsolete. 31 | */ 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target({ElementType.TYPE}) 34 | @Deprecated 35 | public @interface TestTargetClass 36 | { 37 | 38 | /** 39 | * Specifies the class being tested. 40 | */ 41 | Class> value(); 42 | } 43 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/Throws.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.zeoflow.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * A system annotation used to provide the {@code Throws} attribute. 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.ANNOTATION_TYPE) 29 | @interface Throws 30 | { 31 | } 32 | 33 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/TransitionRes.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.FIELD; 8 | import static java.lang.annotation.ElementType.METHOD; 9 | import static java.lang.annotation.ElementType.PARAMETER; 10 | import static java.lang.annotation.RetentionPolicy.SOURCE; 11 | 12 | /** 13 | * Denotes that an integer parameter, field or method return value is expected 14 | * to be a transition resource reference. 15 | */ 16 | @Documented 17 | @Retention(SOURCE) 18 | @Target({METHOD, PARAMETER, FIELD}) 19 | public @interface TransitionRes 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/UiThread.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.Target; 6 | 7 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 8 | import static java.lang.annotation.ElementType.METHOD; 9 | import static java.lang.annotation.ElementType.PARAMETER; 10 | import static java.lang.annotation.ElementType.TYPE; 11 | import static java.lang.annotation.RetentionPolicy.CLASS; 12 | 13 | /** 14 | * Denotes that the annotated method or constructor should only be called on the UI thread. 15 | * If the annotated element is a class, then all methods in the class should be called 16 | * on the UI thread. 17 | *18 | * Example: 19 | *
20 | * @UiThread
21 | *
22 | * public abstract void setText(@NonNull String text) { ... }
23 | *
24 | *
25 | * Note: Ordinarily, an app's UI thread is also the main 26 | * thread. However, under special circumstances, an app's UI thread 27 | * might not be its main thread; for more information, see 28 | * Thread 29 | * annotations. 30 | * 31 | * @see com.zeoflow.annotation.MainThread 32 | */ 33 | @Documented 34 | @Retention(CLASS) 35 | @Target({METHOD, CONSTRUCTOR, TYPE, PARAMETER}) 36 | public @interface UiThread 37 | { 38 | } 39 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/UserHandleAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.zeoflow.annotation; 17 | 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.Target; 20 | 21 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 22 | import static java.lang.annotation.ElementType.METHOD; 23 | import static java.lang.annotation.ElementType.PACKAGE; 24 | import static java.lang.annotation.ElementType.TYPE; 25 | import static java.lang.annotation.RetentionPolicy.SOURCE; 26 | 27 | /** 28 | * Indicates an API that uses {@code context.getUser} or {@code context.getUserId} 29 | * to operate across users (as the user associated with the context) 30 | *
31 | * To create a {@link android.content.Context} associated with a different user, 32 | * use {@link android.content.Context#createContextAsUser} or 33 | * {@link android.content.Context#createPackageContextAsUser} 34 | *
35 | * Example: 36 | *
{@code
37 | * {@literal @}UserHandleAware
38 | * public abstract PackageInfo getPackageInfo({@literal @}NonNull String packageName,
39 | * {@literal @}PackageInfoFlags int flags) throws NameNotFoundException;
40 | * }
41 | *
42 | * @memberDoc This method uses {@linkplain android.content.Context#getUser}
43 | * or {@linkplain android.content.Context#getUserId} to execute across users.
44 | * @hide
45 | */
46 | @Retention(SOURCE)
47 | @Target({TYPE, METHOD, CONSTRUCTOR, PACKAGE})
48 | public @interface UserHandleAware
49 | {
50 | }
51 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/UserIdInt.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.FIELD;
23 | import static java.lang.annotation.ElementType.METHOD;
24 | import static java.lang.annotation.ElementType.PARAMETER;
25 | import static java.lang.annotation.RetentionPolicy.SOURCE;
26 |
27 | /**
28 | * Denotes that the annotated element is a multi-user user ID. This is
29 | * not the same as a UID.
30 | *
31 | * @hide
32 | */
33 | @Retention(SOURCE)
34 | @Target({METHOD, PARAMETER, FIELD})
35 | public @interface UserIdInt
36 | {
37 | }
38 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/VisibleForNative.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 |
22 | /**
23 | * Denotes that the class, method or field has its visibility relaxed so
24 | * that native code can access it.
25 | */
26 | @Retention(RetentionPolicy.CLASS)
27 | public @interface VisibleForNative
28 | {
29 | }
30 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/VisibleForTesting.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Retention;
4 |
5 | import static java.lang.annotation.RetentionPolicy.CLASS;
6 |
7 | /**
8 | * Denotes that the class, method or field has its visibility relaxed, so that it is more widely
9 | * visible than otherwise necessary to make code testable.
10 | * 11 | * You can optionally specify what the visibility should have been if not for 12 | * testing; this allows tools to catch unintended access from within production 13 | * code. 14 | *
15 | * Example: 16 | *
17 | * @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
18 | * public String printDiagnostics() { ... }
19 | *
20 | * 21 | * If not specified, the intended visibility is assumed to be private. 22 | */ 23 | @Retention(CLASS) 24 | public @interface VisibleForTesting 25 | { 26 | /** 27 | * The annotated element would have "private" visibility 28 | */ 29 | int PRIVATE = 2; // Happens to be the same as Modifier.PRIVATE 30 | /** 31 | * The annotated element would have "package private" visibility 32 | */ 33 | int PACKAGE_PRIVATE = 3; 34 | /** 35 | * The annotated element would have "protected" visibility 36 | */ 37 | int PROTECTED = 4; // Happens to be the same as Modifier.PROTECTED 38 | /** 39 | * The annotated element should never be called from production code, only from tests. 40 | *
41 | * This is equivalent to {@code @RestrictTo.Scope.TESTS}. 42 | */ 43 | int NONE = 5; 44 | 45 | /** 46 | * The visibility the annotated element would have if it did not need to be made visible for 47 | * testing. 48 | */ 49 | @ProductionVisibility 50 | int otherwise() default PRIVATE; 51 | } 52 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/Widget.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.zeoflow.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Indicates a class is a widget usable by application developers to create UI. 26 | *
27 | * This must be used in cases where: 28 | *
android.widgetandroid.view.ViewGroup18 | * Example: 19 | *
20 | * @WorkerThread
21 | * protected abstract FilterResults performFiltering(CharSequence constraint);
22 | *
23 | */
24 | @Documented
25 | @Retention(CLASS)
26 | @Target({METHOD, CONSTRUCTOR, TYPE, PARAMETER})
27 | public @interface WorkerThread
28 | {
29 | }
30 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/XmlRes.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.FIELD;
8 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.ElementType.PARAMETER;
11 | import static java.lang.annotation.RetentionPolicy.CLASS;
12 |
13 | /**
14 | * Denotes that an integer parameter, field or method return value is expected
15 | * to be an XML resource reference.
16 | */
17 | @Documented
18 | @Retention(CLASS)
19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
20 | public @interface XmlRes
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/compat/VersionCodes.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.zeoflow.annotation.compat;
17 |
18 | import com.zeoflow.annotation.CorePlatformApi;
19 | import com.zeoflow.annotation.IntraCoreApi;
20 |
21 | /**
22 | * Version code constants for Android releases.
23 | *
24 | * Note: The constants are "public static final int" and are intended for use with annotations 25 | * so must stay compile-time resolvable and inline-able. They must match the values from 26 | * framework's android.os.Build.VERSION_CODES class. 27 | * 28 | *
Only historically fixed API levels should be included or abstract concepts like "CURRENT" 29 | * should be added. Do not predict API levels. 30 | *
31 | * {@hide}
32 | */
33 | @CorePlatformApi
34 | @IntraCoreApi
35 | public class VersionCodes
36 | {
37 |
38 | /**
39 | * The version code for Android Oreo (API version 26).
40 | */
41 | @CorePlatformApi
42 | @IntraCoreApi
43 | public static final int O = 26;
44 | /**
45 | * The version code for Android Pie (API version 28).
46 | */
47 | @CorePlatformApi
48 | @IntraCoreApi
49 | public static final int P = 28;
50 | /**
51 | * The version code for Android Q (API version 29).
52 | */
53 | @CorePlatformApi
54 | @IntraCoreApi
55 | public static final int Q = 29;
56 |
57 | private VersionCodes()
58 | {
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/annotation/experimental/UseExperimental.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 ZeoFlow SRL
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zeoflow.annotation.experimental
18 |
19 | import kotlin.reflect.KClass
20 |
21 | /**
22 | * Allows use of an experimental API denoted by the given markers in the annotated file,
23 | * declaration, or expression. If a declaration is annotated with [UseExperimental], its
24 | * usages are **not** required to opt-in to that experimental API.
25 | */
26 | @Retention(AnnotationRetention.BINARY)
27 | @Target(
28 | AnnotationTarget.CLASS,
29 | AnnotationTarget.PROPERTY,
30 | AnnotationTarget.LOCAL_VARIABLE,
31 | AnnotationTarget.VALUE_PARAMETER,
32 | AnnotationTarget.CONSTRUCTOR,
33 | AnnotationTarget.FUNCTION,
34 | AnnotationTarget.PROPERTY_GETTER,
35 | AnnotationTarget.PROPERTY_SETTER,
36 | AnnotationTarget.FILE,
37 | AnnotationTarget.TYPEALIAS
38 | )
39 | annotation class UseExperimental(
40 | /**
41 | * Defines the experimental API(s) whose usage this annotation allows.
42 | */
43 | vararg val markerClass: KClass
27 | * This simply prints out all logs to Logcat by using standard {@link Log} class.
28 | */
29 | public class LogcatLogStrategy implements LogStrategy
30 | {
31 |
32 | static final String DEFAULT_TAG = "NO_TAG";
33 |
34 | @Override
35 | public void log(int priority, @Nullable String tag, @NonNull String message)
36 | {
37 | checkNotNull(message);
38 |
39 | if (tag == null)
40 | {
41 | tag = DEFAULT_TAG;
42 | }
43 |
44 | Log.println(priority, tag, message);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/log/Printer.java:
--------------------------------------------------------------------------------
1 | // Copyright 2021 ZeoFlow SRL
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package com.zeoflow.log;
16 |
17 | import com.zeoflow.annotation.NonNull;
18 | import com.zeoflow.annotation.Nullable;
19 |
20 | /**
21 | * A proxy interface to enable additional operations.
22 | * Contains all possible Log message usages.
23 | */
24 | public interface Printer
25 | {
26 |
27 | void addAdapter(@NonNull LogAdapter adapter);
28 |
29 | Printer t(@Nullable String tag);
30 |
31 | void d(@NonNull String message, @Nullable Object... args);
32 |
33 | void d(@Nullable Object object);
34 |
35 | void e(@NonNull String message, @Nullable Object... args);
36 |
37 | void e(@Nullable Throwable throwable, @NonNull String message, @Nullable Object... args);
38 |
39 | void w(@NonNull String message, @Nullable Object... args);
40 |
41 | void i(@NonNull String message, @Nullable Object... args);
42 |
43 | void v(@NonNull String message, @Nullable Object... args);
44 |
45 | void wtf(@NonNull String message, @Nullable Object... args);
46 |
47 | /**
48 | * Formats the given json content and print it
49 | */
50 | void json(@Nullable String json);
51 |
52 | /**
53 | * Formats the given xml content and print it
54 | */
55 | void xml(@Nullable String xml);
56 |
57 | void log(int priority, @Nullable String tag, @Nullable String message, @Nullable Throwable throwable);
58 |
59 | void clearLogAdapters();
60 | }
61 |
--------------------------------------------------------------------------------
/flow-kit/src/main/java/com/zeoflow/model/Extra.java:
--------------------------------------------------------------------------------
1 | package com.zeoflow.model;
2 |
3 | import com.zeoflow.zson.JsonElement;
4 |
5 | public class Extra
6 | {
7 | private String key;
8 | private JsonElement value;
9 |
10 | public