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


Java AppWidgetHostView.setVisibility方法代码示例

本文整理汇总了Java中android.appwidget.AppWidgetHostView.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java AppWidgetHostView.setVisibility方法的具体用法?Java AppWidgetHostView.setVisibility怎么用?Java AppWidgetHostView.setVisibility使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.appwidget.AppWidgetHostView的用法示例。


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

示例1: completeAddAppWidget

import android.appwidget.AppWidgetHostView; //导入方法依赖的package包/类
/**
 * Add a widget to the workspace.
 *
 * @param appWidgetId The app widget id
 */
@Thunk void completeAddAppWidget(int appWidgetId, ItemInfo itemInfo,
        AppWidgetHostView hostView, LauncherAppWidgetProviderInfo appWidgetInfo) {

    if (appWidgetInfo == null) {
        appWidgetInfo = mAppWidgetManager.getLauncherAppWidgetInfo(appWidgetId);
    }

    if (appWidgetInfo.isCustomWidget) {
        appWidgetId = LauncherAppWidgetInfo.CUSTOM_WIDGET_ID;
    }

    LauncherAppWidgetInfo launcherInfo;
    launcherInfo = new LauncherAppWidgetInfo(appWidgetId, appWidgetInfo.provider);
    launcherInfo.spanX = itemInfo.spanX;
    launcherInfo.spanY = itemInfo.spanY;
    launcherInfo.minSpanX = itemInfo.minSpanX;
    launcherInfo.minSpanY = itemInfo.minSpanY;
    launcherInfo.user = appWidgetInfo.getUser();

    getModelWriter().addItemToDatabase(launcherInfo,
            itemInfo.container, itemInfo.screenId, itemInfo.cellX, itemInfo.cellY);

    if (hostView == null) {
        // Perform actual inflation because we're live
        hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo);
    }
    hostView.setVisibility(View.VISIBLE);
    prepareAppWidget(hostView, launcherInfo);
    mWorkspace.addInScreen(hostView, launcherInfo);
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:36,代码来源:Launcher.java

示例2: completeAddAppWidget

import android.appwidget.AppWidgetHostView; //导入方法依赖的package包/类
/**
 * Add a widget to the workspace.
 *
 * @param appWidgetId The app widget id
 */
@Thunk void completeAddAppWidget(int appWidgetId, ItemInfo itemInfo,
        AppWidgetHostView hostView, LauncherAppWidgetProviderInfo appWidgetInfo) {

    if (appWidgetInfo == null) {
        appWidgetInfo = mAppWidgetManager.getLauncherAppWidgetInfo(appWidgetId);
    }

    if (appWidgetInfo.isCustomWidget) {
        appWidgetId = LauncherAppWidgetInfo.CUSTOM_WIDGET_ID;
    }

    LauncherAppWidgetInfo launcherInfo;
    launcherInfo = new LauncherAppWidgetInfo(appWidgetId, appWidgetInfo.provider);
    launcherInfo.spanX = itemInfo.spanX;
    launcherInfo.spanY = itemInfo.spanY;
    launcherInfo.minSpanX = itemInfo.minSpanX;
    launcherInfo.minSpanY = itemInfo.minSpanY;
    launcherInfo.user = mAppWidgetManager.getUser(appWidgetInfo);

    LauncherModel.addItemToDatabase(this, launcherInfo,
            itemInfo.container, itemInfo.screenId, itemInfo.cellX, itemInfo.cellY);

    if (hostView == null) {
        // Perform actual inflation because we're live
        hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo);
    }
    hostView.setVisibility(View.VISIBLE);
    addAppWidgetToWorkspace(hostView, launcherInfo, appWidgetInfo, isWorkspaceLocked());
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:35,代码来源:Launcher.java


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