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
| PlayStore.enabled=false | |
| abi.type=x86_64 | |
| avd.ini.encoding=UTF-8 | |
| hw.cpu.arch=x86_64 | |
| hw.cpu.ncore=2 | |
| hw.ramSize=2048 | |
| hw.lcd.density=120 | |
| hw.lcd.width=320 | |
| hw.lcd.height=480 | |
| hw.audioInput=no |
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 = "Hello world" | |
| ) |
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 = "...", | |
| overflow = TextOverflow.Ellipsis | |
| ) |
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
| ClickableText( | |
| text = annotatedString, | |
| onClick = { | |
| annotatedString | |
| .getStringAnnotations(TAG_URL, it, it) | |
| .firstOrNull() | |
| ?.let { url -> uriHandler.openUri(url.item) } | |
| } | |
| ) |
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 attachLink( | |
| source: String, | |
| segment: String, | |
| link: String | |
| ): AnnotatedString { | |
| val builder = AnnotatedString.Builder() // builder to attach metadata(link) | |
| builder.append(source) // load current text into the builder | |
| val start = source.indexOf(segment) // get the start of the span "my website" | |
| val end = start + segment.length // get the end of the span |
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
| private const val TAG_URL = "ANNOTATION_TAG_URL" | |
| @Composable | |
| fun MainText() { | |
| val uriHandler = UriHandlerAmbient.current // utility to open links in a browser | |
| val text = "Here is my website." // "my website" contains a link | |
| val link = "https://dmytroshuba.com/" | |
| val annotatedText = attachLink( | |
| source = text, |
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
| object TextAppearance { | |
| val Medium = SpanStyle( | |
| fontSize = 32.sp, | |
| color = Color.Black, | |
| background = Color.Gray | |
| ) | |
| } |
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
| val medium = SpanStyle( | |
| fontSize = 32.sp, | |
| color = Color.Black, | |
| background = Color.Gray | |
| ) |
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
| <style name="TextAppearance.MyApp.Medium" parent="TextAppearance.AppCompat.Medium"> | |
| <item name="android:textSize">32sp</item> | |
| <item name="android:color">@color/black</item> | |
| <item name="background">@color/gray</item> | |
| </style> |
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 GalleryItem(item: PhotographItem) { | |
| Column( | |
| modifier = Modifier.padding(AppTheme.dimensions.paddingMedium) | |
| ) { | |
| Text( | |
| text = item.description, | |
| style = AppTheme.typography.body, | |
| color = AppTheme.colors.textPrimary | |
| modifier = Modifier.padding(AppTheme.dimensions.paddingSmall) |
NewerOlder