Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a drop down view like Google Calendar using Toolbar?

I am trying to create something similar to Google Calendar drop down month widget.

enter image description here

Any help would be really appreciated.

So far I have an idea that I need to use Toolbar with expandable animation but not sure that's the right direction to move into.

like image 312
Varundroid Avatar asked Jun 05 '15 04:06

Varundroid


People also ask

How do I customize my Google calendar widget?

Search for the Google Calendar app and tap it. To customize your widget size, swipe left. Tap Add widget. In the top right, tap Done.


2 Answers

I was also trying to create something similar to the Google Calendar app. I've come with this implementation: Demo of implementation

I use the CompactCalendarView library for the month widget. And CollapsingToolbarLayout for the drop down.

You can view the source of this implementation at GitHub: https://github.com/GerritHoekstra/CompactCalendarViewToolbar

The main layout can be found here.

I hope this helps you further.

like image 196
user1480019 Avatar answered Sep 22 '22 21:09

user1480019


May you want to take a look to CollapsingToolbarLayout

<android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsingToolbarLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:expandedTitleMarginStart="64dp"
            app:contentScrim="?attr/colorPrimary">
            <CalendarView
                android:layout_width="match_parent"
                android:layout_height="256dp"></CalendarView>

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:minHeight="?attr/actionBarSize"
                app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                app:layout_collapseMode="pin"/>

        </android.support.design.widget.CollapsingToolbarLayout>

I recommend you to follow this awesome tutorial to implement this and other interesting things about Design Library. Hope this helps.

like image 27
Alex Rojas Avatar answered Sep 22 '22 21:09

Alex Rojas