Skip to content

Instantly share code, notes, and snippets.

View t1r's full-sized avatar
📱
ссcrunch

t1r t1r

📱
ссcrunch
View GitHub Profile
@t1r
t1r / App.kt
Created April 5, 2021 13:36
VoxImplant SDK Issue - java.lang.UnsatisfiedLinkError
class App : Application() {
override fun onCreate() {
initVoxClient(applicationContext)
}
private fun initVoxClient(context: Context) {
voxClient = Voximplant.getClientInstance(
Executors.newSingleThreadExecutor(),
context,
@t1r
t1r / App.kt
Last active September 22, 2020 06:01
VoxImplant SDK Issue - java.lang.UnsatisfiedLinkError
class App : Application() {
override fun onCreate() {
initVoxClient(applicationContext)
}
private fun initVoxClient(context: Context) {
voxClient = Voximplant.getClientInstance( //row #168
Executors.newSingleThreadExecutor(),
context,
@t1r
t1r / InjectFeatureToFeature.kt
Last active September 21, 2020 11:05
Inject Feature To Feature [Bad Practice]
class GlobalFeature @Inject constructor()
: BaseFeature<
GlobalFeature.State,
>(
initialState = State(),
) {
data class State(
val isSmthInProgress: Boolean = false
)
package rxjava
import io.reactivex.Observable
import io.reactivex.Single
import io.reactivex.functions.BiConsumer
import java.util.concurrent.Callable
fun main() {
// val list = listOf(1, 2, 3, 4, 5)
val list = listOf<Int>()
@t1r
t1r / AndroidViewModel.java
Last active November 7, 2019 07:56
Android ViewModels
/*
* Copyright (C) 2017 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
@t1r
t1r / PrimaryButton.kt
Created October 25, 2019 10:53
ProgressBar cannot be displayed over a Button
import android.content.Context
import android.util.AttributeSet
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.ProgressBar
import androidx.appcompat.widget.AppCompatButton
import androidx.core.content.ContextCompat
import androidx.core.content.res.ResourcesCompat
import androidx.core.view.isVisible
import app.R
class PushPopMax {
private val mutableList = mutableListOf<Pair<Int, Int>>()
fun push(foo: Int) {
mutableList.lastOrNull { last ->
if (foo > last.second) {
mutableList.add(foo to foo)
} else {
mutableList.add(foo to last.second)
@t1r
t1r / ExmplAdapter.kt
Created December 20, 2018 09:45
Kotlin Extensions Question
class ExmplAdapter(context: Context,
@LayoutRes resource: Int,
items: List<ChipsAdapter.CounterPartyData>) :
ArrayAdapter<ChipsAdapter.CounterPartyData>(context, resource, items) {
fun evaluateWithoutNotify(action: (() -> Unit)) {
setNotifyOnChange(false)
action.invoke()
setNotifyOnChange(true)