This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Android keyboard state observer. | |
* For portrait orientation only. | |
* https://bit.ly/3flvZar | |
* 2020 [email protected]. | |
* | |
* Example of usage: | |
* viewLifecycleOwner.lifecycleScope.launch { | |
* [email protected]?.run { | |
* KeyboardObserver().observe(your_root_view_here).distinctUntilChanged().collect { ... } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 2021 Yuriy Timofeev <[email protected]>. | |
*/ | |
sealed class UiState<out T> where T : Any? { | |
object Loading : UiState<Nothing>() | |
data class Success<T>(val data: T) : UiState<T>() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2024 Yuriy Timofeev <[email protected]> | |
* | |
* Distributed under the Apache License 2. | |
* | |
* 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. | |
*/ |