Skip to content

Instantly share code, notes, and snippets.

View imashnake0's full-sized avatar
🐍

Kamalesh imashnake0

🐍
View GitHub Profile
@imashnake0
imashnake0 / AppBar.kt
Created May 24, 2023 22:58
Compose AppBar
package com.example.titl.appbar
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme.colorScheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
@imashnake0
imashnake0 / Extensions.md
Last active January 14, 2023 02:07
Kotlin Extensions

Kotlin Extensions

This gist will host some nice extensions for anything Kotlin.

Double.kt

/**
 * Rounds a [Double] to [numberOfPlaces].
 */
fun Double.roundTo(numberOfPlaces: Int): Double {
 return round(this*10.0.pow(numberOfPlaces))/10.0.pow(numberOfPlaces)
@imashnake0
imashnake0 / RAndroidDevConvos.md
Last active March 13, 2023 14:40
Notable /r/AndroidDev discussions
@imashnake0
imashnake0 / (:app) build.gradle.kts
Last active May 9, 2022 22:14
Adding Hilt dependencies (2.41+)
plugins {
// ...
// Put `kapt` below the plugin.
id("com.google.dagger.hilt.android")
kotlin("kapt")
}
android {
// ...
}