mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-30 19:31:26 +00:00
Reduce memory usage
This commit is contained in:
parent
19c71580a5
commit
8d6da69180
1 changed files with 6 additions and 0 deletions
|
@ -69,6 +69,9 @@ import android.widget.PopupMenu;
|
|||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bumptech.glide.load.DecodeFormat;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -335,6 +338,7 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> im
|
|||
else {
|
||||
Uri uri = Uri.parse("android.resource://" + rule.packageName + "/" + rule.icon);
|
||||
GlideApp.with(context)
|
||||
.applyDefaultRequestOptions(new RequestOptions().format(DecodeFormat.PREFER_RGB_565))
|
||||
.load(uri)
|
||||
.override(iconSize, iconSize)
|
||||
.into(holder.ivIcon);
|
||||
|
@ -833,6 +837,8 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> im
|
|||
public void onViewRecycled(ViewHolder holder) {
|
||||
super.onViewRecycled(holder);
|
||||
|
||||
GlideApp.with(context).clear(holder.ivIcon);
|
||||
|
||||
CursorAdapter adapter = (CursorAdapter) holder.lvAccess.getAdapter();
|
||||
if (adapter != null) {
|
||||
Log.i(TAG, "Closing access cursor");
|
||||
|
|
Loading…
Reference in a new issue