├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .idea ├── codeStyles │ └── Project.xml └── dictionaries │ └── defualt.xml ├── .zeobot ├── config.yml └── contributors.src ├── LICENSE ├── README.md ├── android-wait-for-emulator ├── build.gradle ├── buildSrc ├── .gitignore └── upload.gradle ├── catalog ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── zeoflow │ │ └── sample │ │ └── MainActivity.java │ └── res │ ├── drawable │ ├── ic_launcher_background.xml │ └── ic_launcher_foreground.xml │ ├── layout │ └── activity_main.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── docs ├── README.md ├── building-from-source.md ├── contributing.md ├── contributors.md └── getting-started.md ├── flow-kit ├── .gitignore ├── build.gradle ├── gradle.properties ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── zeoflow │ │ ├── annotation │ │ ├── AnimRes.java │ │ ├── AnimatorRes.java │ │ ├── AnnotationDefault.java │ │ ├── AnyRes.java │ │ ├── AnyThread.java │ │ ├── AppIdInt.java │ │ ├── ArrayRes.java │ │ ├── AttrRes.java │ │ ├── BinderThread.java │ │ ├── BoolRes.java │ │ ├── BroadcastBehavior.java │ │ ├── BytesLong.java │ │ ├── CallSuper.java │ │ ├── CallbackExecutor.java │ │ ├── CheckResult.java │ │ ├── ChecksSdkIntAtLeast.java │ │ ├── ColorInt.java │ │ ├── ColorLong.java │ │ ├── ColorRes.java │ │ ├── Colour.java │ │ ├── Condemned.java │ │ ├── ContentView.java │ │ ├── CorePlatformApi.java │ │ ├── Credential.java │ │ ├── CurrentTimeMillisLong.java │ │ ├── CurrentTimeSecondsLong.java │ │ ├── DimenRes.java │ │ ├── Dimension.java │ │ ├── DimensionUnit.java │ │ ├── DoNotInline.java │ │ ├── DrawableRes.java │ │ ├── DurationMillisLong.java │ │ ├── ElapsedRealtimeLong.java │ │ ├── EnclosingClass.java │ │ ├── EnclosingMethod.java │ │ ├── ErrorCode.java │ │ ├── ErrorMessage.java │ │ ├── FloatRange.java │ │ ├── FontRes.java │ │ ├── ForceInline.java │ │ ├── FractionRes.java │ │ ├── GuardedBy.java │ │ ├── HalfFloat.java │ │ ├── Hide.java │ │ ├── IdRes.java │ │ ├── Immutable.java │ │ ├── InnerClass.java │ │ ├── InspectableProperty.java │ │ ├── IntDef.java │ │ ├── IntRange.java │ │ ├── IntegerRes.java │ │ ├── InterpolatorRes.java │ │ ├── IntraCoreApi.java │ │ ├── Keep.java │ │ ├── KeepForApi.java │ │ ├── KnownFailure.java │ │ ├── LayoutRes.java │ │ ├── LongDef.java │ │ ├── MainThread.java │ │ ├── MemberClasses.java │ │ ├── MenuRes.java │ │ ├── MethodParameters.java │ │ ├── NavigationRes.java │ │ ├── NonNull.java │ │ ├── NotNull.java │ │ ├── Nullable.java │ │ ├── OWNERS │ │ ├── PluralsRes.java │ │ ├── ProductionVisibility.java │ │ ├── Px.java │ │ ├── RawRes.java │ │ ├── RequiresApi.java │ │ ├── RequiresFeature.java │ │ ├── RequiresPermission.java │ │ ├── RestrictTo.java │ │ ├── Sampled.kt │ │ ├── SdkConstant.java │ │ ├── Signature.java │ │ ├── Size.java │ │ ├── SourceDebugExtension.java │ │ ├── StringDef.java │ │ ├── StringRes.java │ │ ├── StyleRes.java │ │ ├── StyleableRes.java │ │ ├── SuppressAutoDoc.java │ │ ├── SuppressLint.java │ │ ├── SystemApi.java │ │ ├── SystemService.java │ │ ├── TargetApi.java │ │ ├── TestApi.java │ │ ├── TestTarget.java │ │ ├── TestTargetClass.java │ │ ├── Throws.java │ │ ├── TransitionRes.java │ │ ├── UiThread.java │ │ ├── UnsupportedAppUsage.java │ │ ├── UserHandleAware.java │ │ ├── UserIdInt.java │ │ ├── VisibleForNative.java │ │ ├── VisibleForTesting.java │ │ ├── Widget.java │ │ ├── WorkerThread.java │ │ ├── XmlRes.java │ │ ├── codegen │ │ │ └── CovariantReturnType.java │ │ ├── compat │ │ │ └── VersionCodes.java │ │ ├── experimental │ │ │ ├── Experimental.kt │ │ │ └── UseExperimental.kt │ │ └── optimization │ │ │ ├── CriticalNative.java │ │ │ ├── DeadReferenceSafe.java │ │ │ ├── FastNative.java │ │ │ └── ReachabilitySensitive.java │ │ ├── app │ │ ├── Activity.java │ │ ├── ActivityBuilder.java │ │ ├── Entity.java │ │ ├── Fragment.java │ │ ├── FragmentActivity.java │ │ └── Gist.java │ │ ├── compressor │ │ ├── Compressor.kt │ │ ├── JavaCompressor.kt │ │ ├── Util.kt │ │ └── constraint │ │ │ ├── Compression.kt │ │ │ ├── Constraint.kt │ │ │ ├── DefaultConstraint.kt │ │ │ ├── DestinationConstraint.kt │ │ │ ├── FormatConstraint.kt │ │ │ ├── QualityConstraint.kt │ │ │ ├── ResolutionConstraint.kt │ │ │ └── SizeConstraint.kt │ │ ├── core │ │ ├── manage │ │ │ ├── DataCollectionDefaultChange.java │ │ │ ├── PlatformInfo.java │ │ │ ├── StringResourceValueReader.java │ │ │ └── StringsVerify.java │ │ └── utils │ │ │ ├── Objects.java │ │ │ └── Preconditions.java │ │ ├── crash │ │ └── reporter │ │ │ ├── CrashReporter.java │ │ │ ├── adapter │ │ │ ├── CrashLogAdapter.java │ │ │ └── MainPagerAdapter.java │ │ │ ├── service │ │ │ └── NotificationService.java │ │ │ ├── ui │ │ │ ├── CrashLogFragment.java │ │ │ ├── CrashReporterActivity.java │ │ │ ├── ExceptionLogFragment.java │ │ │ └── LogMessageActivity.java │ │ │ └── utils │ │ │ ├── AppUtils.java │ │ │ ├── Constants.java │ │ │ ├── CrashReporterException.java │ │ │ ├── CrashReporterExceptionHandler.java │ │ │ ├── CrashReporterNotInitializedException.java │ │ │ ├── CrashUtil.java │ │ │ ├── FileUtils.java │ │ │ └── SimplePageChangeListener.java │ │ ├── flow │ │ └── kit │ │ │ └── DefPackage.java │ │ ├── initializer │ │ ├── ZeoFlowApp.java │ │ ├── ZeoFlowInitProvider.java │ │ └── ZeoFlowOptions.java │ │ ├── log │ │ ├── AndroidLogAdapter.java │ │ ├── CsvFormatStrategy.java │ │ ├── DiskLogAdapter.java │ │ ├── DiskLogStrategy.java │ │ ├── FormatStrategy.java │ │ ├── Log.java │ │ ├── LogAdapter.java │ │ ├── LogPrinter.java │ │ ├── LogStrategy.java │ │ ├── LogcatLogStrategy.java │ │ ├── PrettyFormatStrategy.java │ │ ├── Printer.java │ │ └── Utils.java │ │ ├── model │ │ └── Extra.java │ │ ├── os │ │ └── UserManagerCompat.java │ │ ├── palette │ │ ├── ColorCutQuantizer.java │ │ ├── Palette.java │ │ └── Target.java │ │ └── utils │ │ ├── BitmapCompat.java │ │ ├── BitmapUtils.java │ │ ├── BlendModeColorFilterCompat.java │ │ ├── BlendModeCompat.java │ │ ├── BlendModeUtils.java │ │ ├── ColorUtils.java │ │ ├── ContentCompat.java │ │ ├── FileUtil.java │ │ ├── ImageUtil.java │ │ ├── StatusBarUtil.java │ │ ├── ViewSizeUtils.java │ │ └── string │ │ ├── LineWrapper.java │ │ ├── StringCreator.java │ │ ├── StringWriter.java │ │ └── Util.java │ └── res │ ├── drawable-hdpi │ └── zf_cr_ic_crash_notification.png │ ├── drawable-mdpi │ └── zf_cr_ic_crash_notification.png │ ├── drawable-xhdpi │ └── zf_cr_ic_crash_notification.png │ ├── drawable-xxhdpi │ └── zf_cr_ic_crash_notification.png │ ├── drawable-xxxhdpi │ └── zf_cr_ic_crash_notification.png │ ├── drawable │ ├── zf_cr_background_splash_crash.xml │ ├── zf_cr_ic_menu_delete_white_24dp.xml │ ├── zf_cr_ic_menu_share_white_24dp.xml │ └── zf_cr_ic_warning_black_24dp.xml │ ├── font │ └── font.ttf │ ├── layout │ ├── zf_cr_activity_log_message.xml │ ├── zf_cr_crash_log.xml │ ├── zf_cr_crash_reporter_activity.xml │ ├── zf_cr_custom_item.xml │ └── zf_cr_exception_log.xml │ ├── values │ ├── colors.xml │ ├── ids.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ └── provider_paths.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pull_request_template.md └── settings.gradle /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [TeodorHMX1] 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[Component name] Short description of issue" 5 | labels: bug 6 | assignees: 7 | 8 | --- 9 | 10 | **Description:** Full description of issue here 11 | 12 | **Expected behavior:** Screenshots and/or description of expected behavior 13 | 14 | **Source code:** The code snippet which is causing this issue. Please consider attaching a minimal sample app that reproduces the issue. 15 | 16 | **Android API version:** Android API version here 17 | 18 | ###### To help us triage faster, please check to make sure you are using the [latest version](https://github.com/zeoflow/flow-kit/releases) of the library. 19 | ###### We also happily accept [pull requests](https://github.com/zeoflow/flow-kit/pulls). 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[Component name] Short description of request" 5 | labels: feature 6 | assignees: 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | 22 | ###### We also happily accept [pull requests](https://github.com/zeoflow/flow-kit/pulls). 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.aar 4 | *.ap_ 5 | *.aab 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | # Uncomment the following line in case you need and you don't have the release build type files in your app 18 | # release/ 19 | 20 | # Gradle files 21 | .gradle/ 22 | build/ 23 | 24 | # Local configuration file (sdk path, etc) 25 | local.properties 26 | 27 | # Proguard folder generated by Eclipse 28 | proguard/ 29 | 30 | # Log Files 31 | *.log 32 | 33 | # Android Studio Navigation editor temp files 34 | .navigation/ 35 | 36 | # Android Studio captures folder 37 | captures/ 38 | 39 | # IntelliJ 40 | *.iml 41 | 42 | # Idea Folder 43 | .idea/* 44 | # Include dictionary 45 | !.idea/dictionaries 46 | # Include code-style 47 | !.idea/codeStyles 48 | 49 | # Keystore files 50 | # Uncomment the following lines if you do not want to check your keystore files in. 51 | *.jks 52 | *.keystore 53 | 54 | # External native build folder generated in Android Studio 2.2 and later 55 | .externalNativeBuild 56 | .cxx/ 57 | 58 | # Google Services (e.g. APIs or Firebase) 59 | # google-services.json 60 | 61 | # Freeline 62 | freeline.py 63 | freeline/ 64 | freeline_project_description.json 65 | 66 | # fastlane 67 | fastlane/report.xml 68 | fastlane/Preview.html 69 | fastlane/screenshots 70 | fastlane/test_output 71 | fastlane/readme.md 72 | 73 | # Version control 74 | vcs.xml 75 | 76 | # lint 77 | lint/intermediates/ 78 | lint/generated/ 79 | lint/outputs/ 80 | lint/tmp/ 81 | # lint/reports/ 82 | -------------------------------------------------------------------------------- /.idea/dictionaries/defualt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | anidero 5 | zeoflow 6 | 7 | 8 | -------------------------------------------------------------------------------- /.zeobot/contributors.src: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "flow-kit", 3 | "projectOwner": "zeoflow", 4 | "repoType": "github", 5 | "repoHost": "https://github.com", 6 | "contributors": [ 7 | { 8 | "login": "TeodorHMX1", 9 | "name": "Teodor G.", 10 | "avatar_url": "https://avatars0.githubusercontent.com/u/22307006?v=4", 11 | "profile": "http://team.zeoflow.com/teodor_g", 12 | "contributions": [ 13 | "code", 14 | "doc", 15 | "infra", 16 | "maintenance" 17 | ] 18 | }, 19 | { 20 | "login": "teogor", 21 | "name": "Teogor", 22 | "avatar_url": "https://avatars2.githubusercontent.com/u/70129978?v=4", 23 | "profile": "https://github.com/teogor", 24 | "contributions": [ 25 | "code" 26 | ] 27 | } 28 | ], 29 | "files": [ 30 | "README.md", 31 | "docs/contributors.md" 32 | ], 33 | "contributorsPerLine": 7 34 | } 35 | -------------------------------------------------------------------------------- /android-wait-for-emulator: -------------------------------------------------------------------------------- 1 | set +e 2 | 3 | bootanim="" 4 | failcounter=0 5 | timeout_in_sec=360 6 | 7 | until [[ "$bootanim" =~ "stopped" ]]; do 8 | bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &` 9 | if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline" 10 | || "$bootanim" =~ "running" ]]; then 11 | let "failcounter += 1" 12 | echo "Waiting for emulator to start" 13 | if [[ $failcounter -gt timeout_in_sec ]]; then 14 | echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator" 15 | exit 1 16 | fi 17 | fi 18 | sleep 1 19 | done 20 | 21 | echo "Emulator is ready" 22 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.4.32' 5 | 6 | repositories { 7 | maven { 8 | url 'https://maven.google.com/' 9 | name 'Google' 10 | } 11 | google() 12 | jcenter() 13 | } 14 | dependencies { 15 | classpath 'com.android.tools.build:gradle:4.1.3' 16 | classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' 17 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5' 18 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | maven { url 'https://maven.fabric.io/public' } 25 | maven { url 'https://jitpack.io' } 26 | mavenCentral() 27 | google() 28 | jcenter() 29 | } 30 | } 31 | 32 | task clean(type: Delete) { 33 | delete rootProject.buildDir 34 | } 35 | 36 | ext { 37 | compileSdkVersion = 30 38 | buildToolsVersion = '30.0.1' 39 | minSdkVersion = 21 40 | targetSdkVersion = 30 41 | versionCode = 1 42 | versionName = "1.5.2" 43 | } 44 | -------------------------------------------------------------------------------- /buildSrc/.gitignore: -------------------------------------------------------------------------------- 1 | # SIGNING KEYS 2 | *.gpg 3 | 4 | # Key Credentials 5 | gradle.properties -------------------------------------------------------------------------------- /catalog/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /catalog/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion rootProject.ext.compileSdkVersion 5 | buildToolsVersion rootProject.ext.buildToolsVersion 6 | defaultConfig { 7 | applicationId "com.zeoflow.flow.kit" 8 | minSdkVersion rootProject.ext.minSdkVersion 9 | targetSdkVersion rootProject.ext.targetSdkVersion 10 | versionCode rootProject.ext.versionCode 11 | versionName rootProject.ext.versionName 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | 20 | lintOptions { 21 | abortOnError false 22 | } 23 | compileOptions { 24 | sourceCompatibility JavaVersion.VERSION_1_8 25 | targetCompatibility JavaVersion.VERSION_1_8 26 | } 27 | } 28 | 29 | dependencies { 30 | implementation fileTree(dir: "libs", include: ["*.jar"]) 31 | implementation project(':flow-kit') 32 | implementation 'com.zeoflow:material-elements:2.5.0' 33 | } 34 | -------------------------------------------------------------------------------- /catalog/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/jakubkinst/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /catalog/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /catalog/src/main/java/com/zeoflow/sample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.sample; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.annotation.Nullable; 6 | 7 | import com.zeoflow.app.Activity; 8 | import com.zeoflow.utils.string.StringCreator; 9 | 10 | public class MainActivity extends Activity 11 | { 12 | 13 | @Override 14 | protected void onCreate(@Nullable Bundle savedInstanceState) 15 | { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_main); 18 | 19 | StringCreator string = StringCreator.creator() 20 | .add("double strings $S$S", String.class, MainActivity.class) 21 | .add("upper string multiple 's' $S:Ssss", String.class) 22 | .add("upper string $S:S's", String.class) 23 | .add("lower string $S:s", String.class) 24 | .add("name $N", "String.class") 25 | .add("upper name $N:S's", "String.class") 26 | .add("lower name $N:s's", "String.class") 27 | .add("class full package $C", String.class) 28 | .add("class name only $c", String.class) 29 | .create(); 30 | log(string.asString()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /catalog/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /catalog/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/catalog/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/catalog/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/catalog/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/catalog/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/catalog/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/catalog/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/catalog/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/catalog/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/catalog/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /catalog/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/catalog/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /catalog/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /catalog/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FF9800 4 | #FF9800 5 | #FFFFFF 6 | 7 | -------------------------------------------------------------------------------- /catalog/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /catalog/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Flow Kit 3 | 4 | -------------------------------------------------------------------------------- /catalog/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Flow Kit - Android Library 2 | 3 | ## Intro 4 | An Android Library that comes with useful features and components 5 | 6 | ## Getting Started 7 | For information on how to get started with Flow Kit, 8 | take a look at our [Getting Started](docs/getting-started.md) guide. 9 | 10 | ## Submitting Bugs or Feature Requests 11 | Bugs or feature requests should be submitted at our [GitHub Issues section](https://github.com/zeoflow/flow-kit/issues). 12 | 13 | ## How does it work? 14 | ### 1. Depend on our library 15 | 16 | Flow Kit for Android is available through Google's Maven Repository. 17 | To use it: 18 | 19 | 1. Open the `build.gradle` file for your application. 20 | 2. Make sure that the `repositories` section includes Google's Maven Repository 21 | `google()`. For example: 22 | 23 | ```groovy 24 | allprojects { 25 | repositories { 26 | google() 27 | jcenter() 28 | } 29 | } 30 | ``` 31 | 32 | 3. Add the library to the `dependencies` section: 33 | 34 | ```groovy 35 | dependencies { 36 | // ... 37 | implementation 'com.zeoflow:flow-kit:' 38 | // ... 39 | } 40 | ``` 41 | 42 | ## License 43 | Copyright 2020 ZeoFlow 44 | 45 | Licensed under the Apache License, Version 2.0 (the "License"); 46 | you may not use this file except in compliance with the License. 47 | You may obtain a copy of the License at 48 | 49 | http://www.apache.org/licenses/LICENSE-2.0 50 | 51 | Unless required by applicable law or agreed to in writing, software 52 | distributed under the License is distributed on an "AS IS" BASIS, 53 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 54 | See the License for the specific language governing permissions and 55 | limitations under the License. -------------------------------------------------------------------------------- /docs/building-from-source.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | # Building From the Latest Source 9 | 10 | If you'll be contributing to the library, or need a version newer than what has 11 | been released, Flow Kit from ZeoFlow can also be built from source. 12 | To do so: 13 | 14 | Clone the repository: 15 | 16 | ```sh 17 | git clone https://github.com/zeoflow/flow-kit.git 18 | ``` 19 | 20 | Then, build the library's AARs using Gradle -------------------------------------------------------------------------------- /docs/contributing.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | # General Contributing Guidelines 9 | 10 | The Flow Kit contributing policies and procedures can be found in the 11 | main Flow Kit documentation repository’s 12 | [contributing page](https://github.com/zeoflow/flow-kit/blob/CONTRIBUTING.md). 13 | 14 | To make a contribution, you'll need to be able to build the library from source 15 | and run our tests. 16 | 17 | ## Building From Source 18 | 19 | Take a look at our [instructions](building-from-source.md) on how to build the 20 | library from source. 21 | 22 | ## Running Tests 23 | 24 | Flow Kit for Android has JVM tests as well as Emulator tests. 25 | 26 | To run the JVM tests, do: 27 | 28 | ```sh 29 | ./gradlew test 30 | ``` 31 | 32 | To run the emulator tests, ensure you have 33 | [a virtual device set up](https://developer.android.com/studio/run/managing-avds.html) 34 | and do: 35 | 36 | ```sh 37 | ./gradlew connectedAndroidTest 38 | ``` 39 | 40 | ## Code Conventions 41 | 42 | Since we all want to spend more time coding and less time fiddling with 43 | whitespace, Flow Kit uses code conventions and styles to 44 | encourage consistency. Code with a consistent style is easier (and less 45 | error-prone!) to review, maintain, and understand. 46 | 47 | #### Be consistent 48 | 49 | If the style guide is not explicit about a particular situation, the cardinal 50 | rule is to **be consistent**. For example, take a look at the surrounding code 51 | and follow its lead, or look for similar cases elsewhere in the codebase. -------------------------------------------------------------------------------- /docs/contributors.md: -------------------------------------------------------------------------------- 1 | 2 | ## 🏆 Contributors 🏆 3 | 4 | 5 | 6 | 7 | ### :zap: Contributors List :zap: 8 |

