예제 #1
0
  private void checkScanFinish() {

    mAdapter.notifyDataSetChanged();

    if (mIsProcessScanFinish && mIsSysCacheScanFinish && mIsOverallScanFinish) {
      mIsScanning = false;

      JunkGroup cacheGroup = mJunkGroups.get(JunkGroup.GROUP_CACHE);
      ArrayList<JunkInfo> children = cacheGroup.mChildren;
      cacheGroup.mChildren = new ArrayList<>();
      for (JunkInfo info : children) {
        cacheGroup.mChildren.add(info);
        if (info.mChildren != null) {
          cacheGroup.mChildren.addAll(info.mChildren);
        }
      }
      children = null;

      long size = getTotalSize();
      String totalSize = CleanUtil.formatShortFileSize(this, size);
      mHeaderView.mSize.setText(totalSize);
      mHeaderView.mProgress.setText("共发现:" + totalSize);
      mHeaderView.mProgress.setGravity(Gravity.CENTER);

      mCleanButton.setEnabled(true);
    }
  }
예제 #2
0
  private void checkCleanFinish() {
    if (mIsProcessCleanFinish && mIsSysCacheCleanFinish && mIsOverallCleanFinish) {
      mHeaderView.mProgress.setText("清理完成");
      mHeaderView.mSize.setText(CleanUtil.formatShortFileSize(this, 0L));

      for (JunkGroup group : mJunkGroups.values()) {
        group.mSize = 0L;
        group.mChildren = null;
      }

      mAdapter.notifyDataSetChanged();
    }
  }