Similar to the issue mentioned below, if I put the calendar in a recycler view, then it refuses to display the days part, until you press the next button.
My adapter looks like
`public class HeaderAdapter extends RecyclerView.Adapter {
Context context;
public HeaderAdapter(Context context) {
this.context = context;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new CalendarFilterAdapter.ViewHolder(LayoutInflater.from(context).inflate(R.layout.content_calendar_header,
parent, false)
);
// return new RecyclerView.ViewHolder(inflate.inflate(R.layout.content_calendar_header, parent, false));
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 1;
}
And it gets displayed in a fragment, as part of concat adapter, like so:
HeaderAdapter headerAdapter = new HeaderAdapter(getContext()); mAdapter = new CalendarFilterAdapter(getContext(), taskEntries);
If the user rotates the device, it hides itself again.
@mateuszSawa can you please reopen this issue?
I have the same issue when placing calendar in RecyclerView. Wrapping calendar in ConstraintLayout does not help
Similar to the issue mentioned below, if I put the calendar in a recycler view, then it refuses to display the days part, until you press the next button.
My adapter looks like `public class HeaderAdapter extends RecyclerView.Adapter {
}`
my layout file like:
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content"> <com.applandeo.materialcalendarview.CalendarView android:id="@+id/calendarView" android:layout_width="match_parent" android:layout_height="wrap_content" app:headerColor="@color/background" app:headerLabelColor="@color/black" app:type="one_day_picker" app:previousButtonSrc="@drawable/ic_leftcircle" app:forwardButtonSrc="@drawable/ic_rightcircle" app:abbreviationsBarColor="@color/background" app:selectionColor="@color/primary" app:selectionLabelColor="@color/white" app:todayLabelColor="@color/primary"/> </androidx.coordinatorlayout.widget.CoordinatorLayout>
And it gets displayed in a fragment, as part of concat adapter, like so:
HeaderAdapter headerAdapter = new HeaderAdapter(getContext()); mAdapter = new CalendarFilterAdapter(getContext(), taskEntries);
If the user rotates the device, it hides itself again.
@mateuszSawa can you please reopen this issue? I have the same issue when placing calendar in RecyclerView. Wrapping calendar in ConstraintLayout does not help
Here is my RecyclerView ViewHolder for calendar:
And here is how it looks like:
Originally posted by @fedyiv in https://github.com/Applandeo/Material-Calendar-View/issues/129#issuecomment-827404774