This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.DisposableEffect | |
import androidx.compose.ui.platform.LocalLifecycleOwner | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleEventObserver | |
import androidx.lifecycle.LifecycleOwner | |
@Composable | |
fun ComposableLifecycleListener( | |
lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity | |
import android.content.Context | |
import android.content.ContextWrapper | |
import android.view.WindowManager.LayoutParams.FLAG_SECURE | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.material3.Text | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.Alignment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
implementation("com.google.crypto.tink:tink-android:1.13.0") // check latest version | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.security.crypto.MasterKeys | |
import com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm | |
object TinkCryptoManager { | |
// Get / Create Keys using Android Keystore | |
private val aesKeystore = | |
AndroidKeystoreAesGcm(MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC)) | |
fun encrypt(plainText: String): ByteArray = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Read Blog - https://www.ksharma.xyz/android-adb-shortcuts-for-productivity | |
## A11y - Talkback | |
alias TalkbackOn="adb shell settings put secure enabled_accessibility_services com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackService" | |
alias TalkbackOff="adb shell settings put secure enabled_accessibility_services com.android.talkback/com.google.android.marvin.talkback.TalkBackService" | |
## A11y - FontSize | |
alias LargeFontSize="adb shell settings put system font_scale 2.0" # Largest font size for android devices | |
alias MediumFontSize="adb shell settings put system font_scale 1.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by Wire protocol buffer compiler, do not edit. | |
// Source: User in xyz/ksharma/pokemon/user.proto | |
@file:Suppress("DEPRECATION") | |
package xyz.ksharma.user | |
import com.squareup.wire.FieldEncoding | |
import com.squareup.wire.Message | |
import com.squareup.wire.ProtoAdapter | |
import com.squareup.wire.ProtoReader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
option java_package = "xyz.ksharma.user"; | |
option java_outer_classname = "User"; | |
message User { | |
string id = 1; | |
string name = 2; | |
int32 age = 3; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In libs.versions.toml | |
wire = { id = "com.squareup.wire", version.ref = "wire"} | |
// In build.gradle.kts (module level) | |
plugins { | |
alias(libs.plugins.wire) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Kotlin | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: |