Skip to content

Instantly share code, notes, and snippets.

View tomriddle25's full-sized avatar

Faisal tomriddle25

View GitHub Profile
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
@cedrickring
cedrickring / ColoredShadow.kt
Last active April 18, 2024 10:29
Draw a colored shadow in Android Jetpack Compose
/*
Copyright 2020 Cedric Kring.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@Zhuinden
Zhuinden / LoginViewModel.kt
Created June 19, 2020 00:51
Hilt LoginViewModel Login
fun onLoginClicked() {
val username = // ...
navigationDispatcher.emit { navController ->
navController.navigate(
LoggedOutGraphDirections.loggedOutToLoggedIn(username))
}
}
}
@romkatv
romkatv / Pure style for Powerlevel10k.md
Last active May 4, 2024 16:34
Pure style for Powerlevel10k

Powerlevel10k can generate the same prompt as Pure.

pure

Installation

git clone https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
@deepakpk009
deepakpk009 / add_git_submodule.txt
Created August 8, 2017 09:26
how to add a git android library project as a sub module, to a project
how to add a git android library project as a sub module, to a project
1. create an android project
2. add to vcs (vcs - import into version control - create git repository)
3. goto terminal and add sub-module - make sure the location folder name is different than the original project name
git submodule add https://XXX@bitbucket.org/YYY/ZZZ.git
4. goto file menu - project structure
5. click '+' on left top
6. select 'import gradle project'
@Kishanjvaghela
Kishanjvaghela / converter.sh
Last active November 17, 2022 11:26
Create Image drawable for all resolutions
if [ $# -eq 0 ]; then
echo "No arguments supplied"
else if [ -f "$1" ]; then
echo " Creating different dimensions (dips) of "$1" ..."
mkdir -p drawable-xxhdpi
mkdir -p drawable-xhdpi
mkdir -p drawable-hdpi
mkdir -p drawable-mdpi
if [ $1 = "ic_launcher.png" ]; then