本文整理汇总了Java中android.support.v4.util.LongSparseArray.delete方法的典型用法代码示例。如果您正苦于以下问题:Java LongSparseArray.delete方法的具体用法?Java LongSparseArray.delete怎么用?Java LongSparseArray.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.util.LongSparseArray
的用法示例。
在下文中一共展示了LongSparseArray.delete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCachedDelegateDrawable
import android.support.v4.util.LongSparseArray; //导入方法依赖的package包/类
private Drawable getCachedDelegateDrawable(@NonNull Context context, long key) {
Drawable drawable = null;
synchronized (this.mDelegateDrawableCacheLock) {
LongSparseArray<WeakReference<ConstantState>> cache = (LongSparseArray) this.mDelegateDrawableCaches.get(context);
if (cache == null) {
} else {
WeakReference<ConstantState> wr = (WeakReference) cache.get(key);
if (wr != null) {
ConstantState entry = (ConstantState) wr.get();
if (entry != null) {
drawable = entry.newDrawable(context.getResources());
} else {
cache.delete(key);
}
}
}
}
return drawable;
}
示例2: getCachedDrawable
import android.support.v4.util.LongSparseArray; //导入方法依赖的package包/类
private Drawable getCachedDrawable(@NonNull final Context context, final long key) {
synchronized (mDrawableCacheLock) {
final LongSparseArray<WeakReference<ConstantState>> cache
= mDrawableCaches.get(context);
if (cache == null) {
return null;
}
final WeakReference<ConstantState> wr = cache.get(key);
if (wr != null) {
// We have the key, and the secret
ConstantState entry = wr.get();
if (entry != null) {
return entry.newDrawable(context.getResources());
} else {
// Our entry has been purged
cache.delete(key);
}
}
}
return null;
}
示例3: checkForContactChange
import android.support.v4.util.LongSparseArray; //导入方法依赖的package包/类
private boolean checkForContactChange(LongSparseArray<DbContactSensor> map, DbContactSensor newItem) {
long id = newItem.getContactId();
DbContactSensor existingReminder = map.get(id);
boolean result = false;
DbContactSensor existingItem = map.get(id);
map.delete(id);
if (existingItem == null) {
newItem.setIsNew(Boolean.TRUE);
newItem.setIsUpdated(Boolean.TRUE);
newItem.setIsDeleted(Boolean.FALSE);
result = true;
} else {
if (hasContactDifference(existingItem, newItem)) {
newItem.setIsNew(Boolean.FALSE);
newItem.setIsUpdated(Boolean.TRUE);
newItem.setIsDeleted(Boolean.FALSE);
newItem.setId(existingItem.getId());
result = true;
}
}
if (!result) {
newItem.setId(existingReminder.getId());
}
return result;
}
示例4: checkForChange
import android.support.v4.util.LongSparseArray; //导入方法依赖的package包/类
private boolean checkForChange(LongSparseArray<DbCalendarSensor> map, DbCalendarSensor newItem) {
Long eventId = newItem.getEventId();
if (eventId == null) {
return false;
}
DbCalendarSensor existingItem = map.get(eventId);
map.delete(eventId);
if (existingItem == null) {
newItem.setIsNew(Boolean.TRUE);
newItem.setIsUpdated(Boolean.TRUE);
newItem.setIsDeleted(Boolean.FALSE);
return true;
}
if (hasEventDifference(existingItem, newItem)) {
newItem.setIsNew(Boolean.FALSE);
newItem.setIsUpdated(Boolean.TRUE);
newItem.setIsDeleted(Boolean.FALSE);
newItem.setId(existingItem.getId());
return true;
}
return false;
}
示例5: checkForReminderChange
import android.support.v4.util.LongSparseArray; //导入方法依赖的package包/类
private boolean checkForReminderChange(LongSparseArray<DbCalendarReminderSensor> map, DbCalendarReminderSensor newItem) {
if (newItem == null) {
throw new IllegalArgumentException();
}
Long eventId = newItem.getEventId();
if (eventId == null) {
return false;
}
DbCalendarReminderSensor existingItem = map.get(eventId);
map.delete(eventId);
if (existingItem == null) {
newItem.setIsNew(Boolean.TRUE);
newItem.setIsUpdated(Boolean.TRUE);
newItem.setIsDeleted(Boolean.FALSE);
return true;
}
if (hasReminderDifference(existingItem, newItem)) {
newItem.setIsNew(Boolean.FALSE);
newItem.setIsUpdated(Boolean.TRUE);
newItem.setIsDeleted(Boolean.FALSE);
newItem.setId(existingItem.getId());
return true;
}
return false;
}
示例6: getCachedDrawable
import android.support.v4.util.LongSparseArray; //导入方法依赖的package包/类
private Drawable getCachedDrawable(LongSparseArray<WeakReference<Drawable.ConstantState>> cache, long key) {
synchronized (mAccessLock) {
WeakReference<Drawable.ConstantState> wr = cache.get(key);
if (wr != null) {
Drawable.ConstantState entry = wr.get();
if (entry != null) {
return entry.newDrawable(this);
} else {
cache.delete(key);
}
}
}
return null;
}
示例7: getCachedDrawable
import android.support.v4.util.LongSparseArray; //导入方法依赖的package包/类
private static Drawable getCachedDrawable(LongSparseArray<WeakReference<Drawable.ConstantState>> cache,
long key, Resources res) {
synchronized (mAccessLock) {
WeakReference<Drawable.ConstantState> wr = cache.get(key);
if (wr != null) {
Drawable.ConstantState entry = wr.get();
if (entry != null) {
return entry.newDrawable(res);
} else {
cache.delete(key);
}
}
}
return null;
}