Tabnine Logo
androidx.collection
Code IndexAdd Tabnine to your IDE (free)

How to use androidx.collection

Best Java code snippets using androidx.collection (Showing top 20 results out of 315)

origin: airbnb/lottie-android

private static void putInterpolator(int hash, WeakReference<Interpolator> interpolator) {
 // This must be synchronized because get and put isn't thread safe because
 // SparseArrayCompat has to create new sized arrays sometimes.
 synchronized (KeyframeParser.class) {
  pathInterpolatorCache.put(hash, interpolator);
 }
}
origin: airbnb/lottie-android

private static SparseArrayCompat<WeakReference<Interpolator>> pathInterpolatorCache() {
 if (pathInterpolatorCache == null) {
  pathInterpolatorCache = new SparseArrayCompat<>();
 }
 return pathInterpolatorCache;
}
origin: airbnb/lottie-android

 public void clear() {
  cache.evictAll();
 }
}
origin: airbnb/lottie-android

@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;
}
origin: airbnb/lottie-android

@Nullable
public LottieComposition get(@Nullable String cacheKey) {
 if (cacheKey == null) {
  return null;
 }
 return cache.get(cacheKey);
}
origin: airbnb/lottie-android

public void put(@Nullable String cacheKey, LottieComposition composition) {
 if (cacheKey == null) {
  return;
 }
 cache.put(cacheKey, composition);
}
origin: airbnb/lottie-android

@RestrictTo(RestrictTo.Scope.LIBRARY)
public Layer layerModelForId(long id) {
 return layerMap.get(id);
}
origin: sockeqwe/AdapterDelegates

/**
 * Get the {@link AdapterDelegate} associated with the given view type integer
 *
 * @param viewType The view type integer we want to retrieve the associated
 *                 delegate for.
 * @return The {@link AdapterDelegate} associated with the view type param if it exists,
 * the fallback delegate otherwise if it is set or returns <code>null</code> if no delegate is
 * associated to this viewType (and no fallback has been set).
 */
@Nullable
public AdapterDelegate<T> getDelegateForViewType(int viewType) {
  return delegates.get(viewType, fallbackDelegate);
}
origin: airbnb/epoxy

public void put(EpoxyViewHolder holder) {
 holders.put(holder.getItemId(), holder);
}
origin: airbnb/epoxy

@Override
public boolean hasNext() {
 return position < holders.size();
}
origin: airbnb/lottie-android

public boolean useTextGlyphs() {
 return textDelegate == null && composition.getCharacters().size() > 0;
}
origin: airbnb/epoxy

@Override
public EpoxyViewHolder next() {
 if (!hasNext()) {
  throw new NoSuchElementException();
 }
 return holders.valueAt(position++);
}
origin: airbnb/epoxy

public void remove(EpoxyViewHolder holder) {
 holders.remove(holder.getItemId());
}
origin: sockeqwe/AdapterDelegates

/**
 * Removes the adapterDelegate for the given view types.
 *
 * @param viewType The Viewtype
 * @return self
 */
public AdapterDelegatesManager<T> removeDelegate(int viewType) {
  delegates.remove(viewType);
  return this;
}
origin: airbnb/lottie-android

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;
}
origin: airbnb/epoxy

@Nullable
public EpoxyViewHolder get(EpoxyViewHolder holder) {
 return holders.get(holder.getItemId());
}
origin: airbnb/lottie-android

@Nullable
private static WeakReference<Interpolator> getInterpolator(int hash) {
 // This must be synchronized because get and put isn't thread safe because
 // SparseArrayCompat has to create new sized arrays sometimes.
 synchronized (KeyframeParser.class) {
  return pathInterpolatorCache().get(hash);
 }
}
origin: airbnb/lottie-android

 private static void parseChars(
   JsonReader reader, LottieComposition composition,
   SparseArrayCompat<FontCharacter> characters) throws IOException {
  reader.beginArray();
  while (reader.hasNext()) {
   FontCharacter character = FontCharacterParser.parse(reader, composition);
   characters.put(character.hashCode(), character);
  }
  reader.endArray();
 }
}
origin: airbnb/epoxy

public int size() {
 return holders.size();
}
origin: airbnb/epoxy

@Nullable
public EpoxyViewHolder getHolderForModel(EpoxyModel<?> model) {
 return holders.get(model.id());
}
androidx.collection

Most used classes

  • LruCache
  • LongSparseArray
  • SparseArrayCompat
  • SimpleArrayMap
  • ArraySet
  • CircularIntArray
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now