├── .editorconfig ├── .github ├── CODEOWNERS ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── Bug_report.md │ └── Feature_request.md ├── pull_request_template.md └── workflows │ ├── android.yml │ └── publish.yml ├── .gitignore ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle.kts └── src │ └── main │ ├── AndroidManifest.xml │ ├── kotlin │ └── com │ │ └── skydoves │ │ └── flow │ │ └── operators │ │ └── demo │ │ ├── MainActivity.kt │ │ ├── MainViewModel.kt │ │ ├── MainViewModelFactory.kt │ │ ├── data │ │ └── MainRepository.kt │ │ └── network │ │ ├── DisneyService.kt │ │ ├── NetworkModule.kt │ │ └── Poster.kt │ └── res │ ├── drawable │ ├── ic_launcher_background.xml │ └── ic_launcher_foreground.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-mdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xxhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xxxhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── values │ ├── colors.xml │ ├── strings.xml │ └── themes.xml │ └── xml │ ├── backup_rules.xml │ └── data_extraction_rules.xml ├── build.gradle.kts ├── buildSrc ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── com │ └── skydoves │ └── flow │ └── operators │ └── Configuration.kt ├── flow-operators ├── .gitignore ├── api │ ├── android │ │ └── flow-operators.api │ └── jvm │ │ └── flow-operators.api ├── build.gradle.kts └── src │ ├── commonMain │ └── kotlin │ │ └── com │ │ └── skydoves │ │ └── flow │ │ └── operators │ │ ├── onetime │ │ └── OnetimeStateIn.kt │ │ ├── pausable │ │ ├── Pausable.kt │ │ ├── PausableStateFlow.kt │ │ └── PausableStateIn.kt │ │ └── restartable │ │ ├── Restartable.kt │ │ ├── RestartableStateFlow.kt │ │ └── RestartableStateIn.kt │ └── commonTest │ └── kotlin │ └── com │ └── skydoves │ └── flow │ └── operators │ ├── OnetimeWhileSubscribedTest.kt │ ├── PausableTest.kt │ └── RestartableTest.kt ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── scripts └── publish-module.gradle.kts ├── settings.gradle.kts └── spotless ├── copyright.kt ├── copyright.kts └── copyright.xml /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | [*] 3 | # Most of the standard properties are supported 4 | indent_size=2 5 | max_line_length=100 -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Lines starting with '#' are comments. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | # More details are here: https://help.github.com/articles/about-codeowners/ 5 | 6 | # The '*' pattern is global owners. 7 | # Not adding in this PR, but I'd like to try adding a global owner set with the entire team. 8 | # One interpretation of their docs is that global owners are added only if not removed 9 | # by a more local rule. 10 | 11 | # Order is important. The last matching pattern has the most precedence. 12 | # The folders are ordered as follows: 13 | 14 | # In each subsection folders are ordered first by depth, then alphabetically. 15 | # This should make it easy to add new rules without breaking existing ones. 16 | * @skydoves -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: skydoves 2 | custom: ["https://www.paypal.me/skydoves", "https://www.buymeacoffee.com/skydoves"] 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Something is crashing or not working as intended 4 | 5 | --- 6 | 7 | **Please complete the following information:** 8 | - Library Version [e.g. v1.0.0] 9 | - Affected Device(s) [e.g. Samsung Galaxy s10 with Android 9.0] 10 | 11 | **Describe the Bug:** 12 | 13 | Add a clear description about the problem. 14 | 15 | **Expected Behavior:** 16 | 17 | A clear description of what you expected to happen. 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem?** 8 | 9 | A clear and concise description of what the problem is. 10 | 11 | **Describe the solution you'd like:** 12 | 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered:** 16 | 17 | A clear description of any alternative solutions you've considered. 18 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### 🎯 Goal 2 | Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. 3 | 4 | ### 🛠 Implementation details 5 | Describe the implementation details for this Pull Request. 6 | 7 | ### ✍️ Explain examples 8 | Explain examples with code for these updates. 9 | 10 | ### Preparing a pull request for review 11 | Ensure your change is properly formatted by running: 12 | 13 | ```bash 14 | $ ./gradlew spotlessApply 15 | ``` 16 | 17 | Then dump binary APIs of this library that is public in sense of Kotlin visibilities and ensures that the public binary API wasn't changed in a way that makes this change binary incompatible. 18 | 19 | ```bash 20 | ./gradlew apiDump 21 | ``` 22 | 23 | Please correct any failures before requesting a review. 24 | 25 | ## Code reviews 26 | All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult [GitHub Help](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) for more information on using pull requests. 27 | -------------------------------------------------------------------------------- /.github/workflows/android.yml: -------------------------------------------------------------------------------- 1 | name: Android CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | lint: 11 | name: Spotless check 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Check out code 15 | uses: actions/checkout@v4.1.7 16 | - name: Set up JDK 17 | uses: actions/setup-java@v4.2.2 18 | with: 19 | distribution: zulu 20 | java-version: 17 21 | - uses: gradle/gradle-build-action@v3.5.0 22 | - name: spotless 23 | run: ./gradlew spotlessCheck 24 | 25 | api_check: 26 | name: API check 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Check out code 30 | uses: actions/checkout@v4.1.7 31 | - name: Set up JDK 32 | uses: actions/setup-java@v4.2.2 33 | with: 34 | distribution: zulu 35 | java-version: 17 36 | - uses: gradle/gradle-build-action@v3.5.0 37 | - name: API check 38 | run: ./gradlew apiCheck 39 | 40 | build: 41 | runs-on: ubuntu-latest 42 | steps: 43 | - uses: actions/checkout@v4.1.7 44 | - name: set up JDK 45 | uses: actions/setup-java@v4.2.2 46 | with: 47 | distribution: zulu 48 | java-version: 17 49 | 50 | - uses: gradle/gradle-build-action@v3.5.0 51 | - name: Make Gradle executable 52 | run: chmod +x ./gradlew 53 | 54 | - name: Build with Gradle 55 | run: | 56 | ./gradlew --scan --stacktrace \ 57 | assemble -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | 3 | on: 4 | release: 5 | types: [ released ] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | publish: 10 | name: Snapshot build and publish 11 | runs-on: macos-latest 12 | steps: 13 | - name: Check out code 14 | uses: actions/checkout@v4.1.7 15 | 16 | - name: Set up JDK 17 17 | uses: actions/setup-java@v4.2.2 18 | with: 19 | distribution: 'zulu' 20 | java-version: 17 21 | 22 | - name: Grant Permission to Execute Gradle 23 | run: chmod +x gradlew 24 | 25 | - name: Release build 26 | run: ./gradlew assemble --scan 27 | 28 | - name: Publish to MavenCentral 29 | run: | 30 | ./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache 31 | env: 32 | ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }} 33 | ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} 34 | ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} 35 | ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} 36 | ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | /.idea 18 | !.idea/codeInsightSettings.xml 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | secrets.properties 25 | 26 | # Proguard folder generated by Eclipse 27 | proguard/ 28 | 29 | # Log Files 30 | *.log 31 | 32 | # Android Studio Navigation editor temp files 33 | .navigation/ 34 | 35 | # Android Studio captures folder 36 | captures/ 37 | 38 | # Intellij 39 | *.iml 40 | .idea/workspace.xml 41 | .idea/tasks.xml 42 | .idea/gradle.xml 43 | .idea/dictionaries 44 | .idea/libraries 45 | app/.idea/ 46 | 47 | # Mac 48 | *.DS_Store 49 | 50 | # Keystore files 51 | *.jks 52 | 53 | # External native build folder generated in Android Studio 2.2 and later 54 | .externalNativeBuild 55 | 56 | # Google Services (e.g. APIs or Firebase) 57 | google-services.json 58 | 59 | # Freeline 60 | freeline.py 61 | freeline/ 62 | freeline_project_description.json 63 | 64 | # Eclipse 65 | .project 66 | .settings 67 | .classpath 68 | 69 | # Kotlin 70 | .kotlin -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Flow Operators


