This file contains hidden or 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
<manifest> | |
<application> | |
<activity android:name=".MyActivity"> | |
<intent-filter | |
android:autoVerify="true" | |
tools:targetApi="m"> | |
<action android:name="android.intent.action.VIEW" /> |
This file contains hidden or 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
<actions> | |
<action intentName="actions.intent.GET_ITEM_LIST"> | |
<fulfillment | |
fulfillmentMode="actions.fulfillment.SLICE" | |
urlTemplate="content://test.aircall.todo.slices/todo{?name,category}"> | |
<parameter-mapping urlParameter="name" intentParameter="itemList.name" required="true" /> | |
<parameter-mapping urlParameter="category" intentParameter="itemList.category" /> | |
</fulfillment> |
This file contains hidden or 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
<actions> | |
<action intentName="actions.intent.CREATE_CALL"> | |
<fulfillment urlTemplate="https://aircall-test.io/call-number{?telephone}"> | |
<!-- Eg. telephone = "0987654321" --> | |
<parameter-mapping urlParameter="telephone" intentParameter="call.participant.telephone" required="true"/> | |
</fulfillment> | |
<fulfillment urlTemplate="https://aircall-test.io/call-name{?name}"> | |
<!-- Eg. contact = "John Doe" --> | |
<parameter-mapping urlParameter="name" intentParameter="call.participant.name" required="true"/> |
This file contains hidden or 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 PolyShape(private val sides: Int, private val radius: Float) : Shape { | |
override fun createOutline(size: Size, layoutDirection: LayoutDirection, density: Density): Outline { | |
return Outline.Generic(path = Path().apply { polygon(sides, radius, size.center) }) | |
} | |
} | |
fun Path.polygon(sides: Int, radius: Float, center: Offset) { | |
val angle = 2.0 * Math.PI / sides | |
moveTo( | |
x = center.x + (radius * cos(0.0)).toFloat(), |
This file contains hidden or 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 PolygonImageComposable(modifier: Modifier) { | |
val deltaXAnim = rememberInfiniteTransition() | |
val dx by deltaXAnim.animateFloat( | |
initialValue = 3f, | |
targetValue = 10f, | |
animationSpec = infiniteRepeatable( | |
animation = tween(4000, easing = LinearEasing), | |
repeatMode = RepeatMode.Reverse | |
) |
This file contains hidden or 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 TicketWaveComposable(modifier: Modifier) { | |
val deltaXAnim = rememberInfiniteTransition() | |
val dx by deltaXAnim.animateFloat( | |
initialValue = 0f, | |
targetValue = 1f, | |
animationSpec = infiniteRepeatable(animation = tween(500, easing = LinearEasing)) | |
) | |
CoilImage( |
This file contains hidden or 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 TicketComposable(modifier: Modifier) { | |
Text( | |
text = "🎉 CINEMA TICKET 🎉", | |
style = TextStyle( | |
color = Color.White, | |
fontSize = 22.sp, | |
fontWeight = FontWeight.Black, | |
), | |
textAlign = TextAlign.Center, |
This file contains hidden or 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
fun drawTicketPath(size: Size, cornerRadius: Float): Path { | |
return Path().apply { | |
reset() | |
// Top left arc | |
arcTo( | |
rect = Rect( | |
left = -cornerRadius, | |
top = -cornerRadius, | |
right = cornerRadius, | |
bottom = cornerRadius |
This file contains hidden or 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 TicketShape(private val cornerRadius: Float) : Shape { | |
override fun createOutline( | |
size: Size, | |
layoutDirection: LayoutDirection, | |
density: Density | |
): Outline { | |
return Outline.Generic( | |
// Draw your custom path here | |
path = drawTicketPath(size = size, cornerRadius = cornerRadius) |
This file contains hidden or 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
Text( | |
text = context.getString(R.string.timesup), | |
style = typography.h3.copy(color = red700), | |
textAlign = TextAlign.Center, | |
modifier = Modifier | |
.fillMaxWidth() | |
.padding(32.dp) | |
.border(width = 4.dp, color = red700, CutCornerShape(32.dp)) | |
.graphicsLayer { | |
shadowElevation = 8.dp.toPx() |