12 | * 邮箱: Ellison.Sun0808@outlook.com
13 | * 博客: 简书博客
14 | */
15 | public interface WsStatusListener {
16 | public void onOpen(WebSocket webSocket, Response response);
17 |
18 | public void onMessage(WebSocket webSocket, String text);
19 |
20 | public void onMessage(WebSocket webSocket, ByteString bytes);
21 |
22 | public void onClosing(WebSocket webSocket, int code, String reason);
23 |
24 | public void onClosed(WebSocket webSocket, int code, String reason);
25 |
26 | public void onFailure(WebSocket webSocket, Throwable t, @javax.annotation.Nullable Response response);
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/ellison/websocket/utils/RxLifecycleUtils.java:
--------------------------------------------------------------------------------
1 | package com.ellison.websocket.utils;
2 |
3 | import android.arch.lifecycle.LifecycleOwner;
4 |
5 | import com.uber.autodispose.AutoDispose;
6 | import com.uber.autodispose.AutoDisposeConverter;
7 | import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider;
8 |
9 | /**
10 | * @author ellison
11 | * @date 2018年11月23日
12 | * @desc 用一句话描述这个类的作用
13 | */
14 | public class RxLifecycleUtils {
15 | private RxLifecycleUtils() {
16 | throw new IllegalStateException("Can't instance the RxLifecycleUtils");
17 | }
18 |
19 | /**
20 | * 释放内存
21 | *
22 | * @param lifecycleOwner
23 | * @param
9 |
17 |
22 |
29 |