摘要: 自定义viewGroup测量以及子view布局 通常上,自定义viewGroup需要给子view进行测量,布局两个步骤,今天我们看看简单的自定义标签布局应该怎么实现 假如我以及子view全部测量好了,那我只要在onlayout里面 override fun onLayout(changed: Boo 阅读全文
posted @ 2021-07-02 10:24 c-若曦 阅读(397) 评论(0) 推荐(0)
摘要: 使用案列 layout.xml <com.example.rx_demo.MyView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:te 阅读全文
posted @ 2021-07-02 10:08 c-若曦 阅读(154) 评论(0) 推荐(0)
摘要: override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { val size = 200f.dp super.onMeasure(widthMeasureSpec, heightMeasureSpec) //通过父v 阅读全文
posted @ 2021-07-02 09:42 c-若曦 阅读(69) 评论(0) 推荐(0)
摘要: class MyGroupView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : ViewGroup(context, attrs, defSty 阅读全文
posted @ 2021-07-02 09:32 c-若曦 阅读(81) 评论(0) 推荐(0)
摘要: val threadLocal= ThreadLocal<Any>() threadLocal.set("hhahah") threadLocal.get() public void set(T value) { Thread t = Thread.currentThread(); ThreadLo 阅读全文
posted @ 2021-07-02 09:26 c-若曦 阅读(51) 评论(0) 推荐(0)
摘要: post → @Subscribe 方法流程 1.post 调用EventBus this.dispatcher.dispatch(event, eventSubscribers); 2.dispatcher = Dispatcher.perThreadDispatchQueue() 3. new 阅读全文
posted @ 2021-07-02 09:24 c-若曦 阅读(66) 评论(0) 推荐(0)
摘要: 今天我们看看OkHttpClient 里面的一些配置信息 final Dispatcher dispatcher; //线程调度器 final @Nullable Proxy proxy; //直连,代理,还是socket的,枚举 final List<Protocol> protocols; // 阅读全文
posted @ 2021-07-02 09:18 c-若曦 阅读(214) 评论(0) 推荐(0)
摘要: okhttp3 源码初探 使用范例 val client = OkHttpClient() val request: Request = Request.Builder() .url("https://api.github.com/users/octocat/repos") .build() cli 阅读全文
posted @ 2021-07-02 09:15 c-若曦 阅读(81) 评论(0) 推荐(0)