use of com.yzy.supercleanmaster.views.RippleView in project superCleanMaster by joyoyao.
the class SoftwareAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
convertView = infater.inflate(R.layout.listview_software, null);
holder = new ViewHolder();
holder.appIcon = (ImageView) convertView.findViewById(R.id.app_icon);
holder.appName = (TextView) convertView.findViewById(R.id.app_name);
holder.size = (TextView) convertView.findViewById(R.id.app_size);
holder.ripleUninstall = (RippleView) convertView.findViewById(R.id.riple_uninstall);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
final AppInfo item = (AppInfo) getItem(position);
if (item != null) {
holder.appIcon.setImageDrawable(item.getAppIcon());
holder.appName.setText(item.getAppName());
if (item.isInRom()) {
holder.size.setText(StorageUtil.convertStorage(item.getPkgSize()));
} else {
holder.size.setText(StorageUtil.convertStorage(item.getPkgSize()));
}
//holder.size.setText(StorageUtil.convertStorage(item.getUid()));
}
holder.ripleUninstall.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setAction("android.intent.action.DELETE");
intent.addCategory("android.intent.category.DEFAULT");
intent.setData(Uri.parse("package:" + item.getPackname()));
mContext.startActivity(intent);
}
});
return convertView;
}