I had a problem getting the new fancy SwipeRefreshLayout from the appcompat lib to work with a custom listview, in this case the StickyListHeaders. Since the First child of the SwipeRefreshLayout should be either a ScrollView or a pure List, some workaround had to be done.
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
import java.io.ByteArrayOutputStream | |
import java.io.File | |
import java.nio.charset.StandardCharsets.UTF_8 | |
import java.util.zip.GZIPInputStream | |
import java.util.zip.GZIPOutputStream | |
fun String.gzip(): ByteArray { | |
val bos = ByteArrayOutputStream() | |
GZIPOutputStream(bos).bufferedWriter(UTF_8).use { it.write(this) } | |
return bos.toByteArray() |