@Override public void onNext(final RxDebugger.Stats stats) { if (stats.removed) { @Nullable RxDebugger.Stats r = statsMap.remove(stats.subscriberId); if (null != r) { orderedStats.remove(r); } } else { @Nullable RxDebugger.Stats r = statsMap.put(stats.subscriberId, stats); if (null != r) { orderedStats.remove(r); } orderedStats.insert(stats); } if (null != debugFragment) { @Nullable DebugOverlayView debugOverlayView = debugFragment.getDebugOverlayView(); if (null != debugOverlayView) { DebugOverlayView.ViewSummary rootViewSummary = DebugOverlayView.ViewSummary.create(orderedStats); debugOverlayView.setRootViewSummary(rootViewSummary); } } notifyDataSetChanged(); }
@Override public void onError(Throwable e) { statsMap.clear(); orderedStats.clear(); if (null != debugFragment) { @Nullable DebugOverlayView debugOverlayView = debugFragment.getDebugOverlayView(); if (null != debugOverlayView) { debugOverlayView.setRootViewSummary(null); } } notifyDataSetChanged(); }