| | |
| | | import androidx.collection.ArrayMap;
|
| | |
|
| | |
|
| | | import com.hdl.sdk.common.utils.LogUtils;
|
| | | import com.hdl.sdk.common.utils.ThreadToolUtils;
|
| | |
|
| | | import java.util.ArrayList;
|
| | |
| | | private EventDispatcher() {
|
| | | }
|
| | |
|
| | | private static class SingletonInstance {
|
| | | private static final EventDispatcher INSTANCE = new EventDispatcher();
|
| | | }
|
| | | // private static class SingletonInstance {
|
| | | private static final EventDispatcher instance = new EventDispatcher();
|
| | | // }
|
| | |
|
| | | public static EventDispatcher getInstance() {
|
| | | return SingletonInstance.INSTANCE;
|
| | | return instance;
|
| | | }
|
| | |
|
| | | public synchronized void register(Object tag, EventListener listener) {
|
| | |
| | | EVENT.remove(tag);
|
| | | }
|
| | | } catch (Exception ignored) {
|
| | |
|
| | | LogUtils.e("移除event异常1:"+ignored.getMessage());
|
| | | }
|
| | |
|
| | | }
|
| | | });
|
| | | }catch (Exception e){}
|
| | | }catch (Exception e){
|
| | | LogUtils.e("移除event异常2:"+e.getMessage());
|
| | | }
|
| | | }
|
| | |
|
| | | public synchronized void remove(Object tag, EventListener listener) {
|
| | |
| | | }
|
| | | }
|
| | | } catch (Exception ignored) {
|
| | |
|
| | | LogUtils.e("移除event异常1:"+ignored.getMessage());
|
| | | }
|
| | |
|
| | | }
|
| | | });
|
| | | }catch (Exception e){}
|
| | | }catch (Exception e){
|
| | | LogUtils.e("移除event异常2:"+e.getMessage());
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | ALL_TOPICS_EVENT.remove(listener);
|
| | | }
|
| | | } catch (Exception ignored) {
|
| | |
|
| | | LogUtils.e("移除event异常1:" + ignored.getMessage());
|
| | | }
|
| | |
|
| | | }
|
| | | });
|
| | | }catch (Exception e){}
|
| | | } catch (Exception e) {
|
| | | LogUtils.e("移除event异常2:" + e.getMessage());
|
| | | }
|
| | | }
|
| | |
|
| | | public synchronized void clear() {
|