Calendar icon indicating copy to clipboard operation
Calendar copied to clipboard

Fatal Exception: java.lang.UnsupportedOperationException Cannot calculate the values for day Width/Height with the current configuration.

Open JasonTheDynamite opened this issue 2 years ago • 3 comments

image

JasonTheDynamite avatar May 13 '22 14:05 JasonTheDynamite

Occurs on tablets and foldable devices

JasonTheDynamite avatar May 16 '22 14:05 JasonTheDynamite

I have not experienced this myself. If you can share how to reproduce this, that would be helpful.

kizitonwose avatar May 28 '22 11:05 kizitonwose

This fails on tablets / foldables:

<RelativeLayout android:id="@+id/rlMain" android:layout_width="match_parent" android:layout_height="match_parent" android:animateLayoutChanges="true" android:background="@color/toolbarBackgroundGrey" android:focusable="true" android:focusableInTouchMode="true" tools:ignore="RtlCompat">

<androidx.coordinatorlayout.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent">

         <androidx.core.widget.NestedScrollView
            android:id="@+id/ncvScroll"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:animateLayoutChanges="true">
            
                           <LinearLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:orientation="horizontal"
                                        android:weightSum="100"
                                        android:layout_marginBottom="@dimen/dp10"
                                        android:layout_gravity="center"
                                        android:layout_marginLeft="@dimen/dp100"
                                        android:layout_marginRight="@dimen/dp100"
                                        android:clipToPadding="false"
                                        android:clipChildren="false">
                                        
                                          <com.kizitonwose.calendarview.CalendarView
                                            android:id="@+id/calendarView"
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_weight="30"
                                            android:layout_gravity="top|end"
                                            android:layout_marginRight="@dimen/dp10"
                                           />
                                           
                                           <View
                                            android:id="@+id/view"
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_weight="30"
                                            android:layout_gravity="top|end"
                                            android:layout_marginRight="@dimen/dp10"
                                           />
                                           
                                             </LinearLayout>
                                           
                                            </androidx.core.widget.NestedScrollView>
                                            
                                            </androidx.coordinatorlayout.widget.CoordinatorLayout>

Replacing linearLayout with ConstraintLayout works

JasonTheDynamite avatar May 30 '22 07:05 JasonTheDynamite