{"id":17319220,"url":"https://github.com/stefanhaustein/nativehtml","last_synced_at":"2025-04-14T14:15:45.265Z","repository":{"id":50301318,"uuid":"84673154","full_name":"stefanhaustein/nativehtml","owner":"stefanhaustein","description":"Renders HTML to native Android components.","archived":false,"fork":false,"pushed_at":"2018-12-02T18:26:58.000Z","size":300,"stargazers_count":45,"open_issues_count":5,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-14T14:15:39.527Z","etag":null,"topics":["android","html"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefanhaustein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-11T19:02:04.000Z","updated_at":"2025-04-12T19:53:23.000Z","dependencies_parsed_at":"2022-09-24T11:30:12.670Z","dependency_job_id":null,"html_url":"https://github.com/stefanhaustein/nativehtml","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanhaustein%2Fnativehtml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanhaustein%2Fnativehtml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanhaustein%2Fnativehtml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanhaustein%2Fnativehtml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanhaustein","download_url":"https://codeload.github.com/stefanhaustein/nativehtml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248894943,"owners_count":21179153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","html"],"created_at":"2024-10-15T13:23:03.569Z","updated_at":"2025-04-14T14:15:45.227Z","avatar_url":"https://github.com/stefanhaustein.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NativeHtml\n\nRenders HTML to native Android components. Easily extensible with custom native elements.\n\nThe main use case for this library is rendering HTML-formatted text or (custom) components in cases where TextView HTML capabilities are too limited and WebView is too heavyweight or not suitable for other reasons. \n\n## Use Cases\n\n * Formatted help pages with links directly into the application\n * Rendering server-provided content with custom native elements\n * Multiple components with HTML content in a single view where multiple WebView instances would be prohibitive in terms of resource consumption \n\n## Limitations\n\n * CSS is mostly limited to CSS 2\n * Floating elements are not supported\n * Formatted text is rendering using built-in TextViews with spans, which means that justified text is not supported.\n \n## Extensibility\n\n * To implement custom elements, extend `AndroidPlatform` and override `createElement`. Native Android views can be wrapped in `AndroidWrapperElement`\n * Platform-independent and platform-specific parts of the code base are clearly separated, so it should be straightforward to port the code to any platform that supports Java and provides a component for formatted text. \n * Layout managers are separated from containers. So while flexbox is currently not supported, it should be relatively straightforward to implement in a way similar to the existing `BlockLayout` and `TableLayout` classes.\n \n## Usage\n\nFor a simple example, please refer to the [demo](\nhttps://github.com/stefanhaustein/nativehtml/blob/master/demo-android/src/main/java/org/kobjects/nativehtml/demo/android/MainActivity.java)\n\n## Gradle\n\nJitpack for the win!\n\nStep 1: Add jitpack to your root build.gradle at the end of repositories:\n\n    allprojects {\n\t\t    repositories {\n\t\t\t  ...\n\t\t\t  maven { url 'https://jitpack.io' }\n\t\t    }\n\t    }\n\nStep 2: Add the HtmlView2 dependency\n\n\tdependencies {\n\t\tcompile 'com.github.stefanhaustein.nativehtml:android:v1.0.6'\n\t}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanhaustein%2Fnativehtml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanhaustein%2Fnativehtml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanhaustein%2Fnativehtml/lists"}