입문, 숙련, 심화 프로젝트를 거쳐서 드디어 10/10 화요일 마지막 최종 프로젝트를 시작했다. 우리 조는 2개의 프로젝트를 같이 진행해본 현민님이 팀장을 맡았으며 내가 부팀장을 맡게됐다. 참 부엉이 스타일인 나에게 조금 힘든 역할인거 같긴 하다...그래도 열심히 해야지
우리 팀은 사용자들의 운동 스케쥴 관리나 자신의 건강 상태를 확인, 관리 할 수 있는 헬스 케어앱을 기획 중이며, 현재도 유저들의 편의성을 위한 기능 추가를 고민 중이다.
현재 우리는 UI 개발 중이다. 내가 맡은 파트는 calendar를 그리는 파트인데 구글의 material calendar 라이브러리와 kizitonwose 라이브러리를 둘다 건드려본 후 더 깔끔하고 기능이 많은 kizitonwose 라이브러리를 선택했다.
주 또는 월 모드 - 주 기반 달력 또는 일반적인 월 달력을 표시한다.
원하는 날짜 비활성화 - 일부 날짜를 비활성화하여 선택을 방지한다.
경계 날짜 - 달력 날짜 범위를 제한한다.
사용자 정의 날짜 보기/구성 가능 - 원하는 기능을 사용하여 하루 셀을 원하는 대로 표시할 수 있습니다.
사용자 정의 캘린더 보기/구성 가능 - 원하는 기능과 기능을 모두 사용하여 캘린더 모양을 원하는 대로 만들 수 있다.
한 주의 첫 번째 날 사용자 지정 - 원하는 날짜를 한 주의 첫 번째 날로 사용한다..
가로 또는 세로 스크롤 달력
HeatMap 달력 - GitHub의 기여도 차트처럼 시간이 지남에 따라 데이터가 어떻게 변하는지 보여주는 데 적합
월/주 머리글 및 바닥글 - 매월/주마다 모든 종류의 머리글/바닥글을 추가
스와이프 작업이나 프로그래밍 방식을 통해 달력의 원하는 날짜/주/월로 쉽게 스크롤할 수 있다.
달력은 뷰 시스템용 RecyclerView에서 확장되고 작성용 LazyRow/LazyColumn을 사용하므로 모든 RecyclerView/LazyRow/LazyColumn 맞춤설정을 사용해야한다.
라이브러리는 로직을 제공하고 개발자는 뷰/컴포저블을 제공.
출처
https://github.com/kizitonwose/Calendar
implementation("com.kizitonwose.calendar:compose:2.4.0") // Compose
implementation("com.kizitonwose.calendar:view:2.4.0") // View
<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="@color/white"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
tools:context=".CalendarFragment">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/exOneAppBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:theme="@style/AppTheme.AppBarOverlay">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="14dp">
<TextView
android:id="@+id/exOneYearText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="24sp"
tools:text="2019" />
<TextView
android:id="@+id/exOneMonthText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:fontFamily="sans-serif-light"
android:textColor="@color/black"
android:textSize="32sp"
android:ellipsize="marquee"
tools:text="April" />
</LinearLayout>
<include
android:id="@+id/legendLayout"
layout="@layout/calendar_day_legend_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" />
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.kizitonwose.calendar.view.CalendarView
android:id="@+id/exOneCalendar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cv_dayViewResource="@layout/calendar_day" />
<com.kizitonwose.calendar.view.WeekCalendarView
android:id="@+id/exOneWeekCalendar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cv_dayViewResource="@layout/calendar_day" />
<CheckBox
android:id="@+id/weekModeCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="20dp"
android:buttonTint="@color/example_1_white"
android:padding="2dp"
android:text="@string/week_mode"
android:textColor="@color/example_1_white"
android:textSize="18sp" />
</FrameLayout>