Jetpack Compose Text composable to show html text from resources

Overview

HtmlText

Current Compose Version: 1.0.3

Compose HtmlText

Text composable to show html text from resources

Lint Ktlint

CodeFactor Maven Central

Add to your project

Add actual HtmlText library:

dependencies {
    implementation 'de.charlex.compose:html-text:1.0.0'
}

How does it work?

Use it like a normal Text composable

HtmlText(textId = R.string.hello_world)
Hello World. This text sentence is formatted in simple html. HtmlText ">
<resources>
    <string name="hello_world">Hello <b>Worldb>. This <i><strike>textstrike>sentencei> is form<b>att<u>edu>b> in simple html. <a href="https://github.com/ch4rl3x/HtmlText">HtmlTexta>string>
resources>

Preview

HtmlText

That's it!

License

Copyright 2021 Alexander Karkossa

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Expandable text, similar to Text() in Jetpack Compose
Expandable text, similar to Text() in Jetpack Compose

A small library to display expandable texts in Jetpack Compose.

Simple composable for rendering transitions between backstacks.
Simple composable for rendering transitions between backstacks.

compose-backstack Simple library for Jetpack Compose for rendering backstacks of screens and animated transitions when the stack changes. It is not a

Boat - A scoped and composable way to navigate

Boat Boat is an implementation of a scoped, simple and composable way to navigat

Pinocchio is a group of libraries for various common UI components. It could contain Composable, View, and everything related to UI.
Pinocchio is a group of libraries for various common UI components. It could contain Composable, View, and everything related to UI.

Pinocchio Pinocchio is a group of libraries for various common UI components. It could contain Composable, View, and everything related to UI. All UI

GlassmorphicColumn @Composable
GlassmorphicColumn @Composable

glassmorphic-composables GlassmorphicColumn @Composable GlassmorphicRow @Composable With Non-Image background Setup Gradle: allprojects { reposito

Add IndustrialTNT like from old IC2 mod which keeps items after explosion and helps to mine resources
Add IndustrialTNT like from old IC2 mod which keeps items after explosion and helps to mine resources

IndustrialTNT Add IndustrialTNT like from old IC2 mod which keeps items after ex

A Clean Architecture App to show use of multi module architecture in a Jetpack Compose
A Clean Architecture App to show use of multi module architecture in a Jetpack Compose

Nextflix-Composable A Clean Architecture App to show use of multi-module-archite

Icontent - Jetpack Compose component to show all random content sended by Inmersoft guide backend

icontent IContent is a library that allows loading audio visual content generica

Formula 1 app to show current Standings from a REST API.Built using jetpack compose and kotlin.
Formula 1 app to show current Standings from a REST API.Built using jetpack compose and kotlin.

Formula1 Formula 1 app to show Standings fetching data from REST API 📸 Screenshots Tech Stack. Kotlin - Kotlin is a programming language that can run

Comments
  • onClick/clickable functionality breaks when using HtmlText

    onClick/clickable functionality breaks when using HtmlText

    If a parent composable is listening for clicks, the HtmlText stops the clicks from occurring. Here is an example:

        Column {
            Card(
                modifier = Modifier.clickable {
                    println("Clicked the html card!") // never triggers
                }
            ) {
                HtmlText(text = "Some <b>bolded and cool</b> text that should click")
            }
    
            Button(
                onClick = {
                    println("Clicked the html button!") // never triggers
                }
            ) {
                HtmlText(text = "Some <b>bolded and cool</b> button")
            }
    
            Card(
                modifier = Modifier.clickable {
                    println("Clicked the non-html card!") // always triggers
                }
            ) {
                Text(text = "Some <b>bolded and cool</b> text that should click")
            }
    
            Button(
                onClick = {
                    println("Clicked the non-html button!") // always triggers
                }
            ) {
                Text(text = "Some <b>bolded and cool</b> button")
            }
        }
    

    What it looks like in preview: image

    opened by DFreds 3
  • Material dependency version

    Material dependency version

    Currently you have material dependency in buildCompose.gradle like this: implementation "androidx.compose.material:material:$compose_version"

    which is wrong because compose version and material version is not the same. Currently compose version is 1.2.0 and materil is 1.6.1

    opened by kaychyka17 2
Releases(1.4.1)
Owner
Alexander Karkossa
Alexander Karkossa
a set of Settings like composable items to help android Jetpack Compose developers build complex settings screens

This library provides a set of Settings like composable items to help android Jetpack Compose developers build complex settings screens without all the boilerplate

Bernat Borrás Paronella 178 Jan 4, 2023
This is a simple video games discovery app showcasing UI using Jetpack Compose with Clean Architecture and also tests for composable UI.

Jetpack-Compose-Video-Games-Example ?? This is a simple video games discovery app showcasing UI using Jetpack Compose and also tests for composable UI

Ruben Quadros 60 Dec 27, 2022
A library that enables Safe Navigation for you Composable destinations when using Jetpack Compose Navigation

A library that enables Safe Navigation for you Composable destinations when using Jetpack Compose Navigation

Roman Levinzon 59 Oct 19, 2022
Capturable - 🚀Jetpack Compose utility library for capturing Composable content and transforming it into Bitmap Image🖼️

Capturable ?? A Jetpack Compose utility library for converting Composable content into Bitmap image ??️ . Made with ❤️ for Android Developers and Comp

Shreyas Patil 494 Dec 29, 2022
Kapture - A small library for Jetpack Compose to capture Composable content to Android Bitmap

kapture A small utility library for Jetpack Compose to capture Composable conten

Kaustubh Patange 10 Dec 9, 2022
Flippable - A Jetpack Compose utility library to create flipping Composable views with 2 sides

?? Flippable A Jetpack Compose utility library to create flipping Composable views with 2 sides. Built with ❤︎ by Wajahat Karim and contributors Demo

Wajahat Karim 298 Dec 23, 2022
Mocking with Jetpack Compose - stubbing and verification of Composable functions

Mockposable A companion to mocking libraries that enables stubbing and verification of functions annotated with @androidx.compose.runtime.Composable.

Jesper Åman 21 Nov 15, 2022
A CLI utility to convert Jetpack Compose compiler metrics and reports to beautified 😍 HTML page

Compose Compiler Reports to HTML Generator A CLI utility to convert Jetpack Compose compiler metrics and reports to beautified ?? HTML page. Made with

Shreyas Patil 145 Jan 3, 2023
Sample app that shows how to create a bitmap from a Jetpack composable

Creating Bitmaps From Jetpack Composables This app demonstrates how to create a bitmap from a Jetpack composable without the need to display the compo

Johann Blake 14 Nov 29, 2022
Row Coloumn Box Compose Constraint Layout Modifier.xyz Animator Tween animation MutableState Creating custom composable Corners Canvas LaunchedEffect

Row Coloumn Box Compose Constraint Layout Modifier.xyz Animator Tween animation MutableState Creating custom composable Corners Canvas LaunchedEffect

Shivaraj M Patil 1 Apr 13, 2022