本文整理了Java中android.appwidget.AppWidgetHostView.updateAppWidgetSize()
方法的一些代码示例,展示了AppWidgetHostView.updateAppWidgetSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppWidgetHostView.updateAppWidgetSize()
方法的具体详情如下:
包路径:android.appwidget.AppWidgetHostView
类名称:AppWidgetHostView
方法名:updateAppWidgetSize
暂无
代码示例来源:origin: Neamar/KISS
/**
* Adds a widget to the widget area on the MainActivity
*
* @param appWidgetId id of widget to add
*/
private void addWidgetToLauncher(int appWidgetId) {
// only add widgets if in minimal mode (may need launcher restart when turned on)
if (prefs.getBoolean("history-hide", true)) {
// remove empty list view when using widgets, this would block touches on the widget
mainActivity.emptyListView.setVisibility(View.GONE);
//add widget to view
AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
if (appWidgetInfo == null) {
removeAllWidgets();
return;
}
AppWidgetHostView hostView = mAppWidgetHost.createView(mainActivity, appWidgetId, appWidgetInfo);
hostView.setMinimumHeight(appWidgetInfo.minHeight);
hostView.setAppWidget(appWidgetId, appWidgetInfo);
if (Build.VERSION.SDK_INT > 15) {
hostView.updateAppWidgetSize(null, appWidgetInfo.minWidth, appWidgetInfo.minHeight, appWidgetInfo.minWidth, appWidgetInfo.minHeight);
}
widgetArea.addView(hostView);
}
// only one widget allowed so widgetUsed is true now, even if not added to view
widgetUsed = true;
}
代码示例来源:origin: klinker24/launcher3
static void updateWidgetSizeRanges(AppWidgetHostView widgetView, Launcher launcher,
int spanX, int spanY) {
getWidgetSizeRanges(launcher, spanX, spanY, sTmpRect);
widgetView.updateAppWidgetSize(null, sTmpRect.left, sTmpRect.top,
sTmpRect.right, sTmpRect.bottom);
}
代码示例来源:origin: fookwood/Launcher3
static void updateWidgetSizeRanges(AppWidgetHostView widgetView, Launcher launcher,
int spanX, int spanY) {
getWidgetSizeRanges(launcher, spanX, spanY, sTmpRect);
widgetView.updateAppWidgetSize(null, sTmpRect.left, sTmpRect.top,
sTmpRect.right, sTmpRect.bottom);
}
代码示例来源:origin: klinker24/Android-Blur-Launcher
static void updateWidgetSizeRanges(AppWidgetHostView widgetView, Launcher launcher,
int spanX, int spanY) {
getWidgetSizeRanges(launcher, spanX, spanY, sTmpRect);
widgetView.updateAppWidgetSize(null, sTmpRect.left, sTmpRect.top,
sTmpRect.right, sTmpRect.bottom);
}
代码示例来源:origin: enricocid/LaunchEnr
static void updateWidgetSizeRanges(AppWidgetHostView widgetView, Launcher launcher,
int spanX, int spanY) {
getWidgetSizeRanges(launcher, spanX, spanY, sTmpRect);
widgetView.updateAppWidgetSize(null, sTmpRect.left, sTmpRect.top,
sTmpRect.right, sTmpRect.bottom);
}
代码示例来源:origin: WeAreFairphone/FP2-Launcher
static void updateWidgetSizeRanges(AppWidgetHostView widgetView, Launcher launcher,
int spanX, int spanY) {
getWidgetSizeRanges(launcher, spanX, spanY, mTmpRect);
widgetView.updateAppWidgetSize(null, mTmpRect.left, mTmpRect.top,
mTmpRect.right, mTmpRect.bottom);
}
代码示例来源:origin: quaap/LaunchTime
@Override
public void run() {
appwid.updateAppWidgetSize(null, wDp, hDpf, wDp, hDpf);
if (appwid.getParent()!=null) {
appwid.getParent().requestLayout();
}
appwid.requestLayout();
appwid.postInvalidate();
}
}, 1000);
内容来源于网络,如有侵权,请联系作者删除!