DiffPayload(List<? extends EpoxyModel<?>> models) { if (models.isEmpty()) { throw new IllegalStateException("Models must not be empty"); } int modelCount = models.size(); if (modelCount == 1) { // Optimize for the common case of only one model changed. singleModel = models.get(0); modelsById = null; } else { singleModel = null; modelsById = new LongSparseArray<>(modelCount); for (EpoxyModel<?> model : models) { modelsById.put(model.id(), model); } } }
private LottieComposition createComposition(int startFrame, int endFrame) { LottieComposition composition = new LottieComposition(); composition.init(new Rect(), startFrame, endFrame, 1000, new ArrayList<Layer>(), new LongSparseArray<Layer>(0), new HashMap<String, List<Layer>>(0), new HashMap<String, LottieImageAsset>(0), new SparseArrayCompat<FontCharacter>(0), new HashMap<String, Font>(0)); return composition; }
@SuppressWarnings("SameParameterValue") private LottieComposition createComposition(int startFrame, int endFrame) { LottieComposition composition = new LottieComposition(); composition.init(new Rect(), startFrame, endFrame, 1000, new ArrayList<Layer>(), new LongSparseArray<Layer>(0), new HashMap<String, List<Layer>>(0), new HashMap<String, LottieImageAsset>(0), new SparseArrayCompat<FontCharacter>(0), new HashMap<String, Font>(0)); return composition; }
float endFrame = 0f; float frameRate = 0f; final LongSparseArray<Layer> layerMap = new LongSparseArray<>(); final List<Layer> layers = new ArrayList<>(); int width = 0;
new LongSparseArray<>(composition.getLayers().size());
LongSparseArray<Layer> layerMap = new LongSparseArray<>();
SavedState(Parcel in) { checkedItemCount = in.readInt(); checkStates = in.readSparseBooleanArray(); final int n = in.readInt(); if (n >= 0) { checkedIdStates = new LongSparseArray<>(n); for (int i = 0; i < n; i++) { final long key = in.readLong(); final int value = in.readInt(); checkedIdStates.append(key, value); } } }
@Deprecated protected static Map<Long, VCardBuilder> getVCardsFast(Context context, Collection<Long> IDs, Map<Long, String> lookupKeys) { LongSparseArray<VCardBuilder> toReturn = new LongSparseArray<>(); StringBuilder keys = new StringBuilder();
/** * Make sure this constructor is called before setting the adapter on the RecyclerView * so this class will be notified before the RecyclerView in case of data set changes. */ public MultiChoiceHelper(@NonNull AppCompatActivity activity, @NonNull RecyclerView.Adapter adapter) { this.activity = activity; this.adapter = adapter; adapter.registerAdapterDataObserver(new AdapterDataSetObserver()); checkStates = new SparseBooleanArray(0); if (adapter.hasStableIds()) { checkedIdStates = new LongSparseArray<>(0); } }