Search in sources :

Example 1 with RippleView

use of com.balaganovrocks.yourmasterclean.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;
}
Also used : Intent(android.content.Intent) ImageView(android.widget.ImageView) RippleView(com.balaganovrocks.yourmasterclean.views.RippleView) TextView(android.widget.TextView) View(android.view.View) AppInfo(com.balaganovrocks.yourmasterclean.model.AppInfo)

Aggregations

Intent (android.content.Intent)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 AppInfo (com.balaganovrocks.yourmasterclean.model.AppInfo)1 RippleView (com.balaganovrocks.yourmasterclean.views.RippleView)1