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
resConfigs "an", "ar", "ast", "az", "ban", "be", "bg", "bn", "br", "bs", "ca", "cak", "ceb", "ckb", "co", "cs", "cy", "da", "de", "dsb", | |
"el", "en_CA", "en_GB", "eo", "es", "es_AR", "es_CL", "es_ES", "es_MX", "et", "eu", "fa", "ff", "fi", "fr", "fur", "fy", "ga", "gd", "gl", "gn", "gu", | |
"hi", "hr", "hsb", "hu", "hy", "ia", "in", "is", "it", "iw", "ja", "ka", "kab", "kk", "kmr", "kn", "ko", "lij", "lo", "lt", "ml", "mr", | |
"my", "nb", "ne", "nl", "nn", "oc", "pa", "pl", "pt", "pt_BR", "pt_PT", "rm", "ro", "ru", "sat", "sc", "si", "sk", "skr", "sl", "sq", "sr", "su", "sv", "szl", | |
"ta", "te", "tg", "th", "tl", "tok", "tr", "trs", "tt", "tzm", "ug", "uk", "ur", "uz", "vec", "vi", "yo", "zh_CN", "zh_TW" |
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
@Composable | |
private fun ScrollingTextField( | |
text: String, | |
onValueChange: (String) -> Unit, | |
scrollState: ScrollState, | |
) { | |
val interactionSource = remember { MutableInteractionSource() } | |
val interactionSourceState = interactionSource.collectIsFocusedAsState() | |
val coroutineScope = rememberCoroutineScope() |
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
@Composable | |
private fun PhotosRow( | |
images: List<BeautifulCreature>, | |
numPhotosVisible: Float, | |
modifier: Modifier = Modifier, | |
) { | |
BoxWithConstraints(modifier = modifier) { | |
// Arbitrarily chosen 20 as number of "units" to divide the available width | |
val numGrids = 20 | |
// Using available space to calculate the space between items and itemWidth |
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
@ExperimentalFoundationApi | |
@Composable | |
fun LazyVerticalGrid( | |
cells: GridCells, | |
modifier: Modifier = Modifier, | |
state: LazyListState = rememberLazyListState(), | |
contentPadding: PaddingValues = PaddingValues(0.dp), | |
content: LazyGridScope.() -> Unit | |
) { | |
val scope = LazyGridScopeImpl() |
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
@Composable | |
private fun Thumbnails( | |
thumbnails: List<String>, | |
modifier: Modifier = Modifier, | |
) { | |
BoxWithConstraints(modifier) { | |
val boxWithConstraintsScope = this | |
val padding = Theme.dimens.grid_2 | |
val thumbnailSize = Theme.dimens.grid_6 | |
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
#!/bin/sh | |
VERSION=0.1.0 | |
SUBJECT=sms-retriever-hash-generator | |
USAGE="Usage: sms_retriever_hash_v9.sh --package package_name --keystore keystore_file" | |
# --- Options processing ------------------------------------------- | |
if [ $# == 0 ] ; then | |
echo $USAGE | |
exit 1; |
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
class PhoneNumberFormatter @Inject constructor( | |
private val phoneNumberUtil: PhoneNumberUtil | |
) { | |
fun formatToCountryCodeAndNationalNumber(phoneNumberWithCountryCode: String): Pair<Int, Long>? = | |
try { | |
// Can pass a default country code as the second param if there is one or an empty string if not | |
val number = phoneNumberUtil.parse(phoneNumberWithCountryCode, "") | |
Pair(number.countryCode, number.nationalNumber) | |
} catch (e: NumberParseException) { |
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
adb emu sms send "+351910000001" "Your verification code is 12345. Always be riding!" |
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
@Composable | |
fun VerificationCodeScreen() { | |
// UI | |
SmsRetrieverUserConsent { _, code -> viewModel.onSmsReceived(code) } | |
} | |
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
@Composable | |
fun SmsRetriever( | |
smsCodeLength: Int = SMS_CODE_LENGTH, | |
onSmsReceived: (message: String, code: String) -> Unit, | |
) { | |
val context = LocalContext.current | |
var shouldRegisterReceiver by remember { mutableStateOf(false) } | |
LaunchedEffect(Unit) { |
NewerOlder