Search in sources :

Example 1 with RemoteViews

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);
    }
}
Also used : RemoteViews(android.widget.RemoteViews) Intent(android.content.Intent) ComponentName(android.content.ComponentName)

Example 2 with RemoteViews

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);
}
Also used : RemoteViews(android.widget.RemoteViews) Bundle(android.os.Bundle) Intent(android.content.Intent)

Example 3 with RemoteViews

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);
}
Also used : RemoteViews(android.widget.RemoteViews)

Example 4 with RemoteViews

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;
}
Also used : RemoteViews(android.widget.RemoteViews)

Example 5 with RemoteViews

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);
}
Also used : RemoteViews(android.widget.RemoteViews) Intent(android.content.Intent) PendingIntent(android.app.PendingIntent) PendingIntent(android.app.PendingIntent)

Aggregations

RemoteViews (android.widget.RemoteViews)211 Intent (android.content.Intent)83 PendingIntent (android.app.PendingIntent)75 TextView (android.widget.TextView)35 Test (org.junit.Test)35 View (android.view.View)32 Notification (android.app.Notification)30 SmallTest (android.support.test.filters.SmallTest)30 ImageView (android.widget.ImageView)28 AppWidgetManager (android.appwidget.AppWidgetManager)25 ComponentName (android.content.ComponentName)24 Bitmap (android.graphics.Bitmap)24 Bundle (android.os.Bundle)16 NavigationBarView (com.android.systemui.statusbar.phone.NavigationBarView)15 RemoteInputView (com.android.systemui.statusbar.policy.RemoteInputView)15 NotificationCompat (android.support.v4.app.NotificationCompat)14 Resources (android.content.res.Resources)12 StatusBarNotification (android.service.notification.StatusBarNotification)12 SharedPreferences (android.content.SharedPreferences)11 NotificationPanelView (com.android.systemui.statusbar.phone.NotificationPanelView)11