use of com.zhan_dui.adapters.DownloadAdapter in project AnimeTaste by daimajia.
the class DownloadService method onCreate.
@Override
public void onCreate() {
super.onCreate();
missionAdapter = new DownloadAdapter(this);
}
use of com.zhan_dui.adapters.DownloadAdapter in project AnimeTaste by daimajia.
the class DownloadActivity method onItemLongClick.
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
Object obj = mDownloadList.getAdapter().getItem(position);
if (obj instanceof Mission) {
final Mission m = (Mission) obj;
show(R.string.tip, getString(R.string.stop_mission, m.getSaveName()), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mBinder.stopMission(m.getMissionID());
}
});
} else if (obj instanceof DownloadRecord) {
final DownloadRecord r = (DownloadRecord) obj;
String msg = getString(R.string.surely_delete, r.Name);
show(R.string.tip, msg, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String path = r.SaveDir + r.SaveFileName;
File f = new File(path);
if (f.exists() && f.isFile()) {
f.delete();
}
new Delete().from(DownloadRecord.class).where("AnimationId = ?", r.AnimationId).executeSingle();
DownloadAdapter adapter = (DownloadAdapter) mDownloadList.getAdapter();
adapter.reloadData();
}
});
}
return true;
}
Aggregations