question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ScrolltoDate or ScrolltoMonth disables if using calendar in bottomsheet.

See original GitHub issue

Hi,

I am using CalendarView in Bottomsheet. Problem is that it disables calendar.scrollToDate or calendar.scrollToMonth if using same calendar in Bottomsheet Dialog or any Bottomsheet. But if I am using same calendar.scrollToDate or calendar.scrollToMonth in any of the Activity or Fragment, it is doing a smooth scrolling to my desired date.

Note: Manual scrolling is happening in Bottomsheet, only calendar.scrollToDate or calendar.scrollToMonth is not working at all. Only working in normal Activity or Fragment.

My XML is given below, kindly guide me how can I achieve ScrollToDate with Bottomsheet.

Thank you.

XML:

<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/cl"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/rounded_top_leftright"
        app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

        <TextView
            android:id="@+id/tv_title"
            style="@style/Header.RobotoBold"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="@string/appointment_calendar"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <ImageView
            android:id="@+id/imv_close"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:adjustViewBounds="true"
            android:padding="8dp"
            android:scaleType="fitCenter"
            app:layout_constraintBottom_toBottomOf="@+id/tv_title"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@+id/tv_title"
            app:srcCompat="@drawable/ic_cancel_big_black" />

        <ImageView
            android:id="@+id/dividerFixed"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_marginTop="8dp"
            android:background="@color/cell_disabled"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/tv_title" />

        <com.kizitonwose.calendarview.CalendarView
            android:id="@+id/calendar"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginStart="12dp"
            android:layout_marginTop="@dimen/dp_24"
            android:layout_marginEnd="12dp"
            android:visibility="visible"
            app:cv_dayViewResource="@layout/calendar_day"
            app:cv_monthHeaderResource="@layout/calendar_header"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/dividerFixed" />

    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
kizitonwosecommented, Jan 16, 2021

Can you please provide a small sample project that I can look at?

0reactions
kizitonwosecommented, Mar 27, 2021

Guess I’ll have to close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found