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
package com.composables.composetheme.samples | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.clickable | |
import androidx.compose.foundation.gestures.Orientation | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.Row | |
import androidx.compose.foundation.layout.fillMaxSize |
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
<script type="text/javascript" src="https://project-reviews.vercel.app/js/iframeResizer.min.js"></script> | |
<iframe id="appreviews-iframe" src="https://project-reviews.vercel.app/iframe?id=1" frameBorder="0" scrolling="no" width="100%"></iframe> | |
<script type="text/javascript">iFrameResize({log: false, checkOrigin: false}, "#appreviews-iframe");</script> |
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
package com.amarland.simplesvgdsl | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.material3.MaterialTheme | |
import androidx.compose.material3.darkColorScheme |
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
/** | |
* Contains all color defined in the 2014 Material Design color palette. | |
* | |
* | |
*/ | |
object MaterialColors { | |
val Red50 = Color(0xFFFFEBEE) | |
val Red100 = Color(0xFFFFCDD2) | |
val Red200 = Color(0xFFEF9A9A) | |
val Red300 = Color(0xFFE57373) |
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
var selectedOptionText by remember { mutableStateOf("") } | |
val options = listOf("Cupcake", "Donut", "Eclair", "Froyo", "Gingerbread") | |
val filtered = options | |
.filter { it.lowercase().contains(selectedOptionText.lowercase()) } | |
val expanded = selectedOptionText.isNotEmpty() && filtered.isNotEmpty() | |
&& options.none { it.lowercase() == selectedOptionText.lowercase() } | |
ExposedDropdownMenuBox( | |
expanded = expanded, |
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
// Java version of node-machine-id. Used to identify a Mac, for software installation or licenses purposes. | |
// See the node project at https://github.com/automation-stack/node-machine-id | |
suspend fun machineId(): String { | |
val platformUUID = getPlatformUUID() | |
return DigestUtils.sha256Hex(platformUUID) | |
} | |
private fun expose(result: String): String { | |
val startIndex = result.substringAfter("IOPlatformUUID").substringBefore("\n") |
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 SafeContent( | |
systemBarsColor: Color = Color(0xFF082A3A), | |
content: @Composable () -> Unit | |
) { | |
Box( | |
modifier = Modifier | |
.background(systemBarsColor) | |
.systemBarsPadding() | |
.background(MaterialTheme.colors.background) |
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
// instead of a LinearLayout (horizontal) use: | |
Row { | |
Text("Main Header") | |
Spacer(Modifier.weight(1f)) | |
Text("23 mins ago") | |
} | |
// instead of FrameLayout use: | |
Box { |
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 ConversationItem( | |
modifier: Modifier = Modifier, | |
onClick: () -> Unit, | |
title: String, | |
snippet: String, | |
unread: Boolean = false, | |
timestamp: String, | |
profilePainters: List<Painter>, | |
) { |
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.content.Intent | |
import android.net.Uri | |
import android.provider.CalendarContract | |
import android.provider.Settings | |
import java.util.Calendar | |
fun sendTextMessage(phoneNumber: String): Intent { | |
return Intent( | |
Intent.ACTION_SENDTO, | |
smrUri(phoneNumber) |
NewerOlder