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
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>
<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
ororg.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)
Default view