show a placeholder if no events are found
This commit is contained in:
parent
0b8ab41368
commit
a6ccc02de9
2 changed files with 17 additions and 0 deletions
|
@ -23,6 +23,7 @@ import com.simplemobiletools.calendar.pro.interfaces.NavigationListener
|
|||
import com.simplemobiletools.calendar.pro.models.DayMonthly
|
||||
import com.simplemobiletools.calendar.pro.models.Event
|
||||
import com.simplemobiletools.calendar.pro.models.ListEvent
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import kotlinx.android.synthetic.main.fragment_month_day.*
|
||||
import kotlinx.android.synthetic.main.fragment_month_day.view.*
|
||||
import org.joda.time.DateTime
|
||||
|
@ -144,6 +145,7 @@ class MonthDayFragment : Fragment(), MonthlyCalendar {
|
|||
|
||||
activity?.runOnUiThread {
|
||||
if (activity != null) {
|
||||
mHolder.month_day_no_events_placeholder.beVisibleIf(listItems.isEmpty())
|
||||
EventListAdapter(activity as SimpleActivity, listItems, true, null, month_day_events_list, false) {
|
||||
if (it is ListEvent) {
|
||||
activity?.editEvent(it)
|
||||
|
|
|
@ -42,6 +42,21 @@
|
|||
android:textSize="@dimen/actionbar_text_size"
|
||||
tools:text="8/5/2021" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/month_day_no_events_placeholder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/month_day_selected_day_label"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:alpha="0.8"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:paddingEnd="@dimen/activity_margin"
|
||||
android:text="@string/no_items_found"
|
||||
android:textSize="@dimen/bigger_text_size"
|
||||
android:textStyle="italic"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyRecyclerView
|
||||
android:id="@+id/month_day_events_list"
|
||||
android:layout_width="match_parent"
|
||||
|
|
Loading…
Reference in a new issue