Skip to content

Instantly share code, notes, and snippets.

View swbain's full-sized avatar
🎛️

Stephen Bain swbain

🎛️
View GitHub Profile
@swbain
swbain / DelayEachItem.kt
Created November 24, 2018 04:57
Delay the emission of each item of an observable by a specified period and TimeUnit
fun <T> Observable<T>.delayEachItem(period: Long, timeUnit: TimeUnit): Observable<T> {
return concatMap { value -> Observable.interval(period, timeUnit).take(1).map { value } }
}
@swbain
swbain / SystemUiHelper.java
Created September 27, 2018 05:34 — forked from chrisbanes/SystemUiHelper.java
SystemUiHelper
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>