こんにちは!
今回は、カレンダーライブラリでandroidアプリにカレンダー機能を入れるということで
よくあるスマホのカレンダー画面をさっと作成しちゃいましょう!
googleのカレンダーや種類は色々あるのですが、
今回はこちらを使わせていただきます!!
https://github.com/SundeepK/CompactCalendarView
まず、appフォルダの下にあるGradle Script を選択し、その中のbuild.gradel (Module: app)の方を開きます。
そして、dependencies に以下の一行を付け足してあげましょう
implementation 'com.github.sundeepk:compact-calendar-view:3.0.0'
次に、activity_mainの中に以下の、カレンダー部品のソースを埋め込んであげれば、、、
<com.github.sundeepk.compactcalendarview.CompactCalendarView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/compactcalendar_view" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingRight="10dp" android:paddingLeft="10dp" app:compactCalendarTargetHeight="250dp" app:compactCalendarTextSize="12sp" app:compactCalendarBackgroundColor="#7b9ad0" app:compactCalendarTextColor="#fff" app:compactCalendarCurrentSelectedDayBackgroundColor="#39baab" app:compactCalendarCurrentDayBackgroundColor="#222584" app:compactCalendarMultiEventIndicatorColor="#fff" />
あっという間にカレンダーが!
短いですが、以上です!
読んでいただきありがとうございました