Skip to content

Instantly share code, notes, and snippets.

{
"meta": {
"theme": "papirus"
},
"basics": {
"name": "Mahendran Vadivalagan",
"label": "Mobile Apps Developer",
"image": "https://avatars0.githubusercontent.com/u/416209?s=460&u=38f220a2c9c658141804f881c334c594eb1642ac&v=4",
"summary": "Mobile app developer with 10+ years of SDLC expertise, coordinating seamlessly with backend teams. A detail-oriented problem solver known for quick learning and strong analytical and interpersonal skills.",
"website": "https://mahendranv.github.io",
@mahendranv
mahendranv / dependencies.gradle
Last active October 27, 2021 07:18
Android - Utility belt for project start
// Last updated: Oct 27,2021
{
// OkHttp3 - BOM
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.2"))
implementation("com.squareup.okhttp3:okhttp")
implementation("com.squareup.okhttp3:logging-interceptor")
// OkHttp3
val CarShape = GenericShape { size, _ ->
val w = 2f// size.width
val h = 2f //size.height
moveTo(24f * w, 102.5f * h)
cubicTo(12.61f * w, 63.56f * h, 43.55f * w, 58.61f * h, 95.5f * w, 49.5f * h)
cubicTo(101.31f * w, 36.52f * h, 103.58f * w, 29.07f * h, 103.5f * w, 15f * h)
cubicTo(231.66f * w, 3.43f * h, 240.99f * w, 48.65f * h, 237.5f * w, 102.5f * h)
lineTo(213f * w, 102.5f * h)
@mahendranv
mahendranv / Polygons.kt
Last active August 1, 2021 18:38
Polygons - demo
package com.ex2.dribbble.lab
import androidx.annotation.IntRange
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Slider
val HeartShape = GenericShape { size, _ ->
val h = size.height
val w = size.width
lineTo(0.5f*w, 0.25f*h)
cubicTo(0.5f*w, 0.225f*h, 0.458333333333333f*w, 0.125f*h, 0.291666666666667f*w, 0.125f*h)
cubicTo(0.0416666666666667f*w, 0.125f*h, 0.0416666666666667f*w, 0.4f*h, 0.0416666666666667f*w, 0.4f*h)
cubicTo(0.0416666666666667f*w, 0.583333333333333f*h, 0.208333333333333f*w, 0.766666666666667f*h, 0.5f*w, 0.916666666666667f*h)
cubicTo(0.791666666666667f*w, 0.766666666666667f*h, 0.958333333333333f*w, 0.583333333333333f*h, 0.958333333333333f*w, 0.4f*h)
cubicTo(0.958333333333333f*w, 0.4f*h, 0.958333333333333f*w, 0.125f*h, 0.708333333333333f*w, 0.125f*h)
cubicTo(0.583333333333333f*w, 0.125f*h, 0.5f*w, 0.225f*h, 0.5f*w, 0.25f*h)
@mahendranv
mahendranv / Tag.kt
Created July 9, 2021 16:25
A tag shape
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.GenericShape
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.ex2.dribbble.ui.theme.DribbleUITheme
@mahendranv
mahendranv / LifecycleAwareTimer.kt
Created June 18, 2021 14:13
A timer that race to a given time and declutters activity.
import android.os.CountDownTimer
import androidx.lifecycle.*
/**
* Any lifecycle owner that need a timer should implement this.
*/
interface TimerCallback : LifecycleOwner {
fun onTick(millisUntilFinished: Long)
@mahendranv
mahendranv / MyApolloClient.kt
Created May 16, 2021 14:29
Setup to convert timestamp to DateTime in GraphQL
/**
* Timestamp delivered as string from API. This adapter takes care of encode / decode the same.
*/
private val timeStampAdapter = object : CustomTypeAdapter<LocalDateTime> {
private val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSz")
override fun decode(value: CustomTypeValue<*>): LocalDateTime {
return try {
LocalDateTime.parse(value.value.toString(), formatter)
@mahendranv
mahendranv / WeatherCard.kt
Last active May 17, 2021 18:38
Weather Card implementation using Jetpack Compose
//// Pager gradle dependency ////
implementation "com.google.accompanist:accompanist-pager:0.9.0"
implementation "com.google.accompanist:accompanist-pager-indicators:0.9.0"
// Data model
data class WeatherCard(
val time: String,
val message: String,
)
@mahendranv
mahendranv / CTRL+N
Created May 26, 2014 06:44
ABD shell combined keyevent CTRL+N
adb shell sendevent /dev/input/event0 0 114 1
adb shell sendevent /dev/input/event0 0 42 1
adb shell sendevent /dev/input/event0 0 42 0
adb shell sendevent /dev/input/event0 0 114 0