9 | 10 |

11 | 12 | --- 13 | ### :pushpin: Teodor G. ([@TeodorHMX1](https://github.com/TeodorHMX1)) 14 | #### Contributions: 15 | - :bust_in_silhouette::computer: Code 16 | - :open_book::pencil2: Documentation 17 | - :construction::gear: Infrastructure (Hosting, Build-Tools, etc) 18 | - :bust_in_silhouette::toolbox: Maintenance 19 | 20 | --- 21 | 22 | ### :pushpin: Teogor ([@teogor](https://github.com/teogor)) 23 | #### Contributions: 24 | - :bust_in_silhouette::computer: Code 25 | 26 | 27 | 28 | ###### Contributors list generated by [` @zeobot[bot] `](https://github.com/apps/zeobot) 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/getting-started.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | ### 1. Depend on our library 9 | 10 | Flow Kit for Android is available through Google's Maven Repository. 11 | To use it: 12 | 13 | 1. Open the `build.gradle` file for your application. 14 | 2. Make sure that the `repositories` section includes Google's Maven Repository 15 | `google()`. For example: 16 | 17 | ```groovy 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | } 23 | } 24 | ``` 25 | 26 | 3. Add the library to the `dependencies` section: 27 | 28 | ```groovy 29 | dependencies { 30 | // ... 31 | implementation 'com.zeoflow:flow-kit:' 32 | // ... 33 | } 34 | ``` 35 | 36 | Visit [MVN Repository](https://mvnrepository.com/artifact/com.zeoflow/flow-kit) 37 | to find the latest version of the library. 38 | 39 | ## Contributors 40 | 41 | Flow Kit for Android welcomes contributions from the community. Check 42 | out our [contributing guidelines](contributing.md) before getting started. 43 | -------------------------------------------------------------------------------- /flow-kit/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /flow-kit/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion rootProject.ext.compileSdkVersion 5 | buildToolsVersion rootProject.ext.buildToolsVersion 6 | defaultConfig { 7 | minSdkVersion rootProject.ext.minSdkVersion 8 | targetSdkVersion rootProject.ext.targetSdkVersion 9 | versionCode rootProject.ext.versionCode 10 | versionName rootProject.ext.versionName 11 | } 12 | buildTypes { 13 | release { 14 | minifyEnabled false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 16 | } 17 | } 18 | compileOptions { 19 | sourceCompatibility JavaVersion.VERSION_1_8 20 | targetCompatibility JavaVersion.VERSION_1_8 21 | } 22 | 23 | sourceSets.main { 24 | jniLibs.srcDir 'src/main/libs' 25 | jni.srcDirs 'src/main/jni' 26 | } 27 | } 28 | 29 | configurations.all { 30 | exclude group: 'org.jetbrains', module: 'annotations-java5' 31 | } 32 | 33 | dependencies { 34 | implementation fileTree(dir: 'libs', include: ['*.jar']) 35 | 36 | implementation 'com.zeoflow:zson:1.3.0' 37 | implementation 'com.zeoflow:material-elements:2.5.0' 38 | implementation('com.zeoflow:stylar:1.1.0') { 39 | exclude group: 'com.zeoflow', module: 'flow-kit' 40 | } 41 | 42 | implementation 'androidx.appcompat:appcompat:1.3.0' 43 | implementation 'androidx.recyclerview:recyclerview:1.2.1' 44 | implementation 'androidx.fragment:fragment:1.3.5' 45 | 46 | implementation("com.google.guava:guava:30.0-android") 47 | implementation("com.google.crypto.tink:tink-android:1.5.0") 48 | 49 | implementation 'io.reactivex.rxjava2:rxjava:2.2.21' 50 | 51 | } 52 | 53 | apply from: "${rootProject.projectDir}/buildSrc/upload.gradle" 54 | repositories { 55 | mavenCentral() 56 | } -------------------------------------------------------------------------------- /flow-kit/gradle.properties: -------------------------------------------------------------------------------- 1 | # artifact id 2 | # com.zeoflow:flow-kit 3 | POM_ARTIFACT_ID=flow-kit -------------------------------------------------------------------------------- /flow-kit/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/bali/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /flow-kit/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 13 | 14 | 19 | 20 | 24 | 25 | 28 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/AnimRes.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 anim resource reference (e.g. {@code android.R.anim.fade_in}). 16 | */ 17 | @Documented 18 | @Retention(CLASS) 19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) 20 | public @interface AnimRes 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/AnimatorRes.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 animator resource reference (e.g. {@code android.R.animator.fade_in}). 16 | */ 17 | @Documented 18 | @Retention(CLASS) 19 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) 20 | public @interface AnimatorRes 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/AnnotationDefault.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 AnnotationDefault} attribute. 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.ANNOTATION_TYPE) 29 | @interface AnnotationDefault 30 | { 31 | } 32 | 33 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/AnyRes.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 resource reference of any type. If the specific type is known, use 16 | * one of the more specific annotations instead, such as {@link StringRes} or 17 | * {@link DrawableRes}. 18 | */ 19 | @Documented 20 | @Retention(CLASS) 21 | @Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) 22 | public @interface AnyRes 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/AnyThread.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 can be called from any thread (e.g. it is "thread safe".) 15 | * If the annotated element is a class, then all methods in the class can be called 16 | * from any thread. 17 | *

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.

