Android平臺JSON預覽(JSON-handle)
Chrome常用的外掛 ofollow,noindex">JSON-handle ,用過的都知道。
最近在做介面加密,所有的資料( request
和 response
)都是加密資料,無法溝通 fildder
或者 Charles
抓包檢視。那麼自己做一個檢視 json`
格式的View`:支援動態的放大,縮小,支援所有資料格式~!

效果圖:

GitHub地址: JsonHandleView
依賴
implementation 'com.tzx.json:jsonhandleview:1.0.0'
使用
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" android:orientation="vertical"> <com.dandan.jsonhandleview.library.JsonViewLayout android:id="@+id/jsonView" android:layout_width="match_parent" android:layout_height="wrap_content" /> </FrameLayout>
JsonViewLayout jsonViewLayout = findViewById(R.id.jsonView); jsonViewLayout.bindJson("your json strings." || JSONObject || JSONArray);
自定義風格
// Color jsonViewLayout.setKeyColor() jsonViewLayout.setObjectKeyColor() jsonViewLayout.setValueTextColor() jsonViewLayout.setValueNumberColor() jsonViewLayout.setValueNullColor() jsonViewLayout.setValueBooleanColor() jsonViewLayout.setArrayLengthColor() // TextSize jsonViewLayout.setTextSize()
文章到這裡就全部講述完啦,若有其他需要交流的可以留言哦~!~!
想閱讀作者的更多文章,可以檢視我個人部落格 和公共號:
