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 Greeting(name: String) { | |
Text (text = "Hello $name!", modifier = Spacing(24.dp)) | |
} |
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 Greeting(name: String) { | |
Surface(color = Color.Yellow){ | |
Text (text = "Hello $name!") | |
} | |
} |
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 Greeting(name: String) { | |
Text (text = "Hello $name!") | |
} |
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 Greeting(name: String) { | |
Text (text = "Hello $name!") | |
} |
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
fun createSlice(sliceUri: Uri): Slice { | |
val activityAction = createActivityAction() | |
return list(context, sliceUri, INFINITY) { | |
row { | |
title = "Perform action in app" | |
primaryAction = activityAction | |
} | |
} | |
} |
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
<provider | |
android:name=".MySliceProvider" | |
android:authorities="com.boncuk.slicesdemo" | |
android:exported="true"> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW"/> | |
<category android:name="android.app.slice.category.SLICE"/> | |
<data |
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
/** | |
* Construct the Slice and bind data if available. | |
*/ | |
override fun onBindSlice(sliceUri: Uri): Slice? { | |
// Note: you should switch your build.gradle dependency to | |
// slice-builders-ktx for a nicer interface in Kotlin. | |
val context = context ?: return null | |
val activityAction = createActivityAction() ?: return null | |
return if (sliceUri.path == "/hello") { | |
// Path recognized. Customize the Slice using the androidx.slice.builders API. |
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
<provider | |
android:name=".MySliceProvider" | |
android:authorities="com.boncuk.slicesdemo" | |
android:exported="true"> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW"/> | |
<category android:name="android.app.slice.category.SLICE"/> | |
<data |
NewerOlder