Exemplo n.º 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);
    }
  }
Exemplo n.º 2
0
 private void dealWithHttpReturned(String result) {
   Gson gson = new Gson();
   AcademyResult r = gson.fromJson(result, AcademyResult.class);
   String resultCode = r.getResult().getErrorcode();
   if (HttpResult.SUCCESS.equals(resultCode)) {
     List<AcademyClass> academyClasses = r.getAcademys();
     mItems.addAll(academyClasses);
     mAdapter.notifyDataSetChanged();
   } else if (HttpResult.FAIL.equals(resultCode)) {
   } else {
     Toaster.showShort(AcademyActivity.this, "请求出错,请重试");
   }
 }
Exemplo n.º 3
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();
    }
  }
Exemplo n.º 4
0
 @Override
 public void notifyDataSetChanged() {
   // Refresh List rows
   super.notifyDataSetChanged();
 }
 @Override
 public void notifyDataSetChanged() {
   super.notifyDataSetChanged();
 }