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


Java WidgetsModel类代码示例

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


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

示例1: refreshAndBindWidgetsAndShortcuts

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
public void refreshAndBindWidgetsAndShortcuts(
        final Callbacks callbacks, final boolean bindFirst) {
    runOnWorkerThread(new Runnable() {
        @Override
        public void run() {
            if (bindFirst && !mBgWidgetsModel.isEmpty()) {
                bindWidgetsModel(callbacks, mBgWidgetsModel.clone());
            }
            final WidgetsModel model = mBgWidgetsModel.updateAndClone(mApp.getContext());
            bindWidgetsModel(callbacks, model);
            // update the Widget entries inside DB on the worker thread.
            LauncherAppState.getInstance().getWidgetCache().removeObsoletePreviews(
                    model.getRawList());
        }
    });
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:17,代码来源:LauncherModel.java

示例2: loadAndBindWidgetsAndShortcuts

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
public void loadAndBindWidgetsAndShortcuts(final Callbacks callbacks, final boolean refresh) {

        runOnWorkerThread(new Runnable() {
            @Override
            public void run() {
                updateWidgetsModel(refresh);
                final WidgetsModel model = mBgWidgetsModel.clone();

                mHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        Callbacks cb = getCallback();
                        if (callbacks == cb && cb != null) {
                            callbacks.bindAllPackages(model);
                        }
                    }
                });
                // update the Widget entries inside DB on the worker thread.
                LauncherAppState.getInstance().getWidgetCache().removeObsoletePreviews(
                        model.getRawList());
            }
        });
    }
 
开发者ID:talentlo,项目名称:Trebuchet,代码行数:24,代码来源:LauncherModel.java

