Skip to content

Instantly share code, notes, and snippets.

View kolanse's full-sized avatar

Samuel Ochuba kolanse

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kolanse
kolanse / ScoresAverageWorker
Created December 6, 2022 09:15
A simple Workmanager class to demonstrate how to create one.
class ScoresAverageWorker(
context: Context,
workerParams: WorkerParameters
) : Worker(context, workerParams) {
override suspend fun doWork(): Result {
val results = Results.List
val average = results.average()
var myEditText = findViewById<EditText>(R.id.myEditText)
myEditText.doOnTextChanged { text, start, before, count ->
run {
// run your code here.
// the text is the changed text
}
@kolanse
kolanse / IconView.kt
Created November 23, 2020 10:10 — forked from nickbutcher/IconView.kt
A prototype implementation of a shadow effect inspired by the Google Play Games app (https://play.google.com/store/apps/details?id=com.google.android.play.games).
/*
* Copyright 2017 Google Inc.
*
* 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 distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
<style name="spinnerTheme" parent= "Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu">
<item name="strokeColor">@color/grey</item>
<item name="endIconDrawable">@drawable/vector__spinner_dropdown</item>
</style>