Skip to content

Vextil/json-viewer

Repository files navigation

android-json-view

Andorid JSON Viewer

With this library you can display JSON in an android view, you can click on an item to hide and show the sub tree.

Forked from: Android JSON Viewer

Usage

Gradle

dependencies {
    implementation 'sh.vex:jsonviewer:1.0.0'
}

Maven

<!-- <dependencies> section of pom.xml -->
<dependency>
    <groupId>sh.vex</groupId>
    <artifactId>jsonviewer</artifactId>
    <version>1.0.0</version>
</dependency>

Documentation 📖

<sh.vex.jsonviewer.JsonViewer
    android:id="@+id/jsonViewer"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

void setJson(Object json)

Set the JSON, must be org.json.JSONObject or org.json.JSONArray

void collapseJson()

It will collapse all nodes, except the main one.

void expandJson()

It will expands all the json nodes.

void setTextColorString(@ColorInt int color)

void setTextColorNumber(@ColorInt int color)

void setTextColorBool(@ColorInt int color)

void setTextColorNull(@ColorInt int color)

Examples

Default view

alt tag

About

Android JSON Viewer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published