I am creating an app where I want to show an custom calendar day view like below image
I have tried to search google and found one link Android-Week-View But it's not helpful.
I am creating an app where I want to show an custom calendar day view like below image
I have tried to search google and found one link Android-Week-View But it's not helpful.
If you want to do a weekly calendar like shown in the picture. You could just put a LinearLayout orientaion horizontal with 7 LinearLayout with a vertical orientation inside. If the problem is how to get the day you can check here: How the get the current day name using particular date in android? or here Get day of the week from GregorianCalendar If you want the weird line like we can at the sat 16 you will have to a background drawable, I don't know if it's possible to do that in xml. But sure you can draw it on the ondraw method so you could make a custom View. Then if you will want to put your custom View as background you will have to use a RelativeLayout:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="info.androidhive.materialtabs.fragments.OneFragment"
android:weightSum="7">
<RelativeLayout android:layout_width="0dp"
android:layout_height="70dp"
android:layout_weight="1">
<View android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/holo_red_light"></View>
<TextView
android:id="@+id/one"
android:layout_width="match_parent"
android:layout_height="35dp"
android:text="day"
android:gravity="center"/>
<TextView
android:gravity="center"
android:text="num"
android:layout_below="@id/one"
android:layout_width="match_parent"
android:layout_height="35dp" />
</RelativeLayout>
</LinearLayout>
Something like that, put the Relative 6 times more.
This can be done without using any lib. Just put a recyclerview and add array of dates to it. I have done it for my project in the same way and same design. But it will take some time and will have confusion as you got to play with the calendar class here and get the dates as per your requirement.