We hope this helps reduce the size of your calendar view.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <CalendarView android:layout_width="200dp" android:layout_height="200dp" android:id="@+id/calendarView" android:firstDayOfWeek="2"/> </LinearLayout> <LinearLayout android:layout_weight="60" android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:text="Hello World hello world " android:layout_width="match_parent" android:layout_height="wrap_content"/> </LinearLayout> </LinearLayout>
Now there is a library that allows you to set the dp size in sdp (Scalable Dp) so that it helps in many screen sizes
Gradle for this
compile 'com.intuit.sdp:sdp-android:1.0.3'
Code Example The same example above, but it will support all possible screen sizes.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <CalendarView android:layout_width="@dimen/_100sdp" android:layout_height="@dimen/_100sdp" android:id="@+id/calendarView" android:firstDayOfWeek="2"/> </LinearLayout> <LinearLayout android:layout_weight="60" android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:text="Hello World hello world " android:layout_width="match_parent" android:layout_height="wrap_content"/> </LinearLayout> </LinearLayout>
Pratik vyas
source share