Skip to content

Instantly share code, notes, and snippets.

View iamnaran's full-sized avatar
🐧
git gitlich

Narayan Panthi iamnaran

🐧
git gitlich
View GitHub Profile
@iamnaran
iamnaran / layout.xml
Created October 26, 2022 15:53
Layout of Upload Documents
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
@iamnaran
iamnaran / nepal_address_provinces_list.json
Created April 19, 2023 16:05
Nepal Address - Province with its District & Municipalities
[
{
"allDistrictList": [
{
"area_sq_km": "1507",
"headquarter": "Bhojpur",
"id": 1,
"municipalityList": [
{
"area_sq_km": "241.15",
@iamnaran
iamnaran / CurrencyOffsetMapping.kt
Created January 27, 2024 08:51 — forked from damianpetla/CurrencyOffsetMapping.kt
Transforming EditText value into currency
import androidx.compose.ui.text.input.OffsetMapping
class CurrencyOffsetMapping(originalText: String, formattedText: String) : OffsetMapping {
private val originalLength: Int = originalText.length
private val indexes = findDigitIndexes(originalText, formattedText)
private fun findDigitIndexes(firstString: String, secondString: String): List<Int> {
val digitIndexes = mutableListOf<Int>()
var currentIndex = 0
for (digit in firstString) {
@iamnaran
iamnaran / AuthNavGraph.kt
Last active April 10, 2025 16:09
Nested Navigation with Multiple Back Stack Android Jetpack Compose
fun NavGraphBuilder.authNavGraph(navController: NavHostController) {
navigation(
startDestination = AppScreen.Auth.Login.route,
route = AppScreen.Auth.route
) {
composable(route = AppScreen.Auth.Login.route) {
LoginScreen(
navigateToHome = {
navController.navigate(AppScreen.Main.route) {