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.
test-1/NoteWidgetProvider_4x.java

35 lines
1.1 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.

package net.micode.notes.widget;
import android.appwidget.AppWidgetManager;
import android.content.Context;
import net.micode.notes.R;
import net.micode.notes.data.Notes;
import net.micode.notes.tool.ResourceParser;
// 4x尺寸笔记小部件提供者类继承自NoteWidgetProvider用于创建和管理4x尺寸的笔记小部件
public class NoteWidgetProvider_4x extends NoteWidgetProvider {
// 当小部件更新时被调用,调用父类的更新方法来执行更新操作
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
super.update(context, appWidgetManager, appWidgetIds);
}
// 获取4x尺寸小部件的布局资源ID
protected int getLayoutId() {
return R.layout.widget_4x;
}
// 根据背景颜色ID获取4x尺寸小部件的背景资源ID
@Override
protected int getBgResourceId(int bgId) {
return ResourceParser.WidgetBgResources.getWidget4xBgResource(bgId);
}
// 获取4x尺寸小部件的类型
@Override
protected int getWidgetType() {
return Notes.TYPE_WIDGET_4X;
}
}