Skip to content

Commit

Permalink
* [Issue #21] Delete unused/obsolete code.
Browse files Browse the repository at this point in the history
Removed obsolete/unused code.
  • Loading branch information
amaa-99 committed Sep 22, 2023
1 parent 733db4b commit 7b0b59b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
*/
public class LogRecyclerViewAdapter extends RecyclerView.Adapter<LogRecyclerViewAdapter.ViewHolder> {


private final List<LogData> logData;
private final Context context;
private LogData data;
Expand All @@ -58,55 +57,11 @@ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new ViewHolder(mView);
}

/*private Bitmap getAppIcon(PackageManager mPackageManager, ApplicationInfo applicationInfo) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
return getAppIcon26(mPackageManager, applicationInfo);
}
try {
Drawable drawable = mPackageManager.getApplicationIcon(applicationInfo);
return ((BitmapDrawable) drawable).getBitmap();
} catch (Exception e) {
Log.e(TAG, e.getMessage(), e);
}
return null;
}
@RequiresApi(api = Build.VERSION_CODES.O)
private Bitmap getAppIcon26(PackageManager mPackageManager, ApplicationInfo applicationInfo) {
Drawable drawable = mPackageManager.getApplicationIcon(applicationInfo);
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
} else if (drawable instanceof AdaptiveIconDrawable) {
Drawable backgroundDr = ((AdaptiveIconDrawable) drawable).getBackground();
Drawable foregroundDr = ((AdaptiveIconDrawable) drawable).getForeground();
Drawable[] drr = new Drawable[2];
drr[0] = backgroundDr;
drr[1] = foregroundDr;
LayerDrawable layerDrawable = new LayerDrawable(drr);
int width = layerDrawable.getIntrinsicWidth();
int height = layerDrawable.getIntrinsicHeight();
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
layerDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
layerDrawable.draw(canvas);
return bitmap;
}
return null;
}*/

@Override
public void onBindViewHolder(ViewHolder holder, int position) {
data = logData.get(position);
PackageManager manager = context.getPackageManager();
holder.bind(logData.get(position),recyclerItemClickListener);
holder.bind(logData.get(position), recyclerItemClickListener);
try {
Drawable applicationIcon = Api.getApplicationIcon(context, data.getUid());
holder.icon.setBackground(applicationIcon);
Expand Down Expand Up @@ -149,7 +104,6 @@ public int getItemCount() {
return logData.size();
}


public static class ViewHolder extends RecyclerView.ViewHolder {

final ImageView icon;
Expand Down
56 changes: 0 additions & 56 deletions app/src/main/java/dev/ukanth/ufirewall/util/AppIconHelperV26.java

This file was deleted.

0 comments on commit 7b0b59b

Please sign in to comment.