# Kotlin-Flow-Android-Examples **Repository Path**: urustop1/Kotlin-Flow-Android-Examples ## Basic Information - **Project Name**: Kotlin-Flow-Android-Examples - **Description**: Kotlin Flow Android Examples - How to use it in Android Project - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-26 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Kotlin-Flow-Android-Examples - Learn Flow for Android by Examples [![Mindorks](https://img.shields.io/badge/mindorks-opensource-blue.svg)](https://mindorks.com/open-source-projects) [![Mindorks Community](https://img.shields.io/badge/join-community-blue.svg)](https://mindorks.com/join-community) [![Mindorks Android Store](https://img.shields.io/badge/Mindorks%20Android%20Store-Kotlin%20Flow%20Android%20Examples-blue.svg?style=flat)](https://mindorks.com/android/store) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://opensource.org/licenses/Apache-2.0) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/MindorksOpenSource/Kotlin-Flow-Android-Examples/blob/master/LICENSE) ### This project is for: * Who wants to learn Kotlin Flow ### Just Build the project and start learning Flow by examples. If you want to get started with Kotlin Flow, [checkout the blog](https://blog.mindorks.com/what-is-flow-in-kotlin-and-how-to-use-it-in-android-project) # Kotlin Flow Operators Examples present in this sample project * `Filter` -> Returns a flow containing only values of the original flow that matches the given condition * `Zip` -> Zips values from the current flow with another flow * `FilterIsInstance` -> Returns a flow containing only values that are instances of specified data type * `FilterNot` -> Returns a flow containing only values of the original flow that do not match the given condition * `FilterNotNull` -> Returns a flow containing only values of the original flow that are not null. * `FlatMapConcat` -> Transforms the flow and then concatenating and flattening these flows. * `FlatMapLatest` -> Transforms the flow and then flattening last flows * `FlatMapMerge` -> Transforms elements emitted by the original flow, that returns another flow, and then merging and flattening these flows. * `FlattenConcat` -> Flattens the given flow of flows into a single flow * `DistinctUntilChanged` -> suppress duplicate items emitted * `FlattenMerge` -> Flattens the given flow of flows into a single flow with alimit on the number of concurrently collected flows. * `Map` -> Returns a flow containing the results of applying the given condition * `Merge` -> Merges the given flows into a single flow without preserving an order of elements. * `OnCompletion` -> Invokes it when the given flow is completed or cancelled * `OnStart` -> Invokes it when the given flow is started * `ScanReduce` -> Reduces the given flow with give condition, emitting every intermediate result, including initial value * `TransformLatest` -> Transforms the last item collected from flow ## If this project helps you in anyway, show your love :heart: by putting a :star: on this project :v: ### Learn to build a ride-sharing Android app like Uber, Lyft - [Check here](https://github.com/MindorksOpenSource/ridesharing-uber-lyft-app) [Check out MindOrks awesome open source projects here](https://mindorks.com/open-source-projects) ### License ``` Copyright (C) 2020 MINDORKS NEXTGEN PRIVATE LIMITED Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```