plusonelabs / calendar-widget

An calender widget for your Android home screen.
Apache License 2.0
369 stars 127 forks source link

Optional"No Upcoming Events" text #265

Open arjunkalburgi opened 7 years ago

arjunkalburgi commented 7 years ago

Hello,

I was wondering if it's possible to get a toggle for the text to appear when there is an empty_event_list.

There are different ways to implement it ofc, but I think it would be pretty minor.

Looks like after adding the toggle cell, R.string.no_upcoming_events can be set to empty and then everything in the EventAppWidgetProvider would work normally as it does:

        @IdRes int emptyViewId = R.id.empty_event_list;

        rv.setEmptyView(R.id.event_list, emptyViewId);

        rv.setTextViewText(emptyViewId, settings.getContext().getText(

                permissionsGranted ? R.string.no_upcoming_events : R.string.grant_permissions_verbose

        ));

Thanks!

yvolk commented 4 years ago

So we have these options now, as I understand:

  1. Display "No upcoming events" / "No events to show" as this is now (since v.3)
  2. Display nothing as I understood @arjunkalburgi Correct?
  3. Display current day header (even if day headers are turned off), ass suggested in #282
yvolk commented 4 years ago

@arjunkalburgi Or I misunderstood what you mean by "toggle for the text" Since v.3 the Widget layout doesn't have a separate view to show, when there are no events: I simply add a list item that tells this. See screenshots here: https://github.com/plusonelabs/calendar-widget/issues/282#issuecomment-536169071