This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun AppCompatEditText.afterTextChangedFlow(): Flow<Editable?> { | |
return callbackFlow { | |
val watcher = object : TextWatcher { | |
override fun afterTextChanged(s: Editable?) { | |
offer(s) | |
} | |
override fun beforeTextChanged( | |
s: CharSequence?, | |
start: Int, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.annotation.SuppressLint | |
import android.content.Context | |
import android.content.res.Resources | |
import android.graphics.* | |
import android.graphics.drawable.Drawable | |
import android.graphics.drawable.GradientDrawable | |
import android.text.TextPaint | |
import android.text.TextUtils | |
import android.util.AttributeSet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.graphics.Canvas | |
import android.util.AttributeSet | |
import android.view.View | |
class SnowFlakeView @JvmOverloads constructor( | |
context: Context, | |
attrs: AttributeSet? = null, | |
defStyleAttr: Int = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//check if jetifier can be turned off | |
plugins { | |
id "com.github.plnice.canidropjetifier" version "0.5" | |
} | |
//command | |
./gradlew -Pandroid.enableJetifier=false canIDropJetifier | |
//check the unused/transitively used/wrongly delcared deps | |
plugins { | |
id("com.autonomousapps.dependency-analysis") version "0.54.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.animation.ValueAnimator; | |
import android.animation.ValueAnimator.AnimatorUpdateListener; | |
import android.annotation.SuppressLint; | |
import android.content.Context; | |
import android.content.res.ColorStateList; | |
import android.content.res.TypedArray; | |
import android.os.Build.VERSION; | |
import android.os.Build.VERSION_CODES; | |
import android.os.Parcel; | |
import android.os.Parcelable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DoubleProgressCircleIndicator @JvmOverloads constructor( | |
context: Context, | |
attrs: AttributeSet? = null, | |
defStyleAttr: Int = 0 | |
) : View(context, attrs, defStyleAttr) { | |
private val darkGreenPaint = Paint().apply { | |
style = Paint.Style.FILL | |
color = ContextCompat.getColor(context, R.color.colorGreenDuskGreen) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@POST https://fcm.googleapis.com/fcm/send | |
HEADERS: | |
Authorization key=AAAA... (Server key) | |
Content-Type application/json | |
BODY: | |
{ | |
"to": "/topics/topicName", | |
"content_available": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Singleton | |
class HostSelectionInterceptor : Interceptor { | |
var host: String? = null | |
set(value) { | |
field = value?.toHttpUrlOrNull()?.host | |
} | |
@Throws(IOException::class) | |
override fun intercept(chain: Interceptor.Chain): okhttp3.Response { |