Skip to content

Instantly share code, notes, and snippets.

View wangerekaharun's full-sized avatar

Harun Wangereka wangerekaharun

View GitHub Profile
@wangerekaharun
wangerekaharun / ComposeFilter.kt
Created October 27, 2019 10:41
Sample code for filtering a list in compose
@Composable
fun FilteredList(contacts : List<Contact>, filterTet : String = ""){
val state = +state { filterTet }
VerticalScroller{
Column{
TextField(filterText, onValueChange { state.value = it }){
contacts.filter{ it.contains(state.value) }.forEach {
Row{
Image(it.photo)
Text(it.name
fun setStatus(status : String) = when(status){
"active" -> 1
"inActive" -> 2
"notSet" -> 3
else -> 0
}
fun setStatus(status : String) : Int{
if( status == "active"){
return 1
}
if (status == "inActive"){
return 2
}
infix fun<T> List<T>.iterateList(lambda : (item : T) -> Unit) = this.forEach(lambda)
userList.forEach{ userList ->
print(userList)
}
.takeIf { it.size > 0 }
?.firstOrNull()
?.run {
(0 until childCount).map { x ->
getChild(x)
}.filter {
it != null && it.text != null
&& it.className.contains("Name")
&& FixTitleUtils.shouldFixTitle(it.text.toString())
}.map {
private fun setLiked(isLiked: Boolean) {
fab.setImageResource(when {
isLiked -> R.drawable.ic_favorite_onyx_24dp
else -> R.drawable.ic_favorite_border_onyx_24dp
})
}
private void setLiked(boolean isLiked) {
if(isLiked) {
fab.setImageResource(R.drawable.ic_favorite_onyx_24dp);
} else {
fab.setImageResource(R.drawable.ic_favorite_border_onyx_24dp);
}
}
private fun setLiked(isLiked: Boolean?) {
isLiked?.let {
fab?.setImageResource(if (it) R.drawable.ic_favorite_onyx_24dp else R.drawable.ic_favorite_border_onyx_24dp)
}
}

Speaker Rider

by Tatiana Mac

Before I'll agree to a speaking event, I try to do as much research I can around the event to ensure it aligns with my ethos. I want to share this in case it's helpful to any other speakers.

👐 Speaking comes with immense privilege. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most marginalised and suppressed communities.

😫 I wish I didn't have to, but this is long because I provide a lot of explanations for those of you who never had to consider these things. And I will be honest, most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

1️⃣ All of these are based on my own ethos. I don't wish to or attempt to speak on behalf of all conference speake