Android平台JSON预览(JSON-handle)

Chrome常用的插件JSON-handle,用过的都知道。
最近在做接口加密,所有的数据(requestresponse)都是加密数据,无法沟通fildder或者Charles抓包查看。那么自己做一个查看json``格式的View:支持动态的放大,缩小,支持所有数据格式~!

json-handle.png

效果图:

json-handle.jpg

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

文章到这里就全部讲述完啦,若有其他需要交流的可以留言哦~!~!

想阅读作者的更多文章,可以查看我 个人博客 和公共号:


振兴书城

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值