You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
software/NoteWidgetProvider_4x.txt

47 lines
1.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* 4x4网格大小的便签小部件提供者继承自NoteWidgetProvider。
*/
public class NoteWidgetProvider_4x extends NoteWidgetProvider {
/**
* 当小部件需要更新时调用。
* @param context 上下文对象,提供应用程序环境信息。
* @param appWidgetManager AppWidget管理器用于管理小部件。
* @param appWidgetIds 需要更新的小部件ID数组。
*/
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
// 调用父类的update方法更新小部件
super.update(context, appWidgetManager, appWidgetIds);
}
/**
* 获取小部件的布局资源ID。
* @return 小部件布局资源ID。
*/
protected int getLayoutId() {
// 返回4x4网格大小小部件的布局资源ID
return R.layout.widget_4x;
}
/**
* 获取背景资源ID。
* @param bgId 背景ID。
* @return 对应背景资源ID的资源。
*/
@Override
protected int getBgResourceId(int bgId) {
// 根据背景ID获取4x4网格大小小部件的背景资源ID
return ResourceParser.WidgetBgResources.getWidget4xBgResource(bgId);
}
/**
* 获取小部件类型。
* @return 小部件类型。
*/
@Override
protected int getWidgetType() {
// 返回4x4网格大小小部件的类型
return Notes.TYPE_WIDGET_4X;
}
}