[Test Week] Add ViewPoolTest
Number of new tested methods: 3 Bug: 353303621 Test: This is the unit test Flag: NONE - unit test Change-Id: I13f1a7bad41c07368cff3d544120d1f41c92b603
This commit is contained in:
@@ -24,6 +24,7 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.AnyThread;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.UiThread;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.launcher3.util.ViewPool.Reusable;
|
||||
|
||||
@@ -43,9 +44,16 @@ public class ViewPool<T extends View & Reusable> {
|
||||
|
||||
public ViewPool(Context context, @Nullable ViewGroup parent,
|
||||
int layoutId, int maxSize, int initialSize) {
|
||||
this(LayoutInflater.from(context).cloneInContext(context),
|
||||
parent, layoutId, maxSize, initialSize);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
ViewPool(LayoutInflater inflater, @Nullable ViewGroup parent,
|
||||
int layoutId, int maxSize, int initialSize) {
|
||||
mLayoutId = layoutId;
|
||||
mParent = parent;
|
||||
mInflater = LayoutInflater.from(context);
|
||||
mInflater = inflater;
|
||||
mPool = new Object[maxSize];
|
||||
|
||||
if (initialSize > 0) {
|
||||
|
||||
Reference in New Issue
Block a user