make LayoutInflater instances persistent per Context

Also implement LayoutInfater.cloneInContext() and support mutipe View
factories at once.

This is needed, so that androidx can repace all normal Views with
appcompat Views, which is needed for proper tint color support.
This commit is contained in:
Julian Winkler
2025-01-27 18:16:25 +01:00
parent cb64c13f2d
commit 9c454accca
4 changed files with 18 additions and 6 deletions

View File

@@ -282,7 +282,7 @@ public class ArrayAdapter<T> extends BaseAdapter /*implements Filterable*/ {
}
private void init(Context context, int resource, int textViewResourceId, List<T> objects) {
mContext = context;
mInflater = new LayoutInflater(context);
mInflater = (LayoutInflater)context.getSystemService("layout_inflater");
mResource = mDropDownResource = resource;
mObjects = objects;
mFieldId = textViewResourceId;