示例3: bindWidgetsModel

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
@Override
public void bindWidgetsModel(WidgetsModel model) {
    if (waitUntilResume(mBindWidgetModelRunnable, true)) {
        mWidgetsModel = model;
        return;
    }

    if (mWidgetsView != null && model != null) {
        mWidgetsView.addWidgets(model);
        mWidgetsModel = null;
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:13,代码来源:Launcher.java

示例4: LauncherModel

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
LauncherModel(LauncherAppState app, IconCache iconCache, AppFilter appFilter,
        DeepShortcutManager deepShortcutManager) {
    Context context = app.getContext();
    mApp = app;
    mBgAllAppsList = new AllAppsList(iconCache, appFilter);
    mBgWidgetsModel = new WidgetsModel(context, iconCache, appFilter);
    mIconCache = iconCache;
    mDeepShortcutManager = deepShortcutManager;

    mLauncherApps = LauncherAppsCompat.getInstance(context);
    mUserManager = UserManagerCompat.getInstance(context);
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:13,代码来源:LauncherModel.java

示例5: bindWidgetsModel

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
private void bindWidgetsModel(final Callbacks callbacks, final WidgetsModel model) {
    mHandler.post(new Runnable() {
        @Override
        public void run() {
            Callbacks cb = getCallback();
            if (callbacks == cb && cb != null) {
                callbacks.bindWidgetsModel(model);
            }
        }
    });
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:12,代码来源:LauncherModel.java

示例6: addWidgets

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
/**
 * Initialize the widget data model.
 */
public void addWidgets(WidgetsModel model) {
    mRecyclerView.setWidgets(model);
    mAdapter.setWidgetsModel(model);
    mAdapter.notifyDataSetChanged();

    View loader = getContentView().findViewById(R.id.loader);
    if (loader != null) {
        ((ViewGroup) getContentView()).removeView(loader);
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:14,代码来源:WidgetsContainerView.java

示例7: LauncherModel

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
LauncherModel(LauncherAppState app, IconCache iconCache, AppFilter appFilter,
        DeepShortcutManager deepShortcutManager) {
    Context context = app.getContext();
    mApp = app;
    mBgAllAppsList = new AllAppsList(iconCache, appFilter);
    mBgWidgetsModel = new WidgetsModel(context, iconCache, appFilter);
    mIconCache = iconCache;//创建图片缓存
    mDeepShortcutManager = deepShortcutManager;

    mLauncherApps = LauncherAppsCompat.getInstance(context);
    mUserManager = UserManagerCompat.getInstance(context);
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:13,代码来源:LauncherModel.java

示例8: bindAllPackages

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
@Override
public void bindAllPackages(final WidgetsModel model) {
    if (waitUntilResume(mBindPackagesUpdatedRunnable, true)) {
        mWidgetsModel = model;
        return;
    }

    if (mWidgetsView != null && model != null) {
        mWidgetsView.addWidgets(model);
        mWidgetsModel = null;
    }
}
 
开发者ID:talentlo,项目名称:Trebuchet,代码行数:13,代码来源:Launcher.java

示例9: LauncherModel

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
LauncherModel(LauncherAppState app, IconCache iconCache, AppFilter appFilter) {
    Context context = app.getContext();

    mAppsCanBeOnRemoveableStorage = Environment.isExternalStorageRemovable();
    String oldProvider = context.getString(R.string.old_launcher_provider_uri);
    // This may be the same as MIGRATE_AUTHORITY, or it may be replaced by a different
    // resource string.
    String redirectAuthority = Uri.parse(oldProvider).getAuthority();
    ProviderInfo providerInfo =
            context.getPackageManager().resolveContentProvider(MIGRATE_AUTHORITY, 0);
    ProviderInfo redirectProvider =
            context.getPackageManager().resolveContentProvider(redirectAuthority, 0);

    Log.d(TAG, "Old launcher provider: " + oldProvider);
    mOldContentProviderExists = (providerInfo != null) && (redirectProvider != null);

    if (mOldContentProviderExists) {
        Log.d(TAG, "Old launcher provider exists.");
    } else {
        Log.d(TAG, "Old launcher provider does not exist.");
    }

    mApp = app;
    mBgAllAppsList = new AllAppsList(iconCache, appFilter);
    mBgWidgetsModel = new WidgetsModel(context, iconCache, appFilter);
    mIconCache = iconCache;

    mLauncherApps = LauncherAppsCompat.getInstance(context);
    mUserManager = UserManagerCompat.getInstance(context);
}
 
开发者ID:talentlo,项目名称:Trebuchet,代码行数:31,代码来源:LauncherModel.java

示例10: onlyBindAllApps

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
private void onlyBindAllApps() {
    final Callbacks oldCallbacks = mCallbacks.get();
    if (oldCallbacks == null) {
        // This launcher has exited and nobody bothered to tell us.  Just bail.
        Log.w(TAG, "LoaderTask running with no launcher (onlyBindAllApps)");
        return;
    }

    // shallow copy
    @SuppressWarnings("unchecked")
    final ArrayList<AppInfo> list
            = (ArrayList<AppInfo>) mBgAllAppsList.data.clone();
    final WidgetsModel widgetList = mBgWidgetsModel.clone();
    Runnable r = new Runnable() {
        public void run() {
            final long t = SystemClock.uptimeMillis();
            final Callbacks callbacks = tryGetCallbacks(oldCallbacks);
            if (callbacks != null) {
                callbacks.bindAllApplications(list);
                callbacks.bindAllPackages(widgetList);
            }
            if (DEBUG_LOADERS) {
                Log.d(TAG, "bound all " + list.size() + " apps from cache in "
                        + (SystemClock.uptimeMillis()-t) + "ms");
            }
        }
    };
    boolean isRunningOnMainThread = !(sWorkerThread.getThreadId() == Process.myTid());
    if (isRunningOnMainThread) {
        r.run();
    } else {
        mHandler.post(r);
    }
}
 
开发者ID:talentlo,项目名称:Trebuchet,代码行数:35,代码来源:LauncherModel.java

示例11: addWidgets

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
/**
 * Initialize the widget data model.
 */
public void addWidgets(WidgetsModel model) {
    mView.setWidgets(model);
    mAdapter.setWidgetsModel(model);
    mAdapter.notifyDataSetChanged();
    updateScrubber();
}
 
开发者ID:talentlo,项目名称:Trebuchet,代码行数:10,代码来源:WidgetsContainerView.java

示例12: setWidgetsModel

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
public void setWidgetsModel(WidgetsModel w) {
    mWidgetsModel = w;
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:4,代码来源:WidgetsListAdapter.java

示例13: setWidgets

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
/**
 * Sets the widget model in this view, used to determine the fast scroll position.
 */
public void setWidgets(WidgetsModel widgets) {
    mWidgets = widgets;
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:7,代码来源:WidgetsRecyclerView.java

示例14: getWidgets

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
public WidgetsModel getWidgets() {
    if (mView != null) {
        return mView.getWidgets();
    }
    return null;
}
 
开发者ID:talentlo,项目名称:Trebuchet,代码行数:7,代码来源:WidgetsContainerView.java

示例15: getWidgets

import com.android.launcher3.model.WidgetsModel; //导入依赖的package包/类
public WidgetsModel getWidgets() {
    return mWidgets;
}
 
开发者ID:talentlo,项目名称:Trebuchet,代码行数:4,代码来源:WidgetsRecyclerView.java


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