当前位置: 首页>>代码示例>>Java>>正文


Java LongSparseArray.delete方法代码示例

本文整理汇总了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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:20,代码来源:AppCompatDrawableManager.java

示例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;
}
 
开发者ID:ximsfei,项目名称:Android-skin-support,代码行数:23,代码来源:SkinCompatDrawableManager.java

示例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;
    }
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:37,代码来源:ContactsSensor.java

示例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;
    }
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:33,代码来源:CalendarSensor.java

示例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;
    }
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:37,代码来源:CalendarSensor.java

示例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;
}
 
开发者ID:ZieIony,项目名称:Carbon,代码行数:15,代码来源:CarbonResources.java

示例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;
}
 
开发者ID:ZieIony,项目名称:Carbon,代码行数:16,代码来源:LollipopDrawablesCompat.java


注:本文中的android.support.v4.util.LongSparseArray.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。