18 | * 19 | *

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 | *
@hide
javadoc 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

@hide
34 | * 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 | *

32 | * 33 | * @hide 34 | */ 35 | @Target({ElementType.TYPE}) 36 | @Retention(RetentionPolicy.SOURCE) 37 | public @interface Widget 38 | { 39 | } 40 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/annotation/WorkerThread.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 a worker thread. 15 | * If the annotated element is a class, then all methods in the class should be called 16 | * on a worker thread. 17 | *

18 | * 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 44 | ) 45 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/compressor/Compressor.kt: -------------------------------------------------------------------------------- 1 | package com.zeoflow.compressor 2 | 3 | import com.zeoflow.compressor.constraint.Compression 4 | import com.zeoflow.compressor.constraint.default 5 | import com.zeoflow.initializer.ZeoFlowApp.getContext 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.withContext 8 | import java.io.File 9 | import kotlin.coroutines.CoroutineContext 10 | 11 | object Compressor { 12 | 13 | @JvmStatic 14 | fun javaVariant(): JavaCompressor { 15 | return JavaCompressor() 16 | } 17 | 18 | @JvmStatic 19 | suspend fun compress( 20 | imageFile: File, 21 | coroutineContext: CoroutineContext = Dispatchers.IO, 22 | compressionPatch: Compression.() -> Unit = { default() } 23 | ) = withContext(coroutineContext) { 24 | val compression = Compression().apply(compressionPatch) 25 | var result = copyToCache(getContext(), imageFile) 26 | compression.constraints.forEach { constraint -> 27 | while (constraint.isSatisfied(result).not()) { 28 | result = constraint.satisfy(result) 29 | } 30 | } 31 | return@withContext result 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/compressor/constraint/Compression.kt: -------------------------------------------------------------------------------- 1 | package com.zeoflow.compressor.constraint 2 | 3 | class Compression { 4 | internal val constraints: MutableList = mutableListOf() 5 | 6 | fun constraint(constraint: Constraint) { 7 | constraints.add(constraint) 8 | } 9 | } -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/compressor/constraint/Constraint.kt: -------------------------------------------------------------------------------- 1 | package com.zeoflow.compressor.constraint 2 | 3 | import java.io.File 4 | 5 | /** 6 | * Created on : January 24, 2020 7 | * Author : zetbaitsu 8 | * Name : Zetra 9 | * GitHub : https://github.com/zetbaitsu 10 | */ 11 | interface Constraint { 12 | fun isSatisfied(imageFile: File): Boolean 13 | 14 | fun satisfy(imageFile: File): File 15 | } -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/compressor/constraint/DefaultConstraint.kt: -------------------------------------------------------------------------------- 1 | package com.zeoflow.compressor.constraint 2 | 3 | import android.graphics.Bitmap 4 | import com.zeoflow.compressor.decodeSampledBitmapFromFile 5 | import com.zeoflow.compressor.determineImageRotation 6 | import com.zeoflow.compressor.overWrite 7 | import java.io.File 8 | 9 | /** 10 | * Created on : January 25, 2020 11 | * Author : zetbaitsu 12 | * Name : Zetra 13 | * GitHub : https://github.com/zetbaitsu 14 | */ 15 | class DefaultConstraint( 16 | private val width: Int = 612, 17 | private val height: Int = 816, 18 | private val format: Bitmap.CompressFormat = Bitmap.CompressFormat.JPEG, 19 | private val quality: Int = 80 20 | ) : Constraint { 21 | private var isResolved = false 22 | 23 | override fun isSatisfied(imageFile: File): Boolean { 24 | return isResolved 25 | } 26 | 27 | override fun satisfy(imageFile: File): File { 28 | val result = decodeSampledBitmapFromFile(imageFile, width, height).run { 29 | determineImageRotation(imageFile, this).run { 30 | overWrite(imageFile, this, format, quality) 31 | } 32 | } 33 | isResolved = true 34 | return result 35 | } 36 | } 37 | 38 | fun Compression.default( 39 | width: Int = 612, 40 | height: Int = 816, 41 | format: Bitmap.CompressFormat = Bitmap.CompressFormat.JPEG, 42 | quality: Int = 80 43 | ) { 44 | constraint(DefaultConstraint(width, height, format, quality)) 45 | } -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/compressor/constraint/DestinationConstraint.kt: -------------------------------------------------------------------------------- 1 | package com.zeoflow.compressor.constraint 2 | 3 | import java.io.File 4 | 5 | /** 6 | * Created on : January 25, 2020 7 | * Author : zetbaitsu 8 | * Name : Zetra 9 | * GitHub : https://github.com/zetbaitsu 10 | */ 11 | class DestinationConstraint(private val destination: File) : Constraint { 12 | override fun isSatisfied(imageFile: File): Boolean { 13 | return imageFile.absolutePath == destination.absolutePath 14 | } 15 | 16 | override fun satisfy(imageFile: File): File { 17 | return imageFile.copyTo(destination, true) 18 | } 19 | } 20 | 21 | fun Compression.destination(destination: File) { 22 | constraint(DestinationConstraint(destination)) 23 | } -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/compressor/constraint/FormatConstraint.kt: -------------------------------------------------------------------------------- 1 | package com.zeoflow.compressor.constraint 2 | 3 | import android.graphics.Bitmap 4 | import com.zeoflow.compressor.compressFormat 5 | import com.zeoflow.compressor.loadBitmap 6 | import com.zeoflow.compressor.overWrite 7 | import java.io.File 8 | 9 | /** 10 | * Created on : January 24, 2020 11 | * Author : zetbaitsu 12 | * Name : Zetra 13 | * GitHub : https://github.com/zetbaitsu 14 | */ 15 | class FormatConstraint(private val format: Bitmap.CompressFormat) : Constraint { 16 | 17 | override fun isSatisfied(imageFile: File): Boolean { 18 | return format == imageFile.compressFormat() 19 | } 20 | 21 | override fun satisfy(imageFile: File): File { 22 | return overWrite(imageFile, loadBitmap(imageFile), format) 23 | } 24 | } 25 | 26 | fun Compression.format(format: Bitmap.CompressFormat) { 27 | constraint(FormatConstraint(format)) 28 | } -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/compressor/constraint/QualityConstraint.kt: -------------------------------------------------------------------------------- 1 | package com.zeoflow.compressor.constraint 2 | 3 | import com.zeoflow.compressor.loadBitmap 4 | import com.zeoflow.compressor.overWrite 5 | import java.io.File 6 | 7 | /** 8 | * Created on : January 25, 2020 9 | * Author : zetbaitsu 10 | * Name : Zetra 11 | * GitHub : https://github.com/zetbaitsu 12 | */ 13 | class QualityConstraint(private val quality: Int) : Constraint { 14 | private var isResolved = false 15 | 16 | override fun isSatisfied(imageFile: File): Boolean { 17 | return isResolved 18 | } 19 | 20 | override fun satisfy(imageFile: File): File { 21 | val result = overWrite(imageFile, loadBitmap(imageFile), quality = quality) 22 | isResolved = true 23 | return result 24 | } 25 | } 26 | 27 | fun Compression.quality(quality: Int) { 28 | constraint(QualityConstraint(quality)) 29 | } 30 | 31 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/compressor/constraint/ResolutionConstraint.kt: -------------------------------------------------------------------------------- 1 | package com.zeoflow.compressor.constraint 2 | 3 | import android.graphics.BitmapFactory 4 | import com.zeoflow.compressor.calculateInSampleSize 5 | import com.zeoflow.compressor.decodeSampledBitmapFromFile 6 | import com.zeoflow.compressor.determineImageRotation 7 | import com.zeoflow.compressor.overWrite 8 | import java.io.File 9 | 10 | /** 11 | * Created on : January 24, 2020 12 | * Author : zetbaitsu 13 | * Name : Zetra 14 | * GitHub : https://github.com/zetbaitsu 15 | */ 16 | class ResolutionConstraint(private val width: Int, private val height: Int) : Constraint { 17 | 18 | override fun isSatisfied(imageFile: File): Boolean { 19 | return BitmapFactory.Options().run { 20 | inJustDecodeBounds = true 21 | BitmapFactory.decodeFile(imageFile.absolutePath, this) 22 | calculateInSampleSize(this, width, height) <= 1 23 | } 24 | } 25 | 26 | override fun satisfy(imageFile: File): File { 27 | return decodeSampledBitmapFromFile(imageFile, width, height).run { 28 | determineImageRotation(imageFile, this).run { 29 | overWrite(imageFile, this) 30 | } 31 | } 32 | } 33 | } 34 | 35 | fun Compression.resolution(width: Int, height: Int) { 36 | constraint(ResolutionConstraint(width, height)) 37 | } -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/compressor/constraint/SizeConstraint.kt: -------------------------------------------------------------------------------- 1 | package com.zeoflow.compressor.constraint 2 | 3 | import com.zeoflow.compressor.loadBitmap 4 | import com.zeoflow.compressor.overWrite 5 | import java.io.File 6 | 7 | /** 8 | * Created on : January 24, 2020 9 | * Author : zetbaitsu 10 | * Name : Zetra 11 | * GitHub : https://github.com/zetbaitsu 12 | */ 13 | class SizeConstraint( 14 | private val maxFileSize: Long, 15 | private val stepSize: Int = 10, 16 | private val maxIteration: Int = 10, 17 | private val minQuality: Int = 10 18 | ) : Constraint { 19 | private var iteration: Int = 0 20 | 21 | override fun isSatisfied(imageFile: File): Boolean { 22 | return imageFile.length() <= maxFileSize || iteration >= maxIteration 23 | } 24 | 25 | override fun satisfy(imageFile: File): File { 26 | iteration++ 27 | val quality = (100 - iteration * stepSize).takeIf { it >= minQuality } ?: minQuality 28 | return overWrite(imageFile, loadBitmap(imageFile), quality = quality) 29 | } 30 | } 31 | 32 | fun Compression.size(maxFileSize: Long, stepSize: Int = 10, maxIteration: Int = 10) { 33 | constraint(SizeConstraint(maxFileSize, stepSize, maxIteration)) 34 | } -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/core/manage/DataCollectionDefaultChange.java: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 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.core.manage; 16 | 17 | import com.zeoflow.annotation.KeepForApi; 18 | 19 | @KeepForApi 20 | public final class DataCollectionDefaultChange 21 | { 22 | /** 23 | * The new value. 24 | */ 25 | @KeepForApi 26 | public final boolean enabled; 27 | 28 | @KeepForApi 29 | public DataCollectionDefaultChange(boolean enabled) 30 | { 31 | this.enabled = enabled; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/core/manage/PlatformInfo.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.core.manage; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.content.pm.PackageInfo; 6 | import android.content.pm.PackageManager; 7 | import android.os.Build; 8 | 9 | import java.util.TimeZone; 10 | import java.util.UUID; 11 | 12 | import static com.zeoflow.initializer.ZeoFlowApp.getContext; 13 | 14 | public class PlatformInfo 15 | { 16 | 17 | private static String uniqueID = null; 18 | 19 | public PlatformInfo() 20 | { 21 | 22 | } 23 | 24 | private synchronized static String id() 25 | { 26 | if (uniqueID == null) 27 | { 28 | String PREF_UNIQUE_ID = "PREF_UNIQUE_ID"; 29 | SharedPreferences sharedPrefs = getContext().getSharedPreferences( 30 | PREF_UNIQUE_ID, Context.MODE_PRIVATE); 31 | uniqueID = sharedPrefs.getString(PREF_UNIQUE_ID, null); 32 | if (uniqueID == null) 33 | { 34 | uniqueID = UUID.randomUUID().toString(); 35 | SharedPreferences.Editor editor = sharedPrefs.edit(); 36 | editor.putString(PREF_UNIQUE_ID, uniqueID); 37 | editor.apply(); 38 | } 39 | } 40 | return uniqueID; 41 | } 42 | 43 | public synchronized static String getDeviceID() 44 | { 45 | return id(); 46 | } 47 | 48 | public synchronized static String getDeviceModel() 49 | { 50 | return Build.MODEL; 51 | } 52 | 53 | public synchronized static String getDeviceManufacturer() 54 | { 55 | return Build.MANUFACTURER; 56 | } 57 | 58 | public synchronized static String getPackage() 59 | { 60 | return getContext().getPackageName(); 61 | } 62 | 63 | public synchronized static int getAppVersion() 64 | { 65 | try 66 | { 67 | PackageInfo packageInfo = getContext().getPackageManager() 68 | .getPackageInfo(getContext().getPackageName(), 0); 69 | return packageInfo.versionCode; 70 | } catch (PackageManager.NameNotFoundException e) 71 | { 72 | throw new RuntimeException("Could not get package name: " + e); 73 | } 74 | } 75 | 76 | public synchronized static String timeZone() 77 | { 78 | TimeZone tz = TimeZone.getDefault(); 79 | return tz.getID(); 80 | } 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/core/manage/StringResourceValueReader.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.core.manage; 2 | 3 | 4 | import android.content.Context; 5 | import android.content.res.Resources; 6 | 7 | import com.zeoflow.annotation.KeepForApi; 8 | import com.zeoflow.annotation.Nullable; 9 | import com.zeoflow.core.utils.Preconditions; 10 | 11 | @KeepForApi 12 | public class StringResourceValueReader 13 | { 14 | private final Resources resources; 15 | private final String string; 16 | 17 | public StringResourceValueReader(Context mContext) 18 | { 19 | Preconditions.checkNotNull(mContext); 20 | this.resources = mContext.getResources(); 21 | this.string = "common_zeoflow_services_unknown_issue"; 22 | } 23 | 24 | @Nullable 25 | @KeepForApi 26 | public String getString(String var1) 27 | { 28 | int var2; 29 | return (var2 = this.resources.getIdentifier(var1, "string", this.string)) == 0 ? null : this.resources.getString(var2); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/core/manage/StringsVerify.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.core.manage; 2 | 3 | import android.text.TextUtils; 4 | 5 | import com.zeoflow.annotation.KeepForApi; 6 | import com.zeoflow.annotation.Nullable; 7 | 8 | import java.util.regex.Pattern; 9 | 10 | @KeepForApi 11 | public class StringsVerify 12 | { 13 | private static final Pattern zzhh = Pattern.compile("\\$\\{(.*?)\\}"); 14 | 15 | private StringsVerify() 16 | { 17 | } 18 | 19 | @Nullable 20 | @KeepForApi 21 | public static String emptyToNull(@Nullable String var0) 22 | { 23 | return TextUtils.isEmpty(var0) ? null : var0; 24 | } 25 | 26 | @KeepForApi 27 | public static boolean isEmptyOrWhitespace(@Nullable String var0) 28 | { 29 | return var0 == null || var0.trim().isEmpty(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/crash/reporter/CrashReporter.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.crash.reporter; 2 | 3 | import android.content.Intent; 4 | 5 | import com.zeoflow.crash.reporter.ui.CrashReporterActivity; 6 | import com.zeoflow.crash.reporter.utils.CrashReporterExceptionHandler; 7 | import com.zeoflow.crash.reporter.utils.CrashUtil; 8 | 9 | import static com.zeoflow.initializer.ZeoFlowApp.getContext; 10 | 11 | @SuppressWarnings({"unused", "RedundantSuppression"}) 12 | public class CrashReporter 13 | { 14 | 15 | private static String crashReportPath; 16 | private static boolean isNotificationEnabled = true; 17 | 18 | private CrashReporter() 19 | { 20 | // This class in not publicly instantiable 21 | } 22 | 23 | public static void initialize() 24 | { 25 | setUpExceptionHandler(); 26 | } 27 | 28 | public static void initialize(String crashReportSavePath) 29 | { 30 | crashReportPath = crashReportSavePath; 31 | setUpExceptionHandler(); 32 | } 33 | 34 | private static void setUpExceptionHandler() 35 | { 36 | if (!(Thread.getDefaultUncaughtExceptionHandler() instanceof CrashReporterExceptionHandler)) 37 | { 38 | Thread.setDefaultUncaughtExceptionHandler(new CrashReporterExceptionHandler()); 39 | } 40 | } 41 | 42 | public static String getCrashReportPath() 43 | { 44 | return crashReportPath; 45 | } 46 | 47 | public static boolean isNotificationEnabled() 48 | { 49 | return isNotificationEnabled; 50 | } 51 | 52 | //LOG Exception APIs 53 | public static void logException(Exception exception) 54 | { 55 | CrashUtil.logException(exception); 56 | } 57 | 58 | public static Intent getLaunchIntent() 59 | { 60 | return new Intent(getContext(), CrashReporterActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 61 | } 62 | 63 | public static void disableNotification() 64 | { 65 | isNotificationEnabled = false; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/crash/reporter/adapter/MainPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.crash.reporter.adapter; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.fragment.app.Fragment; 5 | import androidx.fragment.app.FragmentManager; 6 | import androidx.fragment.app.FragmentPagerAdapter; 7 | 8 | import com.zeoflow.crash.reporter.ui.CrashLogFragment; 9 | import com.zeoflow.crash.reporter.ui.ExceptionLogFragment; 10 | 11 | public class MainPagerAdapter extends FragmentPagerAdapter 12 | { 13 | 14 | private CrashLogFragment crashLogFragment; 15 | private ExceptionLogFragment exceptionLogFragment; 16 | private final String[] titles; 17 | 18 | public MainPagerAdapter(FragmentManager fm, String[] titles) 19 | { 20 | super(fm); 21 | this.titles = titles; 22 | } 23 | 24 | @NonNull 25 | @Override 26 | public Fragment getItem(int position) 27 | { 28 | if (position == 0) 29 | { 30 | return crashLogFragment = new CrashLogFragment(); 31 | } else if (position == 1) 32 | { 33 | return exceptionLogFragment = new ExceptionLogFragment(); 34 | } else 35 | { 36 | return new CrashLogFragment(); 37 | } 38 | } 39 | 40 | @Override 41 | public int getCount() 42 | { 43 | return 2; 44 | } 45 | 46 | @Override 47 | public CharSequence getPageTitle(int position) 48 | { 49 | return titles[position]; 50 | } 51 | 52 | public void clearLogs() 53 | { 54 | crashLogFragment.clearLog(); 55 | exceptionLogFragment.clearLog(); 56 | } 57 | } -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/crash/reporter/service/NotificationService.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.crash.reporter.service; 2 | 3 | import android.app.NotificationManager; 4 | import android.app.Service; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.net.Uri; 8 | import android.os.IBinder; 9 | 10 | import androidx.annotation.Nullable; 11 | import androidx.core.content.FileProvider; 12 | 13 | import com.zeoflow.crash.reporter.utils.AppUtils; 14 | import com.zeoflow.crash.reporter.utils.FileUtils; 15 | 16 | import java.io.File; 17 | 18 | import static com.zeoflow.crash.reporter.utils.Constants.ACTION_CR_ZF_DELETE; 19 | import static com.zeoflow.crash.reporter.utils.Constants.ACTION_CR_ZF_SHARE; 20 | import static com.zeoflow.crash.reporter.utils.Constants.CRASH_REPORTER_NOTIFICATION_ID; 21 | 22 | public class NotificationService extends Service 23 | { 24 | @Override 25 | public int onStartCommand(Intent intent, int flags, int startId) 26 | { 27 | if (intent.getAction() != null) 28 | { 29 | if (intent.getAction().equals("DELETE_ACTION_CR_ZF")) 30 | { 31 | if (FileUtils.delete(intent.getStringExtra("LogMessage"))) 32 | { 33 | NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); 34 | notificationManager.cancel(8102020); 35 | } 36 | } else if (intent.getAction().equals("SHARE_ACTION_CR_ZF")) 37 | { 38 | Intent intentShare = new Intent(Intent.ACTION_SEND); 39 | intentShare.setType("*/*"); 40 | intentShare.putExtra(Intent.EXTRA_TEXT, AppUtils.getDeviceDetails()); 41 | Uri photoURI = FileProvider.getUriForFile(getApplicationContext(), getApplicationContext().getPackageName() + ".provider", new File(intent.getStringExtra("LogMessage"))); 42 | intentShare.putExtra(Intent.EXTRA_STREAM, photoURI); 43 | Intent share = Intent.createChooser(intentShare, "Share Crash Report via"); 44 | share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); 45 | share.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 46 | startActivity(share); 47 | } 48 | } 49 | return super.onStartCommand(intent, flags, startId); 50 | } 51 | 52 | @Nullable 53 | @Override 54 | public IBinder onBind(Intent intent) 55 | { 56 | return null; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/crash/reporter/utils/AppUtils.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.crash.reporter.utils; 2 | 3 | import android.os.Build; 4 | 5 | import static com.zeoflow.core.manage.PlatformInfo.getAppVersion; 6 | import static com.zeoflow.core.manage.PlatformInfo.getDeviceID; 7 | import static com.zeoflow.core.manage.PlatformInfo.timeZone; 8 | 9 | public class AppUtils 10 | { 11 | 12 | public static String mdDeviceDetails() 13 | { 14 | return "### Device Information\n\n" 15 | + "##### DEVICE.ID\n\n`" + getDeviceID() + "`\n\n" 16 | + "##### APP.VERSION\n\n`" + getAppVersion() + "`\n\n" 17 | + "##### TIMEZONE\n\n`" + timeZone() + "`\n\n" 18 | + "##### VERSION.RELEASE\n\n`" + Build.VERSION.RELEASE + "`\n\n" 19 | + "##### VERSION.INCREMENTAL\n\n`" + Build.VERSION.INCREMENTAL + "`\n\n" 20 | + "##### VERSION.SDK.NUMBER\n\n`" + Build.VERSION.SDK_INT + "`\n\n" 21 | + "##### BOARD\n\n`" + Build.BOARD + "`\n\n" 22 | + "##### BOOTLOADER\n\n`" + Build.BOOTLOADER + "`\n\n" 23 | + "##### BRAND\n\n`" + Build.BRAND + "`\n\n" 24 | + "##### MANUFACTURER\n\n`" + Build.MANUFACTURER + "`\n\n" 25 | + "##### MODEL\n\n`" + Build.MODEL + "`\n\n" 26 | + "##### PRODUCT\n\n`" + Build.PRODUCT + "`\n\n" 27 | + "##### TIME\n\n`" + Build.TIME + "`\n\n"; 28 | } 29 | 30 | public static String getDeviceDetails() 31 | { 32 | 33 | return "Device Information\n" 34 | + "\nDEVICE.ID : " + getDeviceID() 35 | + "\nAPP.VERSION : " + getAppVersion() 36 | + "\nTIMEZONE : " + timeZone() 37 | + "\nVERSION.RELEASE : " + Build.VERSION.RELEASE 38 | + "\nVERSION.INCREMENTAL : " + Build.VERSION.INCREMENTAL 39 | + "\nVERSION.SDK.NUMBER : " + Build.VERSION.SDK_INT 40 | + "\nBOARD : " + Build.BOARD 41 | + "\nBOOTLOADER : " + Build.BOOTLOADER 42 | + "\nBRAND : " + Build.BRAND 43 | + "\nMANUFACTURER : " + Build.MANUFACTURER 44 | + "\nMODEL : " + Build.MODEL 45 | + "\nPRODUCT : " + Build.PRODUCT; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/crash/reporter/utils/Constants.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.crash.reporter.utils; 2 | 3 | public class Constants 4 | { 5 | public static final String EXCEPTION_SUFFIX = "_exception"; 6 | public static final String CRASH_PREFIX = "crash_"; 7 | public static final String FILE_EXTENSION = ".txt"; 8 | public static final String CRASH_REPORT_DIR = "Crash Reports"; 9 | public static final int CRASH_REPORTER_NOTIFICATION_ID = 8102020; 10 | public static final String ACTION_CR_ZF_DELETE = "DELETE_ACTION_CR_ZF"; 11 | public static final String ACTION_CR_ZF_SHARE = "SHARE_ACTION_CR_ZF"; 12 | public static final String CHANNEL_NOTIFICATION_ID = "zf_cr_crash_reporter_notify"; 13 | public static final String LANDING = "landing"; 14 | } 15 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/crash/reporter/utils/CrashReporterException.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.crash.reporter.utils; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import java.util.Objects; 6 | 7 | public class CrashReporterException extends RuntimeException 8 | { 9 | static final long serialVersionUID = 1; 10 | 11 | /** 12 | * Constructs a new CrashReporterException. 13 | */ 14 | public CrashReporterException() 15 | { 16 | super(); 17 | } 18 | 19 | /** 20 | * Constructs a new CrashReporterException. 21 | * 22 | * @param message the detail message of this exception 23 | */ 24 | public CrashReporterException(String message) 25 | { 26 | super(message); 27 | } 28 | 29 | /** 30 | * Constructs a new CrashReporterException. 31 | * 32 | * @param format the format string (see {@link java.util.Formatter#format}) 33 | * @param args the list of arguments passed to the formatter. 34 | */ 35 | public CrashReporterException(String format, Object... args) 36 | { 37 | this(String.format(format, args)); 38 | } 39 | 40 | /** 41 | * Constructs a new CrashReporterException. 42 | * 43 | * @param message the detail message of this exception 44 | * @param throwable the cause of this exception 45 | */ 46 | public CrashReporterException(String message, Throwable throwable) 47 | { 48 | super(message, throwable); 49 | } 50 | 51 | /** 52 | * Constructs a new CrashReporterException. 53 | * 54 | * @param throwable the cause of this exception 55 | */ 56 | public CrashReporterException(Throwable throwable) 57 | { 58 | super(throwable); 59 | } 60 | 61 | @NonNull 62 | @Override 63 | public String toString() 64 | { 65 | // Throwable.toString() returns "CrashReporterException:{message}". Returning just "{message}" 66 | // should be fine here. 67 | return Objects.requireNonNull(getMessage()); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/crash/reporter/utils/CrashReporterExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.crash.reporter.utils; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | public class CrashReporterExceptionHandler implements Thread.UncaughtExceptionHandler 6 | { 7 | 8 | private final Thread.UncaughtExceptionHandler exceptionHandler; 9 | 10 | public CrashReporterExceptionHandler() 11 | { 12 | this.exceptionHandler = Thread.getDefaultUncaughtExceptionHandler(); 13 | } 14 | 15 | @Override 16 | public void uncaughtException(@NonNull Thread thread, @NonNull Throwable throwable) 17 | { 18 | CrashUtil.saveCrashReport(throwable); 19 | exceptionHandler.uncaughtException(thread, throwable); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/crash/reporter/utils/CrashReporterNotInitializedException.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.crash.reporter.utils; 2 | 3 | /** 4 | * An Exception indicating that the Crash Reporter has not been correctly initialized. 5 | */ 6 | @SuppressWarnings({"unused", "RedundantSuppression"}) 7 | public class CrashReporterNotInitializedException extends CrashReporterException 8 | { 9 | static final long serialVersionUID = 1; 10 | 11 | /** 12 | * Constructs a CrashReporterNotInitializedException with no additional information. 13 | */ 14 | public CrashReporterNotInitializedException() 15 | { 16 | super(); 17 | } 18 | 19 | /** 20 | * Constructs a CrashReporterNotInitializedException with a message. 21 | * 22 | * @param message A String to be returned from getMessage. 23 | */ 24 | public CrashReporterNotInitializedException(String message) 25 | { 26 | super(message); 27 | } 28 | 29 | /** 30 | * Constructs a CrashReporterNotInitializedException with a message and inner error. 31 | * 32 | * @param message A String to be returned from getMessage. 33 | * @param throwable A Throwable to be returned from getCause. 34 | */ 35 | public CrashReporterNotInitializedException(String message, Throwable throwable) 36 | { 37 | super(message, throwable); 38 | } 39 | 40 | /** 41 | * Constructs a CrashReporterNotInitializedException with an inner error. 42 | * 43 | * @param throwable A Throwable to be returned from getCause. 44 | */ 45 | public CrashReporterNotInitializedException(Throwable throwable) 46 | { 47 | super(throwable); 48 | } 49 | } -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/crash/reporter/utils/SimplePageChangeListener.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.crash.reporter.utils; 2 | 3 | import androidx.viewpager.widget.ViewPager; 4 | 5 | public abstract class SimplePageChangeListener implements ViewPager.OnPageChangeListener 6 | { 7 | @Override 8 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) 9 | { 10 | } 11 | 12 | @Override 13 | public abstract void onPageSelected(int position); 14 | 15 | @Override 16 | public void onPageScrollStateChanged(int state) 17 | { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/flow/kit/DefPackage.java: -------------------------------------------------------------------------------- 1 | package com.zeoflow.flow.kit; 2 | 3 | class DefPackage 4 | { 5 | 6 | /** 7 | * Empty Class 8 | * Class created and maintained only to keep the flow of the package 9 | * R.class is located under com.zeoflow.flow.kit.* 10 | * flow-kit resources are located under com.zeoflow.* 11 | */ 12 | private DefPackage() 13 | { 14 | 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/log/AndroidLogAdapter.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 | import static com.zeoflow.core.utils.Preconditions.checkNotNull; 21 | 22 | public class AndroidLogAdapter implements LogAdapter 23 | { 24 | 25 | @NonNull 26 | private final FormatStrategy formatStrategy; 27 | 28 | public AndroidLogAdapter() 29 | { 30 | this.formatStrategy = PrettyFormatStrategy.newBuilder().build(); 31 | } 32 | 33 | public AndroidLogAdapter(@NonNull FormatStrategy formatStrategy) 34 | { 35 | this.formatStrategy = checkNotNull(formatStrategy); 36 | } 37 | 38 | @Override 39 | public boolean isLoggable(int priority, @Nullable String tag) 40 | { 41 | return true; 42 | } 43 | 44 | @Override 45 | public void log(int priority, @Nullable String tag, @NonNull String message) 46 | { 47 | formatStrategy.log(priority, tag, message); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/log/DiskLogAdapter.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 | import static com.zeoflow.core.utils.Preconditions.checkNotNull; 21 | 22 | /** 23 | * This is used to saves log messages to the disk. 24 | * By default it uses {@link CsvFormatStrategy} to translates text message into CSV format. 25 | */ 26 | public class DiskLogAdapter implements LogAdapter 27 | { 28 | 29 | @NonNull 30 | private final FormatStrategy formatStrategy; 31 | 32 | public DiskLogAdapter() 33 | { 34 | formatStrategy = CsvFormatStrategy.newBuilder().build(); 35 | } 36 | 37 | public DiskLogAdapter(@NonNull FormatStrategy formatStrategy) 38 | { 39 | this.formatStrategy = checkNotNull(formatStrategy); 40 | } 41 | 42 | @Override 43 | public boolean isLoggable(int priority, @Nullable String tag) 44 | { 45 | return true; 46 | } 47 | 48 | @Override 49 | public void log(int priority, @Nullable String tag, @NonNull String message) 50 | { 51 | formatStrategy.log(priority, tag, message); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/log/FormatStrategy.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 | * Used to determine how messages should be printed or saved. 22 | * 23 | * @see PrettyFormatStrategy 24 | * @see CsvFormatStrategy 25 | */ 26 | public interface FormatStrategy 27 | { 28 | 29 | void log(int priority, @Nullable String tag, @NonNull String message); 30 | } 31 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/log/LogAdapter.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 | * Provides a common interface to emits logs through. This is a required contract for Log. 22 | * 23 | * @see AndroidLogAdapter 24 | * @see DiskLogAdapter 25 | */ 26 | public interface LogAdapter 27 | { 28 | 29 | /** 30 | * Used to determine whether log should be printed out or not. 31 | * 32 | * @param priority is the log level e.g. DEBUG, WARNING 33 | * @param tag is the given tag for the log message 34 | * @return is used to determine if log should printed. 35 | * If it is true, it will be printed, otherwise it'll be ignored. 36 | */ 37 | boolean isLoggable(int priority, @Nullable String tag); 38 | 39 | /** 40 | * Each log will use this pipeline 41 | * 42 | * @param priority is the log level e.g. DEBUG, WARNING 43 | * @param tag is the given tag for the log message. 44 | * @param message is the given message for the log message. 45 | */ 46 | void log(int priority, @Nullable String tag, @NonNull String message); 47 | } -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/log/LogStrategy.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 | * Determines destination target for the logs such as Disk, Logcat etc. 22 | * 23 | * @see LogcatLogStrategy 24 | * @see DiskLogStrategy 25 | */ 26 | public interface LogStrategy 27 | { 28 | 29 | /** 30 | * This is invoked by Log each time a log message is processed. 31 | * Interpret this method as last destination of the log in whole pipeline. 32 | * 33 | * @param priority is the log level e.g. DEBUG, WARNING 34 | * @param tag is the given tag for the log message. 35 | * @param message is the given message for the log message. 36 | */ 37 | void log(int priority, @Nullable String tag, @NonNull String message); 38 | } 39 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/log/LogcatLogStrategy.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 android.util.Log; 18 | 19 | import com.zeoflow.annotation.NonNull; 20 | import com.zeoflow.annotation.Nullable; 21 | 22 | import static com.zeoflow.core.utils.Preconditions.checkNotNull; 23 | 24 | /** 25 | * LogCat implementation for {@link LogStrategy} 26 | *

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 Extra(String key, JsonElement value) 11 | { 12 | this.key = key; 13 | this.value = value; 14 | } 15 | 16 | public String getKey() 17 | { 18 | return key; 19 | } 20 | 21 | public JsonElement getValue() 22 | { 23 | return value; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/os/UserManagerCompat.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.os; 18 | 19 | import android.content.Context; 20 | import android.os.Build; 21 | import android.os.UserManager; 22 | 23 | import com.zeoflow.annotation.NonNull; 24 | 25 | /** 26 | * Helper for accessing features in {@link UserManager} in a backwards compatible 27 | * fashion. 28 | */ 29 | public class UserManagerCompat 30 | { 31 | 32 | private UserManagerCompat() 33 | { 34 | } 35 | 36 | /** 37 | * Return whether the calling user is running in an "unlocked" state. A user 38 | * is unlocked only after they've entered their credentials (such as a lock 39 | * pattern or PIN), and credential-encrypted private app data storage is 40 | * available. 41 | */ 42 | public static boolean isUserUnlocked(@NonNull Context context) 43 | { 44 | if (Build.VERSION.SDK_INT >= 24) 45 | { 46 | return context.getSystemService(UserManager.class).isUserUnlocked(); 47 | } else 48 | { 49 | return true; 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/utils/BitmapCompat.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.utils; 16 | 17 | import android.graphics.Bitmap; 18 | 19 | import androidx.annotation.NonNull; 20 | 21 | /** 22 | * Helper for accessing features in {@link Bitmap}. 23 | */ 24 | public final class BitmapCompat 25 | { 26 | 27 | private BitmapCompat() 28 | { 29 | } 30 | public static boolean hasMipMap(@NonNull Bitmap bitmap) 31 | { 32 | return bitmap.hasMipMap(); 33 | } 34 | public static void setHasMipMap(@NonNull Bitmap bitmap, boolean hasMipMap) 35 | { 36 | bitmap.setHasMipMap(hasMipMap); 37 | } 38 | /** 39 | * Returns the size of the allocated memory used to store this bitmap's pixels in a backwards 40 | * compatible way. 41 | * 42 | * @param bitmap the bitmap in which to return its allocation size 43 | * 44 | * @return the allocation size in bytes 45 | */ 46 | public static int getAllocationByteCount(@NonNull Bitmap bitmap) 47 | { 48 | return bitmap.getAllocationByteCount(); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/utils/BlendModeColorFilterCompat.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.utils; 16 | 17 | import android.graphics.BlendMode; 18 | import android.graphics.BlendModeColorFilter; 19 | import android.graphics.ColorFilter; 20 | import android.graphics.PorterDuff; 21 | import android.graphics.PorterDuffColorFilter; 22 | import android.os.Build; 23 | 24 | import androidx.annotation.NonNull; 25 | import androidx.annotation.Nullable; 26 | 27 | /** 28 | * Helper for accessing ColorFilter APIs on various API levels of the platform 29 | */ 30 | public class BlendModeColorFilterCompat 31 | { 32 | 33 | private BlendModeColorFilterCompat() 34 | { 35 | } 36 | /** 37 | * Convenience method to create ColorFilter in a backward 38 | * compatible way. This method falls back on PorterDuffColorFilter for API levels that 39 | * do not support BlendModeColorFilter. This method returns null if the BlendMode provided is 40 | * not supported on a given API level. 41 | */ 42 | public static @Nullable 43 | ColorFilter createBlendModeColorFilterCompat(int color, 44 | @NonNull BlendModeCompat blendModeCompat) 45 | { 46 | if (Build.VERSION.SDK_INT >= 29) 47 | { 48 | BlendMode blendMode = BlendModeUtils.obtainBlendModeFromCompat(blendModeCompat); 49 | return blendMode != null 50 | ? new BlendModeColorFilter(color, blendMode) : null; 51 | } else 52 | { 53 | PorterDuff.Mode porterDuffMode = 54 | BlendModeUtils.obtainPorterDuffFromCompat(blendModeCompat); 55 | return porterDuffMode != null 56 | ? new PorterDuffColorFilter(color, porterDuffMode) : null; 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /flow-kit/src/main/java/com/zeoflow/utils/FileUtil.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.utils; 16 | 17 | import android.content.res.AssetManager; 18 | 19 | import java.io.BufferedReader; 20 | import java.io.IOException; 21 | import java.io.InputStreamReader; 22 | import java.nio.charset.StandardCharsets; 23 | 24 | public class FileUtil 25 | { 26 | 27 | public static String readFile(AssetManager assets, String fileName) 28 | { 29 | return readFile(assets, fileName, "\n"); 30 | } 31 | 32 | public static String readFile(AssetManager assets, String fileName, String newLine) 33 | { 34 | StringBuilder content = new StringBuilder(); 35 | try (BufferedReader reader = new BufferedReader( 36 | new InputStreamReader(assets.open(fileName), StandardCharsets.UTF_8))) 37 | { 38 | 39 | // do reading, usually loop until end of file reading 40 | String mLine; 41 | while ((mLine = reader.readLine()) != null) 42 | { 43 | if (!content.toString().isEmpty()) 44 | { 45 | content.append(newLine); 46 | } 47 | content.append(mLine); 48 | } 49 | } catch (IOException e) 50 | { 51 | //log the exception 52 | } 53 | return content.toString(); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/drawable-hdpi/zf_cr_ic_crash_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/flow-kit/src/main/res/drawable-hdpi/zf_cr_ic_crash_notification.png -------------------------------------------------------------------------------- /flow-kit/src/main/res/drawable-mdpi/zf_cr_ic_crash_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/flow-kit/src/main/res/drawable-mdpi/zf_cr_ic_crash_notification.png -------------------------------------------------------------------------------- /flow-kit/src/main/res/drawable-xhdpi/zf_cr_ic_crash_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/flow-kit/src/main/res/drawable-xhdpi/zf_cr_ic_crash_notification.png -------------------------------------------------------------------------------- /flow-kit/src/main/res/drawable-xxhdpi/zf_cr_ic_crash_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/flow-kit/src/main/res/drawable-xxhdpi/zf_cr_ic_crash_notification.png -------------------------------------------------------------------------------- /flow-kit/src/main/res/drawable-xxxhdpi/zf_cr_ic_crash_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/flow-kit/src/main/res/drawable-xxxhdpi/zf_cr_ic_crash_notification.png -------------------------------------------------------------------------------- /flow-kit/src/main/res/drawable/zf_cr_background_splash_crash.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/drawable/zf_cr_ic_menu_delete_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/drawable/zf_cr_ic_menu_share_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/drawable/zf_cr_ic_warning_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/font/font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/flow-kit/src/main/res/font/font.ttf -------------------------------------------------------------------------------- /flow-kit/src/main/res/layout/zf_cr_crash_log.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/layout/zf_cr_custom_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 20 | 21 | 36 | 37 | 43 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/layout/zf_cr_exception_log.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F44336 4 | #F44336 5 | #F44336 6 | #000000 7 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | CrashReporter 3 | Crashes 4 | Exceptions 5 | View Crash Report 6 | Check your crashes and exceptions here. 7 | Are you sure to delete all the crash logs 8 | Cancel 9 | Ok 10 | 11 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /flow-kit/src/main/res/xml/provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | android.useAndroidX=true 20 | android.enableJetifier=true 21 | 22 | # Maven 23 | POM_NAME=FlowKit 24 | POM_ARTIFACT_ID=flow-kit 25 | POM_PACKAGING=aar 26 | VERSION_NAME=1.6.1 27 | GROUP=com.zeoflow 28 | POM_DESCRIPTION=An Android Library that comes with useful features and components 29 | POM_URL=https://github.com/zeoflow/flow-kit 30 | POM_SCM_URL=https://github.com/zeoflow/flow-kit 31 | POM_SCM_CONNECTION=scm:git@github.com:zeoflow/flow-kit.git 32 | POM_SCM_DEV_CONNECTION=scm:git@github.com:zeoflow/flow-kit.git 33 | POM_LICENCE_NAME=The Apache Software License, Version 2.0 34 | POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt 35 | POM_LICENCE_DIST=repo 36 | POM_DEVELOPER_ID=zeoflow 37 | POM_DEVELOPER_NAME=ZeoFlow 38 | POM_DEVELOPER_EMAIL=open-source@zeoflow.com 39 | org.gradle.daemon=true 40 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeoflow/flow-kit/d782cd5ccbdd08890aa125fab53f1bf005c3746c/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Feb 23 23:31:02 EET 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip 7 | -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Table of Contents 2 | ### Link to GitHub issues it solves 3 | closes #5346 4 | ### Description 5 | 6 | ###### [Contributing](https://github.com/zeoflow/flow-kit/blob/master/docs/contributing.md) has more information and tips for a great pull request. -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':catalog', ':flow-kit' 2 | --------------------------------------------------------------------------------