|
@@ -55,6 +55,7 @@ public class AppInfoAdapter extends BaseAdapter {
|
|
|
View view = null;
|
|
|
ViewHolder holder = null;
|
|
|
if (convertview == null || convertview.getTag() == null) {
|
|
|
+ // TODO: 2020-10-13
|
|
|
view = infater.inflate(R.layout.lv_item, null); //设置布局
|
|
|
holder = new ViewHolder(view);
|
|
|
view.setTag(holder);
|
|
@@ -65,14 +66,17 @@ public class AppInfoAdapter extends BaseAdapter {
|
|
|
final AppInfo Appinfo = (AppInfo) getItem(position);
|
|
|
holder.icon.setImageDrawable(Appinfo.getAppIcon());
|
|
|
holder.appNmae.setText(Appinfo.getAppName());
|
|
|
- holder.packageName.setText("包名:" + Appinfo.getPackageName());
|
|
|
+ holder.packageName.setText(String.format("%s%s", mContext.getString(R.string.pack_name), Appinfo.getPackageName()));
|
|
|
if (!TextUtils.isEmpty(Appinfo.getLuancherActivity())) {
|
|
|
- holder.launcherName.setText("启动类名:" + Appinfo.getLuancherActivity());
|
|
|
+ holder.launcherName.setText(String.format("%s%s", mContext.getString(R.string.start_class), Appinfo.getLuancherActivity()));
|
|
|
+ holder.launcherName.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ holder.launcherName.setVisibility(View.GONE);
|
|
|
}
|
|
|
view.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- SimplexToast.show(mContext, "包名已复制到剪切板");
|
|
|
+ SimplexToast.show(mContext, mContext.getString(R.string.pack_coped));
|
|
|
//获取剪贴板管理器:
|
|
|
ClipboardManager cm = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
|
|
// 创建普通字符型ClipData
|
|
@@ -91,10 +95,10 @@ public class AppInfoAdapter extends BaseAdapter {
|
|
|
TextView launcherName;
|
|
|
|
|
|
public ViewHolder(View view) {
|
|
|
- this.icon = (ImageView) view.findViewById(R.id.icon);
|
|
|
- this.appNmae = (TextView) view.findViewById(R.id.appNmae);
|
|
|
- this.packageName = (TextView) view.findViewById(R.id.packageName);
|
|
|
- this.launcherName = (TextView) view.findViewById(R.id.launcherName);
|
|
|
+ this.icon = view.findViewById(R.id.icon);
|
|
|
+ this.appNmae = view.findViewById(R.id.appNmae);
|
|
|
+ this.packageName = view.findViewById(R.id.packageName);
|
|
|
+ this.launcherName = view.findViewById(R.id.launcherName);
|
|
|
}
|
|
|
}
|
|
|
}
|