ScrolltoDate or ScrolltoMonth disables if using calendar in bottomsheet.
See original GitHub issueHi,
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:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you please provide a small sample project that I can look at?
Guess I’ll have to close this.