Search in sources :

Example 1 with ProgressDrawable

use of us.shandian.giga.ui.common.ProgressDrawable in project NewPipe by TeamNewPipe.

the class MissionAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(MissionAdapter.ViewHolder h, int pos) {
    DownloadMission ms = mManager.getMission(pos);
    h.mission = ms;
    h.position = pos;
    Utility.FileType type = Utility.getFileType(ms.name);
    h.icon.setImageResource(Utility.getIconForFileType(type));
    h.name.setText(ms.name);
    h.size.setText(Utility.formatBytes(ms.length));
    h.progress = new ProgressDrawable(mContext, Utility.getBackgroundForFileType(type), Utility.getForegroundForFileType(type));
    h.bkg.setBackgroundDrawable(h.progress);
    h.observer = new MissionObserver(this, h);
    ms.addListener(h.observer);
    updateProgress(h);
}
Also used : Utility(us.shandian.giga.util.Utility) DownloadMission(us.shandian.giga.get.DownloadMission) ProgressDrawable(us.shandian.giga.ui.common.ProgressDrawable)

Aggregations

DownloadMission (us.shandian.giga.get.DownloadMission)1 ProgressDrawable (us.shandian.giga.ui.common.ProgressDrawable)1 Utility (us.shandian.giga.util.Utility)1