Search in sources :

Example 31 with RemoteViews

use of android.widget.RemoteViews in project robolectric by robolectric.

the class ShadowContextImplTest method createPackageContextRemoteViews.

@Test
public void createPackageContextRemoteViews() throws Exception {
    RemoteViews remoteViews = new RemoteViews(RuntimeEnvironment.application.getPackageName(), R.layout.remote_views);
    remoteViews.apply(RuntimeEnvironment.application, new FrameLayout(RuntimeEnvironment.application));
}
Also used : RemoteViews(android.widget.RemoteViews) FrameLayout(android.widget.FrameLayout) Test(org.junit.Test)

Example 32 with RemoteViews

use of android.widget.RemoteViews in project cw-omnibus by commonsguy.

the class Downloader method buildForeground.

private NotificationCompat.Builder buildForeground(String filename) {
    NotificationCompat.Builder b = new NotificationCompat.Builder(this);
    RemoteViews content = new RemoteViews(getPackageName(), R.layout.notif_content);
    content.setTextViewText(android.R.id.title, "Downloading: " + filename);
    b.setOngoing(true).setContent(content).setSmallIcon(android.R.drawable.stat_sys_download);
    return (b);
}
Also used : RemoteViews(android.widget.RemoteViews) NotificationCompat(android.support.v4.app.NotificationCompat)

Example 33 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 34 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 35 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)

Aggregations

RemoteViews (android.widget.RemoteViews)217 Intent (android.content.Intent)86 PendingIntent (android.app.PendingIntent)77 TextView (android.widget.TextView)35 Test (org.junit.Test)35 Notification (android.app.Notification)30 SmallTest (android.support.test.filters.SmallTest)30 View (android.view.View)29 ImageView (android.widget.ImageView)28 AppWidgetManager (android.appwidget.AppWidgetManager)26 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