use of android.widget.RemoteViews in project cw-omnibus by commonsguy.
the class Plugin method onReceive.
@Override
public void onReceive(Context ctxt, Intent i) {
if (ACTION_CALL_FOR_PLUGINS.equals(i.getAction())) {
Intent registration = new Intent(ACTION_REGISTER_PLUGIN);
registration.setPackage(HOST_PACKAGE);
registration.putExtra(EXTRA_COMPONENT, new ComponentName(ctxt, getClass()));
ctxt.sendBroadcast(registration);
} else if (ACTION_CALL_FOR_CONTENT.equals(i.getAction())) {
RemoteViews rv = new RemoteViews(ctxt.getPackageName(), R.layout.plugin);
Intent update = new Intent(ACTION_DELIVER_CONTENT);
update.setPackage(HOST_PACKAGE);
update.putExtra(EXTRA_CONTENT, rv);
ctxt.sendBroadcast(update);
}
}
use of android.widget.RemoteViews in project cw-omnibus by commonsguy.
the class LoremViewsFactory method getViewAt.
@Override
public RemoteViews getViewAt(int position) {
RemoteViews row = new RemoteViews(ctxt.getPackageName(), R.layout.row);
row.setTextViewText(android.R.id.text1, items[position]);
Intent i = new Intent();
Bundle extras = new Bundle();
extras.putString(WidgetProvider.EXTRA_WORD, items[position]);
extras.putInt(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
i.putExtras(extras);
row.setOnClickFillInIntent(android.R.id.text1, i);
return (row);
}
use of android.widget.RemoteViews in project cw-omnibus by commonsguy.
the class AppWidget method onAppWidgetOptionsChanged.
@Override
public void onAppWidgetOptionsChanged(Context ctxt, AppWidgetManager mgr, int appWidgetId, Bundle newOptions) {
RemoteViews updateViews = new RemoteViews(ctxt.getPackageName(), R.layout.widget);
String msg = String.format(Locale.getDefault(), "[%d-%d] x [%d-%d]", newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH), newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH), newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT), newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT));
updateViews.setTextViewText(R.id.size, msg);
mgr.updateAppWidget(appWidgetId, updateViews);
}
use of android.widget.RemoteViews in project PlayerHater by chrisrhoden.
the class ExpandableNotificationPlugin method getExpandedView.
private RemoteViews getExpandedView() {
if (mExpandedView == null) {
mExpandedView = new RemoteViews(getContext().getPackageName(), R.layout.zzz_ph_jbb_notification);
setListeners(mExpandedView);
mExpandedView.setTextViewText(R.id.zzz_ph_notification_title, mNotificationTitle);
mExpandedView.setTextViewText(R.id.zzz_ph_notification_text, mNotificationText);
mExpandedView.setImageViewUri(R.id.zzz_ph_notification_image, mNotificationImageUrl);
}
return mExpandedView;
}
use of android.widget.RemoteViews in project cw-advandroid by commonsguy.
the class WidgetProvider method onUpdate.
@Override
public void onUpdate(Context ctxt, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
for (int i = 0; i < appWidgetIds.length; i++) {
Intent svcIntent = new Intent(ctxt, WidgetService.class);
svcIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetIds[i]);
svcIntent.setData(Uri.parse(svcIntent.toUri(Intent.URI_INTENT_SCHEME)));
RemoteViews widget = new RemoteViews(ctxt.getPackageName(), R.layout.widget);
widget.setRemoteAdapter(appWidgetIds[i], R.id.words, svcIntent);
Intent clickIntent = new Intent(ctxt, LoremActivity.class);
PendingIntent clickPI = PendingIntent.getActivity(ctxt, 0, clickIntent, PendingIntent.FLAG_UPDATE_CURRENT);
widget.setPendingIntentTemplate(R.id.words, clickPI);
appWidgetManager.updateAppWidget(appWidgetIds[i], widget);
}
super.onUpdate(ctxt, appWidgetManager, appWidgetIds);
}
Aggregations