Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.vlingo.client.widget;
- import android.app.PendingIntent;
- import android.appwidget.AppWidgetManager;
- import android.appwidget.AppWidgetProvider;
- import android.content.ComponentName;
- import android.content.Context;
- import android.content.Intent;
- import android.widget.RemoteViews;
- import com.vlingo.client.safereader.SafeReaderService;
- public class SafeReaderWidget extends AppWidgetProvider
- {
- private static RemoteViews buildWidgetView(Context paramContext, boolean paramBoolean)
- {
- RemoteViews localRemoteViews = new RemoteViews(paramContext.getPackageName(), 2130903176);
- Intent localIntent = new Intent("com.vlingo.client.safereader.ACTION_TOGGLE_SAFEREADER");
- localIntent.setComponent(new ComponentName(paramContext, SafeReaderService.class));
- localIntent.putExtra("com.vlingo.client.safereader.EXTRA_QUIET", false);
- localIntent.putExtra("com.vlingo.client.safereader.EXTRA_STICKY", true);
- localRemoteViews.setOnClickPendingIntent(2131624314, PendingIntent.getService(paramContext, 0, localIntent, 0));
- if (paramBoolean);
- for (int i = 2130837729; ; i = 2130837728)
- {
- localRemoteViews.setImageViewResource(2131624314, i);
- return localRemoteViews;
- }
- }
- static void updateWidgets(Context paramContext, int[] paramArrayOfInt, boolean paramBoolean)
- {
- AppWidgetManager localAppWidgetManager = AppWidgetManager.getInstance(paramContext);
- RemoteViews localRemoteViews = buildWidgetView(paramContext, paramBoolean);
- if (paramArrayOfInt == null)
- localAppWidgetManager.updateAppWidget(new ComponentName(paramContext, SafeReaderWidget.class), localRemoteViews);
- while (true)
- {
- return;
- localAppWidgetManager.updateAppWidget(paramArrayOfInt, localRemoteViews);
- }
- }
- public void onUpdate(Context paramContext, AppWidgetManager paramAppWidgetManager, int[] paramArrayOfInt)
- {
- super.onUpdate(paramContext, paramAppWidgetManager, paramArrayOfInt);
- updateWidgets(paramContext, paramArrayOfInt, false);
- WidgetManager.requestSafeReaderStatus(paramContext, paramArrayOfInt);
- }
- }
Add Comment
Please, Sign In to add comment