Skip to content

Instantly share code, notes, and snippets.

View RadiationX's full-sized avatar
💭
I may be slow to respond.

Evgeny Nizamiev RadiationX

💭
I may be slow to respond.
View GitHub Profile
@RadiationX
RadiationX / pres-links.txt
Last active January 29, 2022 18:27
Ссылки по теме стилей в андроид
@RadiationX
RadiationX / ProgressMaterialButton.kt
Created December 7, 2022 08:15
Material button with progressbar
import android.content.Context
import android.content.res.TypedArray
import android.graphics.drawable.Animatable
import android.graphics.drawable.Drawable
import android.util.AttributeSet
import android.util.TypedValue
import com.google.android.material.R
import com.google.android.material.button.MaterialButton
import kotlin.math.roundToInt
@RadiationX
RadiationX / SearchSupportFragment_fix.kt
Last active March 12, 2024 12:26
Fix java.lang.IllegalArgumentException: Service not registered: android.speech.SpeechRecognizer$Connection
// add this to your implementation SearchSupportFragment
// put avoidSpeechRecognitinCrash() in your fragment before onPause()
override fun onPause() {
avoidSpeechRecognitinCrash()
super.onPause()
}
// "destroy" may throw java.lang.IllegalArgumentException: Service not registered: android.speech.SpeechRecognizer$Connection@dabd9b8
// do all this mehod's work and wrap "destroy" to try catch
// private void releaseRecognizer() {