2 | 3 |

4 | License 5 | API 6 | Build Status 8 | Profile 9 | Profile 10 |


11 | 12 |

🌊 Flow operators enable you to create restartable, pausable, or one-shot StateFlow, and they support KMP.

13 | 14 | ## Flow Operators 15 | 16 | Flow operators that enable you to create restartable, pausable, or one-shot `StateFlow` instances, allowing you to customize and control additional behaviors for `StateFlow` based on your specific use case. Why are flow operators useful? You can manage state and control data streams efficiently in complex scenarios. You can read more about the reasons in [Loading Initial Data on Android Part 2: Clear All Your Doubts](https://medium.com/proandroiddev/loading-initial-data-part-2-clear-all-your-doubts-0f621bfd06a0). 17 | 18 | [![Maven Central](https://img.shields.io/maven-central/v/com.github.skydoves/flow-operators.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.skydoves%22%20AND%20a:%22flow-operators%22) 19 | 20 | ### Version Catalog 21 | 22 | If you're using Version Catalog, you can configure the dependency by adding it to your `libs.versions.toml` file as follows: 23 | 24 | ```toml 25 | [versions] 26 | #... 27 | flowOperators = "0.1.1" 28 | 29 | [libraries] 30 | #... 31 | flow-operators = { module = "com.github.skydoves:flow-operators", version.ref = "flowOperators" } 32 | ``` 33 | 34 | ### Gradle 35 | Add the dependency below to your **module**'s `build.gradle.kts` file: 36 | 37 | ```gradle 38 | dependencies { 39 | implementation("com.github.skydoves:flow-operators:$version") 40 | 41 | // if you're using Version Catalog 42 | implementation(libs.flow.operators) 43 | } 44 | ``` 45 | 46 | For Kotlin Multiplatform, add the dependency below to your **module**'s `build.gradle.kts` file: 47 | 48 | ```gradle 49 | sourceSets { 50 | val commonMain by getting { 51 | dependencies { 52 | implementation("com.github.skydoves:flow-operators:$version") 53 | } 54 | } 55 | } 56 | ``` 57 | 58 | ### RestartableStateFlow 59 | 60 | `RestartableStateFlow` extends both `StateFlow` and `Restartable`, allowing the upstream flow to restart its emission. It behaves like a regular `StateFlow` but includes the ability to reset and restart the emission process when necessary. 61 | 62 | Consider a scenario where you load initial data using a property, as shown in the example below, instead of initiating the load inside `LaunchedEffect` or `ViewModel.init()`. (For more details, check out [Loading Initial Data in LaunchedEffect vs. ViewModel](https://medium.com/proandroiddev/loading-initial-data-in-launchedeffect-vs-viewmodel-f1747c20ce62)). 63 | 64 | ```kotlin 65 | val posters: StateFlow> = mainRepository.fetchPostersFlow() 66 | .filter { it.isSuccess } 67 | .mapLatest { it.getOrThrow() } 68 | .restartableStateIn( 69 | scope = viewModelScope, 70 | started = SharingStarted.WhileSubscribed(5000), 71 | initialValue = emptyList(), 72 | ) 73 | ``` 74 | 75 | By using a property, the data is loaded only when the first subscription occurs, preventing the unnecessary immediate execution of tasks and avoiding unintended side effects that might arise from `ViewModel.init()` or `LaunchedEffect`. However, another challenge arises: you may need to reload the data due to scenarios like refreshing, recovering from errors during the initial load, or other reasons. In such cases, you can seamlessly restart the upstream flow using `RestartableStateFlow`. 76 | 77 | ```kotlin 78 | class MainViewModel(mainRepository: MainRepository) : ViewModel() { 79 | 80 | private val restartablePoster: RestartableStateFlow> = mainRepository.fetchPostersFlow() 81 | .filter { it.isSuccess } 82 | .mapLatest { it.getOrThrow() } 83 | .restartableStateIn( 84 | scope = viewModelScope, 85 | started = SharingStarted.WhileSubscribed(5000), 86 | initialValue = emptyList(), 87 | ) 88 | 89 | val posters: StateFlow> = restartablePoster // don't expose the Restartable interface to the outside 90 | 91 | fun refresh() = restartablePoster.restart() 92 | } 93 | ``` 94 | 95 | Now, you can easily restart the upstream flow and reload the initial task using the property. 96 | 97 | ```kotlin 98 | @Composable 99 | private fun Main(mainViewModel: MainViewModel) { 100 | val posters by mainViewModel.posters.collectAsStateWithLifecycle() 101 | 102 | Column( 103 | modifier = Modifier 104 | .fillMaxSize() 105 | .padding(6.dp) 106 | .verticalScroll(rememberScrollState()), 107 | ) { 108 | Button(onClick = { mainViewModel.refresh() }) { 109 | Text(text = "restart") 110 | } 111 | 112 | Text(text = posters.toString()) 113 | } 114 | } 115 | ``` 116 | 117 | ### PausableStateFlow 118 | 119 | `PausableStateFlow` extends both `StateFlow` and `PausableStateFlow`, enabling the upstream flow to pause and resume its emission. It retains the functionality of a standard `StateFlow` while adding controls for pausing and resuming emissions as needed. 120 | 121 | The core concept of `PausableStateFlow` is similar to `RestartableStateFlow`, but with an added capability: it allows you to pause and resume listening to the upstream flow. This can be particularly useful in scenarios where you want to temporarily stop processing updates from an upstream flow, such as real-time location updates, Bluetooth connection status, animations, or other continuous events. 122 | 123 | While paused, any new subscribers to the `PausableStateFlow` will simply receive the latest cached value instead of actively listening to the upstream emissions. 124 | 125 | ```kotlin 126 | class MainViewModel(mainRepository: MainRepository) : ViewModel() { 127 | 128 | private val pausableStateFlow: PausableStateFlow> = 129 | mainRepository.fetchPostersFlow() 130 | .filter { it.isSuccess } 131 | .mapLatest { it.getOrThrow() } 132 | .pausableStateIn( 133 | scope = viewModelScope, 134 | started = SharingStarted.WhileSubscribed(5000), 135 | initialValue = emptyList(), 136 | ) 137 | 138 | val posters: StateFlow> = pausableStateFlow 139 | 140 | fun pause() = pausableStateFlow.pause() 141 | 142 | fun resume() = pausableStateFlow.resume() 143 | } 144 | ``` 145 | 146 | ### OnetimeWhileSubscribed 147 | 148 | `OnetimeWhileSubscribed` is a `SharingStarted` strategy that ensures the upstream flow emits only once while a subscriber is active. After the initial emission, it remains idle until another active subscription appears. 149 | 150 | When converting a cold flow into a hot flow using `stateIn` on Android, a common approach is to use `SharingStarted.WhileSubscribed(5_000)` with the `stateIn` function. The 5-second threshold (5_000) aligns with the ANR (Application Not Responding) timeout limit. If no subscribers remain for longer than 5 seconds, the timeout is exceeded, and the upstream data flow ceases to influence your UI layer. 151 | 152 | However, this can lead to another side-effect: if you navigate from Screen A to Screen B and remain on Screen B for over 5 seconds, returning to Screen A will restart the upstream flow. This causes the same task to relaunch, even if it was already completed. To avoid this, you can use `OnetimeWhileSubscribed` as a `SharingStarted` strategy. It ensures the upstream flow is launched only once when the first subscription occurs, and subsequently, only the latest cached value is replayed, avoiding redundant task restarts during screen transitions. 153 | 154 | ```kotlin 155 | class MainViewModel(mainRepository: MainRepository) : ViewModel() { 156 | 157 | private val posters: StateFlow> = 158 | mainRepository.fetchPostersFlow() 159 | .filter { it.isSuccess } 160 | .mapLatest { it.getOrThrow() } 161 | .stateIn( 162 | scope = viewModelScope, 163 | started = SharingStarted.OnetimeWhileSubscribed(5_000), 164 | initialValue = emptyList(), 165 | ) 166 | } 167 | ``` 168 | 169 | ## Find this repository useful? :heart: 170 | Support it by joining __[stargazers](https://github.com/skydoves/flow-operators/stargazers)__ for this repository. :star:
171 | Also, __[follow me](https://github.com/skydoves)__ on GitHub for my next creations! 🤩 172 | 173 | # License 174 | ```xml 175 | Designed and developed by 2025 skydoves (Jaewoong Eum) 176 | 177 | Licensed under the Apache License, Version 2.0 (the "License"); 178 | you may not use this file except in compliance with the License. 179 | You may obtain a copy of the License at 180 | 181 | http://www.apache.org/licenses/LICENSE-2.0 182 | 183 | Unless required by applicable law or agreed to in writing, software 184 | distributed under the License is distributed on an "AS IS" BASIS, 185 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 186 | See the License for the specific language governing permissions and 187 | limitations under the License. 188 | ``` 189 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2025 skydoves (Jaewoong Eum) 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 | import com.skydoves.flow.operators.Configuration 17 | 18 | plugins { 19 | id(libs.plugins.android.application.get().pluginId) 20 | id(libs.plugins.kotlin.android.get().pluginId) 21 | id(libs.plugins.compose.compiler.get().pluginId) 22 | id(libs.plugins.kotlin.serialization.get().pluginId) 23 | id(libs.plugins.ksp.get().pluginId) 24 | } 25 | 26 | android { 27 | compileSdk = Configuration.compileSdk 28 | namespace = "com.skydoves.flow.operators.demo" 29 | defaultConfig { 30 | applicationId = "com.skydoves.flow.operators.demo" 31 | minSdk = Configuration.minSdk 32 | targetSdk = Configuration.targetSdk 33 | versionCode = Configuration.versionCode 34 | versionName = Configuration.versionName 35 | } 36 | 37 | buildFeatures { 38 | compose = true 39 | } 40 | 41 | lint { 42 | abortOnError = false 43 | } 44 | 45 | compileOptions { 46 | sourceCompatibility = JavaVersion.VERSION_17 47 | targetCompatibility = JavaVersion.VERSION_17 48 | } 49 | 50 | kotlinOptions { 51 | jvmTarget = "17" 52 | } 53 | } 54 | 55 | dependencies { 56 | implementation(project(":flow-operators")) 57 | 58 | implementation(libs.androidx.activity.compose) 59 | implementation(libs.androidx.compose.ui) 60 | implementation(libs.androidx.compose.material3) 61 | implementation(libs.androidx.compose.foundation) 62 | implementation(libs.androidx.compose.runtime) 63 | implementation(libs.androidx.compose.ui.tooling.preview) 64 | implementation(libs.androidx.lifecycle.runtime) 65 | implementation(libs.androidx.lifecycle.runtimeCompose) 66 | implementation(libs.androidx.lifecycle.viewModelCompose) 67 | 68 | implementation(libs.kotlinx.serialization.json) 69 | 70 | implementation(libs.sandwich) 71 | implementation(libs.kotlinx.coroutines.core) 72 | implementation(libs.retrofit) 73 | implementation(libs.retrofit.kotlinx.serialization) 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/skydoves/flow/operators/demo/MainActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2025 skydoves (Jaewoong Eum) 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.skydoves.flow.operators.demo 17 | 18 | import android.os.Bundle 19 | import androidx.activity.ComponentActivity 20 | import androidx.activity.compose.setContent 21 | import androidx.compose.foundation.layout.Column 22 | import androidx.compose.foundation.layout.fillMaxSize 23 | import androidx.compose.foundation.layout.padding 24 | import androidx.compose.foundation.rememberScrollState 25 | import androidx.compose.foundation.verticalScroll 26 | import androidx.compose.material3.Button 27 | import androidx.compose.material3.MaterialTheme 28 | import androidx.compose.material3.Text 29 | import androidx.compose.runtime.Composable 30 | import androidx.compose.runtime.getValue 31 | import androidx.compose.ui.Modifier 32 | import androidx.compose.ui.unit.dp 33 | import androidx.lifecycle.compose.collectAsStateWithLifecycle 34 | 35 | class MainActivity : ComponentActivity() { 36 | 37 | private val viewModelFactory: MainViewModelFactory = MainViewModelFactory() 38 | private val viewModel: MainViewModel by lazy { 39 | viewModelFactory.create(MainViewModel::class.java) 40 | } 41 | 42 | override fun onCreate(savedInstanceState: Bundle?) { 43 | super.onCreate(savedInstanceState) 44 | 45 | setContent { 46 | MaterialTheme { 47 | Main(mainViewModel = viewModel) 48 | } 49 | } 50 | } 51 | } 52 | 53 | @Composable 54 | private fun Main(mainViewModel: MainViewModel) { 55 | val posters by mainViewModel.posters.collectAsStateWithLifecycle() 56 | 57 | Column( 58 | modifier = Modifier 59 | .fillMaxSize() 60 | .padding(6.dp) 61 | .verticalScroll(rememberScrollState()), 62 | ) { 63 | Button(onClick = { mainViewModel.restart() }) { 64 | Text(text = "restart") 65 | } 66 | 67 | Text(text = posters.toString()) 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/skydoves/flow/operators/demo/MainViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2025 skydoves (Jaewoong Eum) 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.skydoves.flow.operators.demo 17 | 18 | import androidx.lifecycle.ViewModel 19 | import androidx.lifecycle.viewModelScope 20 | import com.skydoves.flow.operators.demo.data.MainRepository 21 | import com.skydoves.flow.operators.demo.network.Poster 22 | import com.skydoves.flow.operators.restartable.RestartableStateFlow 23 | import com.skydoves.flow.operators.restartable.restartableStateIn 24 | import com.skydoves.sandwich.getOrThrow 25 | import com.skydoves.sandwich.isSuccess 26 | import kotlinx.coroutines.ExperimentalCoroutinesApi 27 | import kotlinx.coroutines.flow.SharingStarted 28 | import kotlinx.coroutines.flow.StateFlow 29 | import kotlinx.coroutines.flow.filter 30 | import kotlinx.coroutines.flow.mapLatest 31 | 32 | class MainViewModel(mainRepository: MainRepository) : ViewModel() { 33 | 34 | @OptIn(ExperimentalCoroutinesApi::class) 35 | private val restartablePoster: RestartableStateFlow> = 36 | mainRepository.fetchPostersFlow() 37 | .filter { it.isSuccess } 38 | .mapLatest { it.getOrThrow() } 39 | .restartableStateIn( 40 | scope = viewModelScope, 41 | started = SharingStarted.WhileSubscribed(5000), 42 | initialValue = emptyList(), 43 | ) 44 | 45 | val posters: StateFlow> = restartablePoster 46 | 47 | fun restart() { 48 | restartablePoster.restart() 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/skydoves/flow/operators/demo/MainViewModelFactory.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2025 skydoves (Jaewoong Eum) 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.skydoves.flow.operators.demo 17 | 18 | import androidx.lifecycle.ViewModel 19 | import androidx.lifecycle.ViewModelProvider 20 | import com.skydoves.flow.operators.demo.data.MainRepository 21 | import com.skydoves.flow.operators.demo.network.NetworkModule 22 | 23 | @Suppress("UNCHECKED_CAST") 24 | class MainViewModelFactory : ViewModelProvider.Factory { 25 | 26 | override fun create(modelClass: Class): T { 27 | if (modelClass.isAssignableFrom(MainViewModel::class.java)) { 28 | val mainRepository = MainRepository(NetworkModule.disneyService) 29 | return MainViewModel(mainRepository) as T 30 | } 31 | throw IllegalArgumentException("Unknown ViewModel class.") 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/skydoves/flow/operators/demo/data/MainRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2025 skydoves (Jaewoong Eum) 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.skydoves.flow.operators.demo.data 17 | 18 | import android.util.Log 19 | import com.skydoves.flow.operators.demo.network.DisneyService 20 | import com.skydoves.flow.operators.demo.network.Poster 21 | import com.skydoves.sandwich.ApiResponse 22 | import kotlinx.coroutines.flow.Flow 23 | import kotlinx.coroutines.flow.flow 24 | 25 | class MainRepository(private val disneyService: DisneyService) { 26 | 27 | fun fetchPostersFlow(): Flow>> = flow { 28 | Log.d("MainRepository", "fetchPostersFlow") 29 | val response = disneyService.fetchDisneyPosters() 30 | emit(response) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/skydoves/flow/operators/demo/network/DisneyService.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2025 skydoves (Jaewoong Eum) 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.skydoves.flow.operators.demo.network 17 | 18 | import com.skydoves.sandwich.ApiResponse 19 | import retrofit2.http.GET 20 | 21 | interface DisneyService { 22 | 23 | @GET("DisneyPosters.json") 24 | suspend fun fetchDisneyPosters(): ApiResponse> 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/skydoves/flow/operators/demo/network/NetworkModule.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2025 skydoves (Jaewoong Eum) 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.skydoves.flow.operators.demo.network 17 | 18 | import com.skydoves.sandwich.retrofit.adapters.ApiResponseCallAdapterFactory 19 | import kotlinx.serialization.json.Json 20 | import okhttp3.MediaType.Companion.toMediaType 21 | import okhttp3.OkHttpClient 22 | import retrofit2.Retrofit 23 | import retrofit2.converter.kotlinx.serialization.asConverterFactory 24 | 25 | object NetworkModule { 26 | 27 | private val okHttpClient: OkHttpClient = 28 | OkHttpClient.Builder().build() 29 | 30 | private val retrofit: Retrofit = Retrofit.Builder() 31 | .client(okHttpClient) 32 | .baseUrl( 33 | "https://gist.githubusercontent.com/skydoves/aa3bbbf495b0fa91db8a9e89f34e4873/" + 34 | "raw/a1a13d37027e8920412da5f00f6a89c5a3dbfb9a/", 35 | ) 36 | .addConverterFactory(Json.asConverterFactory("application/json".toMediaType())) 37 | .addCallAdapterFactory(ApiResponseCallAdapterFactory.create()) 38 | .build() 39 | 40 | val disneyService: DisneyService = retrofit.create(DisneyService::class.java) 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/skydoves/flow/operators/demo/network/Poster.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2025 skydoves (Jaewoong Eum) 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.skydoves.flow.operators.demo.network 17 | 18 | import kotlinx.serialization.SerialName 19 | import kotlinx.serialization.Serializable 20 | 21 | @Serializable 22 | data class Poster( 23 | @SerialName("id") val id: Long, 24 | @SerialName("name") val name: String, 25 | @SerialName("release") val release: String, 26 | @SerialName("playtime") val playtime: String, 27 | @SerialName("description") val description: String, 28 | @SerialName("plot") val plot: String, 29 | @SerialName("poster") val poster: String, 30 | ) 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydoves/flow-operators/7a7555c5131d714c1653e3a204c7ece38fca5907/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydoves/flow-operators/7a7555c5131d714c1653e3a204c7ece38fca5907/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydoves/flow-operators/7a7555c5131d714c1653e3a204c7ece38fca5907/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydoves/flow-operators/7a7555c5131d714c1653e3a204c7ece38fca5907/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydoves/flow-operators/7a7555c5131d714c1653e3a204c7ece38fca5907/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydoves/flow-operators/7a7555c5131d714c1653e3a204c7ece38fca5907/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydoves/flow-operators/7a7555c5131d714c1653e3a204c7ece38fca5907/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydoves/flow-operators/7a7555c5131d714c1653e3a204c7ece38fca5907/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydoves/flow-operators/7a7555c5131d714c1653e3a204c7ece38fca5907/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydoves/flow-operators/7a7555c5131d714c1653e3a204c7ece38fca5907/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | flow-operators 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |