shichaohui / EasyCalendar

Quickly customize the calendar UI. You can use EasyCalendar to quickly get the calendar style UI.
598 stars 72 forks source link

Have a fixed height for each date cell #12

Open josuesantamaria opened 6 years ago

josuesantamaria commented 6 years ago

Hi,

Is there a way to have a fixed height for each date cell in the calendar? For example, following the example folder, there is a file named layout_action_calendar_item which render each calendar cell, is there a way to set a fixed height for those cells?

I'm trying with:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="49dp"
    android:layout_height="88dp">

    <TextView
        android:id="@id/tv_day_of_month"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:gravity="center"
        android:lineSpacingExtra="12sp"
        android:textColor="@color/colorBlack"
        android:textSize="12sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
    </android.support.v7.widget.RecyclerView>
</android.support.constraint.ConstraintLayout>

But seems to be not working. Any help will be appreciate it

shichaohui commented 6 years ago

No way. The size of each grid is determined by the width of the entire calendar. Divide the calendar width to get the width of the grid. The height and width of the grid are the same.