Skip to content

Instantly share code, notes, and snippets.

View Redman1037's full-sized avatar
🐘

Manohar Reddy Redman1037

🐘
View GitHub Profile
@ditn
ditn / DynamicMeshNetwork.kt
Created September 30, 2020 08:03
Dynamic Mesh Network animation in Compose
private val PARTICLE_COLOR = Color.White
private val LINE_COLOR = Color.White
private const val PARTICLE_QUANTITY = 100
private const val DEFAULT_SPEED = 2
private const val VARIANT_SPEED = 1
private const val DEFAULT_RADIUS = 4
private const val VARIANT_RADIUS = 2
private const val LINK_RADIUS = 200
// TODO: 30/09/2020 These should be measured but are only used to calculate
// the initial position
@mirmilad
mirmilad / debounce.kt
Last active June 21, 2023 22:46
Simple debounce extension for LiveData by using Coroutines
import androidx.lifecycle.LiveData
import androidx.lifecycle.MediatorLiveData
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
fun <T> LiveData<T>.debounce(duration: Long = 1000L, coroutineScope: CoroutineScope) = MediatorLiveData<T>().also { mld ->
val source = this
@loftywaif002
loftywaif002 / api_keys_android.md
Last active June 4, 2024 13:03
Hiding Api Keys in Anroid

Hiding API keys in local.properties

  1. Make sure your build directory is gitignored. It should be, by default, in a new Android Studio project -- you can double check by making sure that your .gitignore file contains the line:
/build
  1. In your project root directory, add the API key to local.properties file like this:
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;
@tpb1908
tpb1908 / Extensions.kt
Created July 3, 2017 19:41
Useful Android Kotlin extension functions
package com.tpb.brainfuck
import android.support.design.widget.FloatingActionButton
import android.support.v7.widget.RecyclerView
import android.text.Editable
import android.text.TextWatcher
import android.util.Log
import android.widget.TextView
/**
@bkhezry
bkhezry / proguard-rules.pro
Last active September 2, 2020 15:50
Proguard rules for popular libraries.
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\bkhezry\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here: