System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
@echo off | |
setlocal | |
rem Change to suit your configuration. | |
set netmask=192.168 | |
rem Set adb. | |
if [%1] == [] ( | |
set adb=%ANDROID_HOME%\platform-tools\adb.exe | |
) else ( |
class ViewModelFactory constructor( | |
private val baseRepository: BaseRepository, // your repository class to handle database, network, shared preferences, etc. | |
owner: SavedStateRegistryOwner, | |
defaultArgs: Bundle? = null | |
) : AbstractSavedStateViewModelFactory(owner, defaultArgs) { | |
// usage in activity: | |
// val sharedVM by viewModels<MySharedViewModel> { ViewModelFactory(App.getRep(), this) } | |
// App.getRep() returns instance of BaseRepository, replace with your actual logic | |
class OutlineSpan( | |
@ColorInt private val strokeColor: Int, | |
@Dimension private val strokeWidth: Float | |
): ReplacementSpan() { | |
override fun getSize( | |
paint: Paint, | |
text: CharSequence, | |
start: Int, | |
end: Int, |
// IMPORTANT! READ THIS FIRST | |
// Assisted Injection doesn't work with @HiltViewModel or @ViewModelInject | |
// Read more about the issue here: https://github.com/google/dagger/issues/2287 | |
// | |
// | |
// AssistedInject and Hilt working together in v2.28-alpha times | |
// Example of a ViewModel using AssistedInject injected in a Fragment by Hilt | |
// As AssistedInject isn't part of Dagger yet, we cannot use in | |
// conjuction with @ViewModelInject |
import android.security.keystore.KeyGenParameterSpec | |
import android.security.keystore.KeyProperties | |
import java.security.* | |
import javax.crypto.* | |
import javax.crypto.spec.GCMParameterSpec | |
import android.util.Base64 | |
import androidx.annotation.VisibleForTesting | |
class EncryptionAES { |
import androidx.compose.material.LocalTextStyle | |
import androidx.compose.material.Text | |
import androidx.compose.runtime.* | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.draw.drawWithContent | |
import androidx.compose.ui.graphics.Color | |
import androidx.compose.ui.text.AnnotatedString | |
import androidx.compose.ui.text.TextStyle | |
import androidx.compose.ui.text.font.FontFamily | |
import androidx.compose.ui.text.font.FontStyle |
import androidx.compose.ui.graphics.Color | |
// Material Color Resources | |
val amber_050 = Color(0xFFfff8e1) // Use with black text | |
val amber_100 = Color(0xFFffecb3) // Use with black text | |
val amber_200 = Color(0xFFffe082) // Use with black text | |
val amber_300 = Color(0xFFffd54f) // Use with black text | |
val amber_400 = Color(0xFFffca28) // Use with black text | |
val amber_500 = Color(0xFFffc107) // Use with black text |
System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
/* | |
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, |
--- Actions --- | |
$Copy <M-C> | |
$Cut <M-X> <S-Del> | |
$Delete <Del> <BS> <M-BS> | |
$LRU | |
$Paste <M-V> | |
$Redo <M-S-Z> <A-S-BS> | |
$SearchWeb <A-S-G> | |
$SelectAll <M-A> | |
$Undo <M-Z> |