This file contains 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 <developer.tim4dev@gmail.com> | |
* | |
* 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. | |
*/ |
This file contains 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 <intelligence.worker@gmail.com>. | |
*/ | |
sealed class UiState<out T> where T : Any? { | |
object Loading : UiState<Nothing>() | |
data class Success<T>(val data: T) : UiState<T>() |
This file contains 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 intelligence.worker@gmail.com. | |
* | |
* Example of usage: | |
* viewLifecycleOwner.lifecycleScope.launch { | |
* this@MyFragment.view?.run { | |
* KeyboardObserver().observe(your_root_view_here).distinctUntilChanged().collect { ... } |