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


Java MutableInt类代码示例

本文整理汇总了Java中android.util.MutableInt的典型用法代码示例。如果您正苦于以下问题:Java MutableInt类的具体用法?Java MutableInt怎么用?Java MutableInt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MutableInt类属于android.util包,在下文中一共展示了MutableInt类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeItem

import android.util.MutableInt; //导入依赖的package包/类
synchronized void removeItem(Context context, Iterable<? extends ItemInfo> items) {
    for (ItemInfo item : items) {
        switch (item.itemType) {
            case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
                folders.remove(item.id);

                workspaceItems.remove(item);
                break;
            case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT: {
                // Decrement pinned shortcut count
                ShortcutKey pinnedShortcut = ShortcutKey.fromItemInfo(item);
                MutableInt count = pinnedShortcutCounts.get(pinnedShortcut);
                if ((count == null || --count.value == 0)
                        && !InstallShortcutReceiver.getPendingShortcuts(context)
                            .contains(pinnedShortcut)) {
                    DeepShortcutManager.getInstance(context).unpinShortcut(pinnedShortcut);
                }
                // Fall through.
            }
            case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
            case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
                workspaceItems.remove(item);
                break;
            case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
            case LauncherSettings.Favorites.ITEM_TYPE_CUSTOM_APPWIDGET:
                appWidgets.remove(item);
                break;
        }
        itemsIdMap.remove(item.id);
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:32,代码来源:BgDataModel.java

示例2: decrementPinnedShortcutCount

import android.util.MutableInt; //导入依赖的package包/类
/**
 * Decrement the count for the given pinned shortcut, unpinning it if the count becomes 0.
 */
private static void decrementPinnedShortcutCount(final ShortcutKey pinnedShortcut) {
    synchronized (sBgLock) {
        MutableInt count = sBgPinnedShortcutCounts.get(pinnedShortcut);
        if (count == null || --count.value == 0) {
            LauncherAppState.getInstance().getShortcutManager().unpinShortcut(pinnedShortcut);
        }
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:12,代码来源:LauncherModel.java

示例3: addChannel

import android.util.MutableInt; //导入依赖的package包/类
private void addChannel(Channel channel) {
    mChannels.add(channel);
    String inputId = channel.getInputId();
    MutableInt count = mChannelCountMap.get(inputId);
    if (count == null) {
        mChannelCountMap.put(inputId, new MutableInt(1));
    } else {
        count.value++;
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:11,代码来源:ChannelDataManager.java

示例4: getChannelCountForInput

import android.util.MutableInt; //导入依赖的package包/类
/**
 * Returns the total channel count for a given input.
 *
 * @param inputId The ID of the input.
 */
public int getChannelCountForInput(String inputId) {
    MutableInt count = mChannelCountMap.get(inputId);
    return count == null ? 0 : count.value;
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:10,代码来源:ChannelDataManager.java


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