use of android.appwidget.AppWidgetProviderInfo in project android_frameworks_base by ParanoidAndroid.
the class AppWidgetHostActivity method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
mAppWidgetManager = AppWidgetManager.getInstance(this);
setContentView(R.layout.appwidget_host);
mHost = new AppWidgetHost(this, HOST_ID) {
protected AppWidgetHostView onCreateView(Context context, int appWidgetId, AppWidgetProviderInfo appWidget) {
return new MyAppWidgetView(appWidgetId);
}
};
findViewById(R.id.add_appwidget).setOnClickListener(mOnClickListener);
mAppWidgetContainer = (AppWidgetContainerView) findViewById(R.id.appwidget_container);
if (false) {
if (false) {
mHost.deleteHost();
} else {
AppWidgetHost.deleteAllHosts();
}
}
}
use of android.appwidget.AppWidgetProviderInfo in project android_frameworks_base by ParanoidAndroid.
the class AppWidgetHostActivity method handleAppWidgetPickResult.
void handleAppWidgetPickResult(int resultCode, Intent intent) {
// BEGIN_INCLUDE(getExtra_EXTRA_APPWIDGET_ID)
Bundle extras = intent.getExtras();
int appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID);
// END_INCLUDE(getExtra_EXTRA_APPWIDGET_ID)
if (resultCode == RESULT_OK) {
AppWidgetProviderInfo appWidget = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
if (appWidget.configure != null) {
// configure the AppWidget if we should
configureAppWidget(CONFIGURE_APPWIDGET_REQUEST, appWidgetId, appWidget.configure);
} else {
// just add it as is
addAppWidgetView(appWidgetId, appWidget);
}
} else {
mHost.deleteAppWidgetId(appWidgetId);
}
}
use of android.appwidget.AppWidgetProviderInfo in project android_frameworks_base by ResurrectionRemix.
the class AppWidgetServiceImpl method dumpProvider.
private static void dumpProvider(Provider provider, int index, PrintWriter pw) {
AppWidgetProviderInfo info = provider.info;
pw.print(" [");
pw.print(index);
pw.print("] provider ");
pw.println(provider.id);
pw.print(" min=(");
pw.print(info.minWidth);
pw.print("x");
pw.print(info.minHeight);
pw.print(") minResize=(");
pw.print(info.minResizeWidth);
pw.print("x");
pw.print(info.minResizeHeight);
pw.print(") updatePeriodMillis=");
pw.print(info.updatePeriodMillis);
pw.print(" resizeMode=");
pw.print(info.resizeMode);
pw.print(" widgetCategory=");
pw.print(info.widgetCategory);
pw.print(" autoAdvanceViewId=");
pw.print(info.autoAdvanceViewId);
pw.print(" initialLayout=#");
pw.print(Integer.toHexString(info.initialLayout));
pw.print(" initialKeyguardLayout=#");
pw.print(Integer.toHexString(info.initialKeyguardLayout));
pw.print(" zombie=");
pw.println(provider.zombie);
}
use of android.appwidget.AppWidgetProviderInfo in project android_frameworks_base by ResurrectionRemix.
the class AppWidgetHostActivity method handleAppWidgetConfigureResult.
void handleAppWidgetConfigureResult(int resultCode, Intent data) {
int appWidgetId = getPreferences(0).getInt(PENDING_APPWIDGET_ID, -1);
Log.d(TAG, "resultCode=" + resultCode + " appWidgetId=" + appWidgetId);
if (appWidgetId < 0) {
Log.w(TAG, "was no preference for PENDING_APPWIDGET_ID");
return;
}
if (resultCode == RESULT_OK) {
AppWidgetProviderInfo appWidget = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
addAppWidgetView(appWidgetId, appWidget);
} else {
mHost.deleteAppWidgetId(appWidgetId);
}
}
use of android.appwidget.AppWidgetProviderInfo in project android_frameworks_base by ResurrectionRemix.
the class AppWidgetHostActivity method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
mAppWidgetManager = AppWidgetManager.getInstance(this);
setContentView(R.layout.appwidget_host);
mHost = new AppWidgetHost(this, HOST_ID) {
protected AppWidgetHostView onCreateView(Context context, int appWidgetId, AppWidgetProviderInfo appWidget) {
return new MyAppWidgetView(appWidgetId);
}
};
findViewById(R.id.add_appwidget).setOnClickListener(mOnClickListener);
mAppWidgetContainer = (AppWidgetContainerView) findViewById(R.id.appwidget_container);
if (false) {
if (false) {
mHost.deleteHost();
} else {
AppWidgetHost.deleteAllHosts();
}
}
}
Aggregations