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
fn append_stylesheet() { | |
let document = window() | |
.expect("Couldn't get window") | |
.document() | |
.expect("Couldn't get document"); | |
let styles = document | |
.create_element("style") | |
.expect("Couldn't create style node"); | |
styles | |
.append_with_node_1( &document.create_text_node(&include_str!("../src/style.css"))) |
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
import kotlinx.coroutines.experimental.DefaultDispatcher | |
import kotlinx.coroutines.experimental.channels.ReceiveChannel | |
import kotlinx.coroutines.experimental.channels.consumeEach | |
import kotlinx.coroutines.experimental.channels.produce | |
import kotlinx.coroutines.experimental.delay | |
import kotlinx.coroutines.experimental.runBlocking | |
import kotlin.coroutines.experimental.CoroutineContext | |
fun <T> ReceiveChannel<T>.debounce( | |
wait: Long = 300, |
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
private const val ROUTER_STATES_KEY = "STATE" | |
/** | |
* This is the base implementation of a [Controller] which works hand in hand with the [BottomNavigationView]. | |
* | |
* It is designed to work like that: | |
* * [Textual explanation](https://i.imgur.com/EqqQyOY.png) | |
* * [Visual explanation](https://i.imgur.com/FDb6EGU.png) | |
* | |
* In other words. It should be behave exactly like the [iOS TabBar](http://apple.co/2y6XIrL) |
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
/* | |
Inspired by http://cokere.com/RFC3339Date.txt | |
All rights deserve to Chad Okere | |
*/ | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.Locale; | |
import java.util.TimeZone; |