huanghaibin-dev / CalendarView

Android上一个优雅、万能自定义UI、仿iOS、支持垂直、水平方向切换、支持周视图、自定义周起始、性能高效的日历控件,支持热插拔实现的UI定制!支持标记、自定义颜色、农历、自定义月视图各种显示模式等。Canvas绘制,速度快、占用内存低,你真的想不到日历居然还可以如此优雅!An elegant, highly customized and high-performance Calendar Widget on Android.
Apache License 2.0
9.06k stars 1.78k forks source link

calendlayout 与SmartRefreshLayout 月视图切换周视图时显示异常 #685

Open wqbs369 opened 4 years ago

wqbs369 commented 4 years ago

`<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffffff" android:fitsSystemWindows="true" android:orientation="vertical" tools:ignore="RtlHardcoded,HardcodedText,RtlSymmetry,SmallSp">

<RelativeLayout
    android:id="@+id/ll_container"
    android:layout_width="match_parent"
    android:layout_height="@dimen/title_height"
    android:orientation="horizontal">

    <ImageView
        android:id="@+id/iv_back"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:layout_marginLeft="16dp"
        android:minWidth="50dp"
        android:scaleType="center"
        android:src="@drawable/ic_close_black" />

    <TextView
        android:id="@+id/tv_month"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_centerInParent="true"
        android:drawablePadding="5dp"
        android:gravity="center"
        android:text="2020-07"
        android:textColor="@color/color_text_202020"
        android:textSize="@dimen/text_size_mid"
        android:textStyle="bold" />
</RelativeLayout>

<com.haibin.calendarview.CalendarLayout
    android:id="@+id/calendarLayout"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:background="#fff"
    android:orientation="vertical"
    app:calendar_content_view_id="@+id/refreshLayout"
    app:default_status="shrink">

    <com.haibin.calendarview.CalendarView
        android:id="@+id/calendarView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#fff"
        app:calendar_padding="10dp"
        app:current_month_lunar_text_color="#CFCFCF"
        app:current_month_text_color="#333333"
        app:max_year="2030"
        app:min_year="2016"
        app:month_view="com.ttxs.common.wiget.calendar.CustomMonthView"
        app:month_view_show_mode="mode_fix"
        app:other_month_lunar_text_color="#e1e1e1"
        app:other_month_text_color="#e1e1e1"
        app:scheme_text="假"
        app:scheme_text_color="#333"
        app:scheme_theme_color="#128c4b"
        app:select_mode="single_mode"
        app:selected_lunar_text_color="#fff"
        app:selected_text_color="#fff"
        app:selected_theme_color="#046cea"
        app:week_background="#fff"
        app:week_start_with="sun"
        app:week_text_color="#e1e1e1"
        app:week_view="com.ttxs.common.wiget.calendar.CustomWeekView"
        app:year_view="com.ttxs.common.wiget.calendar.CustomYearView"
        app:year_view_day_text_color="#333333"
        app:year_view_day_text_size="7sp"
        app:year_view_month_text_color="#ff0000"
        app:year_view_month_text_size="20sp"
        app:year_view_scheme_color="#f17706"
        app:year_view_select_text_color="#fff"
        app:year_view_week_height="16dp"
        app:year_view_week_text_color="#e1e1e1"
        app:year_view_week_text_size="6sp" />

    <com.scwang.smartrefresh.layout.SmartRefreshLayout
        android:id="@+id/refreshLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="30dp"
        android:layout_marginBottom="@dimen/common_margin">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#fff"
            android:overScrollMode="never" />
    </com.scwang.smartrefresh.layout.SmartRefreshLayout>

</com.haibin.calendarview.CalendarLayout>

` 我因为下边的内容显示区域需要显示下拉刷新 与上拉加载,结果出现选中的日期,周视图显示异常。

wqbs369 commented 4 years ago

链接: https://pan.baidu.com/s/1UqVslXUn9-v6xGeZGGQdtw 提取码: 5by8 链接: https://pan.baidu.com/s/1kGXBdKvh9K0qaC1dQGJ2eQ 提取码: q3ny 这个是百度上的效果图