Skip to content

Instantly share code, notes, and snippets.

View KryptKode's full-sized avatar
🎯
Focusing

Paul KryptKode

🎯
Focusing
View GitHub Profile
@KryptKode
KryptKode / CredentialsPreferences.kt
Last active August 12, 2022 17:14
Different Shared Prefs
import android.content.SharedPreferences
import android.net.Credentials
class CredentialsPreferences @Inject constructor(
@SharedPref(SharedPrefsType.Credentials)
private val sharedPreferences: SharedPreferences,
) {
fun getCredentials(): Credentials {
@KryptKode
KryptKode / SpacesItemDecoration.kt
Created March 28, 2022 05:28
Item decorator for spaces in a RecyclerView
import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.RecyclerView
class SpacesItemDecoration(private val space: Int) : RecyclerView.ItemDecoration() {
override fun getItemOffsets(outRect: Rect, view: View,
parent: RecyclerView, state: RecyclerView.State) {
outRect.left = space
outRect.right = space
interface FileManager {
suspend fun checkIfFileExists(name: String): Boolean
fun saveFile(name: String, content: String): Boolean
fun readExternalFile(name: String): String
}
@KryptKode
KryptKode / GlideAppModule.kt
Last active February 8, 2021 09:55
ImageLoader
@GlideModule
class GlideAppModule : AppGlideModule()
package com.global.gomoney.ui.cardcustomise
import android.content.res.ColorStateList
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.annotation.ColorRes
import androidx.core.content.res.ResourcesCompat
import androidx.core.view.isVisible
import androidx.core.widget.ImageViewCompat
import androidx.recyclerview.widget.RecyclerView
class ButtonEvent : CustomEvent(){
override fun getEventName() {
return "event_tag" //event tag
}
}
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
/* compiled from: SeekFrameLayout */
class SeekBarAnimatorListenerAdapter extends AnimatorListenerAdapter {
final /* synthetic */ SeekFrameLayout a;
SeekBarAnimatorListenerAdapter(SeekFrameLayout seekFrameLayout) {
this.a = seekFrameLayout;
import android.content.Context
import androidx.core.content.ContextCompat
class RandomColorHelper(context: Context) {
private val allColors: List<Int> = listOf(
ContextCompat.getColor(context, R.color.color1),
ContextCompat.getColor(context, R.color.color2),
ContextCompat.getColor(context, R.color.color3),
@KryptKode
KryptKode / SendEmailUtil.kt
Created May 29, 2020 06:46
Helper for sending email android
import android.app.Activity
import android.content.Intent
import android.net.Uri
import androidx.appcompat.app.AppCompatActivity
import com.kryptkode.flashalerts.R
import javax.inject.Inject
/**
* Created by kryptkode on 2/26/2020.
@KryptKode
KryptKode / RatingDataProvider.kt
Last active May 29, 2020 06:36
Rating manager on androd
/**
* Created by kryptkode on 2/11/2020.
*/
interface RatingDataProvider {
fun setAgreeShowDialog(isAgree: Boolean)
fun getIsAgreeShowDialog(): Boolean
fun setRemindInterval()
fun getRemindInterval(): Long
fun setInstallDate()