Skip to content

Instantly share code, notes, and snippets.

View Miha-x64's full-sized avatar
🍵
へ‿(◉‿◉)‿ㄏ

Mike Miha-x64

🍵
へ‿(◉‿◉)‿ㄏ
View GitHub Profile
class GradientStrokeDrawable : Drawable() {
var radius: Float = 0f
set(radius) {
if (field != radius) {
check(radius.isFinite() && radius >= 0f)
field = radius
path.rewind()
invalidateSelf()
}
@Miha-x64
Miha-x64 / _AsyncVox.md
Last active April 10, 2023 09:29
async-await for VoxImplant VoxEngine

This library provides several awaitable commands to VoxImplant VoxEngine API.

This is unnofficial community-driven software licensed under Apache 2.0 and provided “as is”, without warranty of any kind.

Idea

There's a plenty of event listeners and async callbacks, as always in JS. The idea is to provide a handy way of managing async operations and awaiting their results.

@Miha-x64
Miha-x64 / GsonNullValueSkipping.java
Last active June 9, 2022 14:19
Gson has serializeNulls() setting but doesn't have dontDeserializeNulls(). This is useful to avoid assigning nulls to properties keeping their default values assigned in constructor instead.
import com.google.gson.Gson;
import com.google.gson.JsonIOException;
import com.google.gson.TypeAdapter;
import com.google.gson.internal.JsonReaderInternalAccess;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
import com.google.gson.stream.MalformedJsonException;
import okhttp3.MediaType;
@Miha-x64
Miha-x64 / FlexibleNumberPicker.java
Last active December 3, 2021 13:45
NumberPicker fork supporting gravity, scale and alpha interpolation, typeface styling, and more.
/*
* Copyright (C) 2008 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
@Miha-x64
Miha-x64 / EditableAdapter.kt
Last active July 10, 2023 09:24
Another approach to EditTexts inside RecyclerView
import android.text.Editable
import android.text.SpannableStringBuilder
import android.view.ViewGroup
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
import android.widget.EditText
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView