public RemoteViews GetViewAt(int position)
        {
            stopView = new RemoteViews(context.PackageName, Resource.Layout.widget_stop_list_item);

            // Click handlers
            Intent clickIntent = new Intent();

            clickIntent.PutExtra(ReittiWidget.ItemPosition, position);
            stopView.SetOnClickFillInIntent(Resource.Id.lineItemsHolderWidget, clickIntent);
            stopView.SetOnClickFillInIntent(Resource.Id.stopNameTextViewWidget, clickIntent);

            // Set stop name
            Stop stop = stops[position];

            stopView.SetTextViewText(Resource.Id.stopNameTextViewWidget, stop.Name);

            // Reset line views
            stopView.RemoveAllViews(Resource.Id.lineItemsHolderWidget);

            // Set line name and departure times
            foreach (var line in stop.Lines)
            {
                RemoteViews lineView = new RemoteViews(context.PackageName, Resource.Layout.widget_line_list_item);
                lineView.SetTextViewText(Resource.Id.labelLineNameWidget, line.Number);

                if (line.HasDepartures)
                {
                    if (line.NextDeparture != null)
                    {
                        lineView.SetTextViewText(Resource.Id.labelNextDepartureWidget, line.NextDeparture);
                    }
                    else
                    {
                        lineView.SetTextViewText(Resource.Id.labelNextDepartureWidget, context.GetString(Resource.String.no_time));
                    }

                    if (line.FollowingDeparture != null)
                    {
                        lineView.SetTextViewText(Resource.Id.labelFollowingDepartureWidget, line.FollowingDeparture);
                    }
                    else
                    {
                        lineView.SetTextViewText(Resource.Id.labelFollowingDepartureWidget, context.GetString(Resource.String.no_time));
                    }
                }
                else
                {
                    lineView.SetTextViewText(Resource.Id.labelNextDepartureWidget, context.GetString(Resource.String.no_time));
                    lineView.SetTextViewText(Resource.Id.labelFollowingDepartureWidget, context.GetString(Resource.String.no_time));
                }

                stopView.AddView(Resource.Id.lineItemsHolderWidget, lineView);
            }

            return(stopView);
        }
Example #2
0
        public RemoteViews GetViewAt(int position)
        {
            var remoteView = new RemoteViews(context.PackageName, Resource.Layout.widget_list_item);
            var rowData    = itemList [position];

            // set if is running
            if (rowData.IsRunning)
            {
                remoteView.SetImageViewResource(Resource.Id.WidgetContinueImageButton, Resource.Drawable.IcWidgetStop);
            }
            else
            {
                remoteView.SetImageViewResource(Resource.Id.WidgetContinueImageButton, Resource.Drawable.IcWidgetPlay);
            }

            // set color
            remoteView.SetInt(Resource.Id.WidgetColorView, "setColorFilter", Color.ParseColor(rowData.Color));
            remoteView.SetOnClickFillInIntent(Resource.Id.WidgetContinueImageButton, ConstructFillIntent(rowData));

            // set content
            remoteView.SetTextViewText(
                Resource.Id.DescriptionTextView,
                String.IsNullOrWhiteSpace(rowData.Description) ? context.Resources.GetString(Resource.String.RunningWidgetNoDescription) : rowData.Description);
            remoteView.SetTextViewText(
                Resource.Id.ProjectTextView,
                String.IsNullOrWhiteSpace(rowData.ProjectName) ? context.Resources.GetString(Resource.String.RunningWidgetNoProject) : rowData.ProjectName);
            remoteView.SetTextViewText(Resource.Id.DurationTextView, rowData.TimeValue);

            return(remoteView);
        }
Example #3
0
            public RemoteViews GetViewAt(int position)
            {
                Realm other = Realm.GetInstance(DB.RealmConfiguration);

                if (!RealmInstance.IsSameInstance(other))
                {
                    RealmInstance.Dispose();
                    RealmInstance = other;
                }

                RemoteViews page = new RemoteViews(context.PackageName, ItemLayout);

                Chapter chapter = Descending ? RealmInstance.Find <Chapter>(FirstChapterId + Count - 1 - position)
                    : RealmInstance.Find <Chapter>(FirstChapterId + position);

                if (chapter == null)
                {
                    return(page);
                }

                page.SetTextViewText(Resource.Id.chapter_title, chapter.Title);

                Intent chapterClick = new Intent();

                chapterClick.SetData(Uri.Parse(chapter.URL));
                page.SetOnClickFillInIntent(Resource.Id.root, chapterClick);

                return(page);
            }
Example #4
0
        public RemoteViews GetViewAt (int position)
        {
            var remoteView = new RemoteViews (context.PackageName, Resource.Layout.widget_list_item);
            var rowData = itemList [position];

            // set if is running
            if (rowData.IsRunning) {
                remoteView.SetImageViewResource (Resource.Id.WidgetContinueImageButton, Resource.Drawable.IcWidgetStop);
            } else {
                remoteView.SetImageViewResource (Resource.Id.WidgetContinueImageButton, Resource.Drawable.IcWidgetPlay);
            }

            // set color
            remoteView.SetInt (Resource.Id.WidgetColorView, "setColorFilter", Color.ParseColor (rowData.Color));
            remoteView.SetOnClickFillInIntent (Resource.Id.WidgetContinueImageButton, ConstructFillIntent (rowData));

            // set content
            remoteView.SetTextViewText (
                Resource.Id.DescriptionTextView,
                String.IsNullOrWhiteSpace (rowData.Description) ? context.Resources.GetString (Resource.String.RunningWidgetNoDescription) : rowData.Description);
            remoteView.SetTextViewText (
                Resource.Id.ProjectTextView,
                String.IsNullOrWhiteSpace (rowData.ProjectName) ? context.Resources.GetString (Resource.String.RunningWidgetNoProject) : rowData.ProjectName);
            remoteView.SetTextViewText (Resource.Id.DurationTextView, rowData.TimeValue);

            return remoteView;
        }
Example #5
0
        public RemoteViews GetViewAt(int position)
        {
            var view = new RemoteViews(context.PackageName, Resource.Layout.SuggestionsWidgetItem);

            var item           = items[position];
            var hasDescription = !string.IsNullOrEmpty(item.Description);
            var hasProject     = !string.IsNullOrEmpty(item.ProjectName);

            view.SetViewVisibility(Resource.Id.DescriptionTextView, hasDescription.ToVisibility());
            if (hasDescription)
            {
                view.SetTextViewText(Resource.Id.DescriptionTextView, item.Description);
            }

            view.SetViewVisibility(Resource.Id.ProjectClientRow, hasProject.ToVisibility());

            if (hasProject)
            {
                view.SetTextViewText(Resource.Id.ProjectNameTextView, item.ProjectName);
                view.SetTextColor(Resource.Id.ProjectNameTextView, Color.ParseColor(item.ProjectColor));
                view.SetTextViewText(Resource.Id.ClientNameTextView, item.ClientName);
            }

            var bottomBorderVisibility = (position != Count - 1).ToVisibility();

            view.SetViewVisibility(Resource.Id.BottomSeparator, bottomBorderVisibility);

            var intent = new Intent();

            intent.PutExtra(TappedSuggestionIndex, position);
            view.SetOnClickFillInIntent(Resource.Id.RootLayout, intent);

            return(view);
        }
Example #6
0
        public RemoteViews GetViewAt(int position)
        {
            RemoteViews remoteViews = new RemoteViews(context.PackageName, Resource.Layout.task_item);
            var         item        = TaskWidget.Items[position];
            var         imageName   = item.IconPath.Split('/')[1].Split('.')[0];
            var         background  = Resource.Drawable.task_item_background_false;

            if (item.Status)
            {
                background = Resource.Drawable.task_item_background_true;
            }

            var extras = new Bundle();

            extras.PutInt("ItemNo", item.No);

            var fiIntent = new Intent();

            fiIntent.PutExtras(extras);

            remoteViews.SetOnClickFillInIntent(Resource.Id.task_layout, fiIntent);
            remoteViews.SetInt(Resource.Id.task_layout, "setBackgroundResource", background);
            remoteViews.SetImageViewResource(Resource.Id.task_icon, context.Resources.GetIdentifier(imageName, "drawable", context.PackageName));
            remoteViews.SetTextViewText(Resource.Id.task_content, item.Content);

            return(remoteViews);
        }
            public RemoteViews GetViewAt(int position)
            {
                try
                {
                    object item = _items[position];

                    if (item is DateTime)
                    {
                        var dateHeaderView = new RemoteViews(_context.PackageName, Resource.Layout.WidgetAgendaDateListItem);
                        dateHeaderView.SetTextViewText(Resource.Id.WidgetAgendaDateHeaderTextView, ToFriendlyDate((DateTime)item, _now));

                        return(dateHeaderView);
                    }

                    if (item is string)
                    {
                        // String represents "Nothing due!", etc
                        var emptyView = new RemoteViews(_context.PackageName, Resource.Layout.WidgetAgendaEmptyListItem);
                        emptyView.SetTextViewText(Resource.Id.WidgetAgendaEmptyListItemTextView, item as string);

                        return(emptyView);
                    }

                    var task = item as BaseViewItemHomeworkExam;
                    var c    = task.GetClassOrNull();
                    if (c == null)
                    {
                        var emptyView = new RemoteViews(_context.PackageName, Resource.Layout.WidgetAgendaEmptyListItem);
                        return(emptyView);
                    }

                    RemoteViews taskView = new RemoteViews(_context.PackageName, Resource.Layout.WidgetAgendaTaskListItem);
                    taskView.SetTextViewText(Resource.Id.WidgetAgendaTaskTextView, task.Name);
                    taskView.SetInt(Resource.Id.WidgetAgendaTaskColorBar, "setBackgroundColor", ColorTools.GetColor(c.Color));

                    Intent taskIntent = new Intent()
                                        .SetAction(Intent.ActionView)
                                        .SetData(Android.Net.Uri.Parse("powerplanner:?" + ArgumentsHelper.CreateArgumentsForView(task, _localAccountId).SerializeToString()));
                    taskView.SetOnClickFillInIntent(Resource.Id.WidgetAgendaTaskListItem, taskIntent);

                    return(taskView);
                }
                catch (Exception ex)
                {
                    // Out of range exception can be expected since the items list can change while we're working
                    if (!(ex is ArgumentOutOfRangeException))
                    {
                        TelemetryExtension.Current?.TrackException(ex);
                    }

                    var emptyView = new RemoteViews(_context.PackageName, Resource.Layout.WidgetAgendaEmptyListItem);
                    return(emptyView);
                }
            }
        public RemoteViews GetViewAt(int position)
        {
            var remoteView = new RemoteViews(context.PackageName, Resource.Layout.widget_list_item);
            var rowData    = itemList [position];

            // set if is running
            if (rowData.IsRunning)
            {
                remoteView.SetImageViewResource(Resource.Id.WidgetContinueImageButton, Resource.Drawable.IcWidgetStop);
                remoteView.SetViewVisibility(Resource.Id.DurationChronometer, Android.Views.ViewStates.Visible);
                remoteView.SetViewVisibility(Resource.Id.DurationTextView, Android.Views.ViewStates.Gone);
            }
            else
            {
                remoteView.SetImageViewResource(Resource.Id.WidgetContinueImageButton, Resource.Drawable.IcWidgetPlay);
                remoteView.SetViewVisibility(Resource.Id.DurationChronometer, Android.Views.ViewStates.Gone);
                remoteView.SetViewVisibility(Resource.Id.DurationTextView, Android.Views.ViewStates.Visible);
            }

            // set color
            remoteView.SetInt(Resource.Id.WidgetColorView, "setColorFilter", Color.ParseColor(rowData.Color));
            remoteView.SetOnClickFillInIntent(Resource.Id.WidgetContinueImageButton, ConstructFillIntent(rowData));

            // set content
            remoteView.SetTextViewText(
                Resource.Id.DescriptionTextView,
                String.IsNullOrWhiteSpace(rowData.Description) ? context.Resources.GetString(Resource.String.RunningWidgetNoDescription) : rowData.Description);
            remoteView.SetTextViewText(
                Resource.Id.ProjectTextView,
                String.IsNullOrWhiteSpace(rowData.ProjectName) ? context.Resources.GetString(Resource.String.RunningWidgetNoProject) : rowData.ProjectName);
            remoteView.SetTextViewText(Resource.Id.DurationTextView, rowData.TimeValue);

            var time = (long)rowData.Duration.TotalMilliseconds;

            // Format chronometer correctly.
            string format = "00:%s";

            if (time >= 3600000 && time < 36000000)
            {
                format = "0%s";
            }
            else if (time >= 36000000)
            {
                format = "%s";
            }
            var baseTime = SystemClock.ElapsedRealtime();

            remoteView.SetChronometer(Resource.Id.DurationChronometer, baseTime - (long)rowData.Duration.TotalMilliseconds, format, true);


            return(remoteView);
        }
Example #9
0
            public RemoteViews GetViewAt(int position)
            {
                var views = new RemoteViews(_applicationContext.PackageName, Resource.Layout.CalendarWidgetItem);
                var vm    = _items[position];

                var intent = new Intent(_applicationContext, typeof(MainActivity));

                intent.PutExtra("launchArgs", $"https://myanimelist.net/anime/{vm.Id}");
                views.SetOnClickFillInIntent(Resource.Id.Image, intent);
                if (ResourceLocator.AiringInfoProvider.TryGetCurrentEpisode(vm.Id, out int ep, DateTime.Today))
                {
                    views.SetTextViewText(Resource.Id.EpisodeCount, $"ep. {ep}");
                    views.SetViewVisibility(Resource.Id.EpisodeCount, ViewStates.Visible);
                }
Example #10
0
            public RemoteViews GetViewAt(int position)
            {
                var views = new RemoteViews(_applicationContext.PackageName, Resource.Layout.CalendarWidgetItem);
                var vm    = _items[position];

                var intent = new Intent(_applicationContext, typeof(MainActivity));

                intent.PutExtra("launchArgs", $"https://myanimelist.net/anime/{vm.Id}");
                views.SetOnClickFillInIntent(Resource.Id.Image, intent);

                Loadimage(vm, views);

                return(views);
            }
        public RemoteViews GetViewAt (int position)
        {
            var remoteView = new RemoteViews (context.PackageName, Resource.Layout.widget_list_item);
            var rowData = itemList [position];

            // set if is running
            if (rowData.IsRunning) {
                remoteView.SetImageViewResource (Resource.Id.WidgetContinueImageButton, Resource.Drawable.IcWidgetStop);
                remoteView.SetViewVisibility (Resource.Id.DurationChronometer, Android.Views.ViewStates.Visible);
                remoteView.SetViewVisibility (Resource.Id.DurationTextView, Android.Views.ViewStates.Gone);
            } else {
                remoteView.SetImageViewResource (Resource.Id.WidgetContinueImageButton, Resource.Drawable.IcWidgetPlay);
                remoteView.SetViewVisibility (Resource.Id.DurationChronometer, Android.Views.ViewStates.Gone);
                remoteView.SetViewVisibility (Resource.Id.DurationTextView, Android.Views.ViewStates.Visible);
            }

            // set color
            remoteView.SetInt (Resource.Id.WidgetColorView, "setColorFilter", Color.ParseColor (rowData.Color));
            remoteView.SetOnClickFillInIntent (Resource.Id.WidgetContinueImageButton, ConstructFillIntent (rowData));

            // set content
            remoteView.SetTextViewText (
                Resource.Id.DescriptionTextView,
                String.IsNullOrWhiteSpace (rowData.Description) ? context.Resources.GetString (Resource.String.RunningWidgetNoDescription) : rowData.Description);
            remoteView.SetTextViewText (
                Resource.Id.ProjectTextView,
                String.IsNullOrWhiteSpace (rowData.ProjectName) ? context.Resources.GetString (Resource.String.RunningWidgetNoProject) : rowData.ProjectName);
            remoteView.SetTextViewText (Resource.Id.DurationTextView, rowData.TimeValue);

            var time = (long)rowData.Duration.TotalMilliseconds;

            // Format chronometer correctly.
            string format = "00:%s";
            if (time >= 3600000 && time < 36000000) {
                format = "0%s";
            } else if (time >= 36000000) {
                format = "%s";
            }
            var baseTime = SystemClock.ElapsedRealtime ();
            remoteView.SetChronometer (Resource.Id.DurationChronometer, baseTime - (long)rowData.Duration.TotalMilliseconds, format, true);


            return remoteView;
        }
Example #12
0
        public RemoteViews GetViewAt(int position)
        {
            RemoteViews remoteView = new RemoteViews(_context.PackageName, Resource.Layout.widget_item);

            remoteView.SetTextViewText(Resource.Id.note_title, _notesList[position].NoteTitle);
            remoteView.SetTextViewText(Resource.Id.date_Time, _notesList[position].NoteDateTime.ToShortTimeString());
            remoteView.SetTextViewText(Resource.Id.note_description, _notesList[position].Description);

            //adding data to be passed inside the fill intent
            Bundle extras = new Bundle();

            extras.PutInt(AppWidget.ExtraItem, position);

            //the intent that is going to fill the template created in the appwidgetclass
            Intent fillIntent = new Intent();

            fillIntent.PutExtras(extras);
            remoteView.SetOnClickFillInIntent(Resource.Id.note_main_layout, fillIntent);
            return(remoteView);
        }
Example #13
0
            public RemoteViews GetViewAt(int position)
            {
                Realm other = Realm.GetInstance(DB.RealmConfiguration);

                if (!RealmInstance.IsSameInstance(other))
                {
                    RealmInstance.Dispose();
                    RealmInstance = other;
                }

                RemoteViews page = new RemoteViews(context.PackageName, ItemLayout);

                Book book = RealmInstance.Find <Book>(position);

                if (book == null)
                {
                    return(page);
                }

                page.SetTextViewText(Resource.Id.book_title, book.Title);

                Intent bookClick = new Intent();

                bookClick.SetAction(SelectBook);
                bookClick.PutExtra(AppWidgetManager.ExtraAppwidgetId, WidgetId);
                bookClick.PutExtra(ExtraBookId, book.ID);
                page.SetOnClickFillInIntent(Resource.Id.root, bookClick);

                if (book.ID == BookId)
                {
                    page.SetInt(Resource.Id.root, "setBackgroundColor", Color.ParseColor("#d0d0d0"));
                }
                else
                {
                    page.SetInt(Resource.Id.root, "setBackgroundColor", Color.ParseColor("#f0f0f0"));
                }

                return(page);
            }
Example #14
0
        public RemoteViews GetViewAt(int position)
        {
            IList <RichPushMessage> messages = RichPushManager.Shared().RichPushUser.Inbox.Messages;

            if (position > messages.Count)
            {
                return(null);
            }

            // Get the data for this position from the content provider
            RichPushMessage message = messages [position];

            // Return a proper item
            String      formatStr = context.Resources.GetString(Resource.String.item_format_string);
            int         itemId    = Resource.Layout.widget_item;
            RemoteViews rv        = new RemoteViews(context.PackageName, itemId);

            rv.SetTextViewText(Resource.Id.widget_item_text, Java.Lang.String.Format(formatStr, message.Title));

            int iconDrawable = message.IsRead ? Resource.Drawable.mark_read : Resource.Drawable.mark_unread;

            rv.SetImageViewResource(Resource.Id.widget_item_icon, iconDrawable);

            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");

            rv.SetTextViewText(Resource.Id.date_sent, dateFormat.Format(message.SentDate));

            // Add the message id to the intent
            Intent fillInIntent = new Intent();
            Bundle extras       = new Bundle();

            extras.PutString(RichPushApplication.MESSAGE_ID_RECEIVED_KEY, message.MessageId);
            fillInIntent.PutExtras(extras);
            rv.SetOnClickFillInIntent(Resource.Id.widget_item, fillInIntent);

            return(rv);
        }
Example #15
0
        public RemoteViews GetViewAt(int position)
        {
            if (_source.Count == 0)
            {
                return(null);
            }

            var book = _source[position];

            var remoteViews = new RemoteViews(_context.PackageName, Resource.Layout.WidgetCell);

            remoteViews.SetTextViewText(Resource.Id.widgetcell_title, book.Title);

            var data  = _webApi.GetThumbnail(book.Thumbnail).Result;
            var image = BitmapFactory.DecodeByteArray(data, 0, data.Length);

            remoteViews.SetImageViewBitmap(Resource.Id.widgetcell_image, image);

            var intent = new Intent(); // TODO: セルごとにアクションを変えたい場合などはこのIntendにデータをセットする

            remoteViews.SetOnClickFillInIntent(Resource.Id.widgetcell_container, intent);

            return(remoteViews);
        }
		public RemoteViews GetViewAt (int position)
		{

			IList<RichPushMessage> messages = RichPushManager.Shared ().RichPushUser.Inbox.Messages;

			if (position > messages.Count) {
				return null;
			}

			// Get the data for this position from the content provider
			RichPushMessage message = messages [position];

			// Return a proper item
			String formatStr = context.Resources.GetString (Resource.String.item_format_string);
			int itemId = Resource.Layout.widget_item;
			RemoteViews rv = new RemoteViews (context.PackageName, itemId);
			rv.SetTextViewText (Resource.Id.widget_item_text, Java.Lang.String.Format (formatStr, message.Title));

			int iconDrawable = message.IsRead ? Resource.Drawable.mark_read : Resource.Drawable.mark_unread;
			rv.SetImageViewResource (Resource.Id.widget_item_icon, iconDrawable);

			SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd HH:mm");
			rv.SetTextViewText (Resource.Id.date_sent, dateFormat.Format (message.SentDate));

			// Add the message id to the intent
			Intent fillInIntent = new Intent ();
			Bundle extras = new Bundle ();
			extras.PutString (RichPushApplication.MESSAGE_ID_RECEIVED_KEY, message.MessageId);
			fillInIntent.PutExtras (extras);
			rv.SetOnClickFillInIntent (Resource.Id.widget_item, fillInIntent);

			return rv;
		}
            public RemoteViews GetViewAt(int position)
            {
                try
                {
                    object item = _items[position];

                    if (item is DateTime)
                    {
                        var dateHeaderView = new RemoteViews(_context.PackageName, Resource.Layout.WidgetScheduleDateListItem);
                        dateHeaderView.SetTextViewText(Resource.Id.WidgetScheduleDateHeaderTextView, WidgetAgendaService.WidgetAgendaFactory.ToFriendlyDate((DateTime)item, _now));

                        return(dateHeaderView);
                    }

                    if (item is string)
                    {
                        // String represents "Nothing due!", etc
                        var emptyView = new RemoteViews(_context.PackageName, Resource.Layout.WidgetScheduleEmptyListItem);
                        emptyView.SetTextViewText(Resource.Id.WidgetScheduleEmptyListItemTextView, item as string);

                        return(emptyView);
                    }

                    if (item is ViewItemHoliday)
                    {
                        var holiday = item as ViewItemHoliday;

                        RemoteViews holidayView = new RemoteViews(_context.PackageName, Resource.Layout.WidgetScheduleHolidayListItem);
                        holidayView.SetTextViewText(Resource.Id.WidgetScheduleHolidayNameTextView, holiday.Name.Trim());
                        holidayView.SetInt(Resource.Id.WidgetScheduleHolidayListItem, "setBackgroundColor", Views.DayScheduleSnapshotView.HolidayColor);

                        Intent holidayIntent = new Intent()
                                               .SetAction(Intent.ActionView)
                                               .SetData(Android.Net.Uri.Parse("powerplanner:?" + new ViewHolidayArguments()
                        {
                            ItemId         = holiday.Identifier,
                            LaunchSurface  = LaunchSurface.SecondaryTile,
                            LocalAccountId = _localAccountId
                        }.SerializeToString()));
                        holidayView.SetOnClickFillInIntent(Resource.Id.WidgetScheduleHolidayListItem, holidayIntent);

                        return(holidayView);
                    }

                    var schedule = item as ViewItemSchedule;
                    var c        = schedule.Class;
                    if (c == null)
                    {
                        var emptyView = new RemoteViews(_context.PackageName, Resource.Layout.WidgetScheduleEmptyListItem);
                        return(emptyView);
                    }

                    bool hasRoom = !string.IsNullOrWhiteSpace(schedule.Room);

                    RemoteViews classView = new RemoteViews(_context.PackageName, hasRoom ? Resource.Layout.WidgetScheduleClassWithRoomListItem : Resource.Layout.WidgetScheduleClassListItem);
                    classView.SetTextViewText(Resource.Id.WidgetScheduleClassNameTextView, c.Name.Trim());
                    classView.SetTextViewText(Resource.Id.WidgetScheduleClassTimeTextView, Views.ListItems.MyScheduleItemView.GetStringTimeToTime(schedule));
                    if (hasRoom)
                    {
                        classView.SetTextViewText(Resource.Id.WidgetScheduleClassRoomTextView, schedule.Room.Trim());
                    }
                    classView.SetInt(Resource.Id.WidgetScheduleClassListItem, "setBackgroundColor", ColorTools.GetColor(c.Color));

                    Intent classIntent = new Intent()
                                         .SetAction(Intent.ActionView)
                                         .SetData(Android.Net.Uri.Parse("powerplanner:?" + new ViewClassArguments()
                    {
                        ItemId         = c.Identifier,
                        LaunchSurface  = LaunchSurface.SecondaryTile,
                        LocalAccountId = _localAccountId
                    }.SerializeToString()));
                    classView.SetOnClickFillInIntent(Resource.Id.WidgetScheduleClassListItem, classIntent);

                    return(classView);
                }
                catch (Exception ex)
                {
                    // Out of range exception can be expected since the items list can change while we're working
                    if (!(ex is ArgumentOutOfRangeException))
                    {
                        TelemetryExtension.Current?.TrackException(ex);
                    }

                    var emptyView = new RemoteViews(_context.PackageName, Resource.Layout.WidgetScheduleEmptyListItem);
                    return(emptyView);
                }
            }