欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

詳解Android平臺JSON預覽(JSON-handle)

 更新時間:2018年09月11日 08:35:06   作者:振興  
這篇文章主要介紹了Android平臺JSON預覽(JSON-handle),小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

開發(fā)中需要用到json,在瀏覽器顯示的json非常亂,難以理解。有沒有讓人一目了然的工具,讓json看起來非常直觀呢,json-handle隨之而出,包含火狐和chrome兩種插件,官方地址:http://jsonhandle.sinaapp.com/

Chrome常用的插件 JSON-handle ,用過的都知道。

對于經(jīng)常在瀏覽器調(diào)試json的你,json-handle是個不二的選擇.最近在做接口加密,所有的數(shù)據(jù)( requestresponse )都是加密數(shù)據(jù),無法溝通 fildder 或者 Charles 抓包查看。那么自己做一個查看 json` 格式的View`:支持動態(tài)的放大,縮小,支持所有數(shù)據(jù)格式~!

效果圖:

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()

文章到這里就全部講述完啦,若有其他需要交流的可以留言哦~!~!希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關文章

最新評論