Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Toolbar with calendar

How can I make toolbar like at this photos:
This is first state
enter image description here
And this is second state
enter image description here
I use Collapse Toolbar with CalendarView. I use this library for CalendarView com.prolificinteractive:material-calendarview:1.0.1 And this is my xml code:

<android.support.design.widget.CoordinatorLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/rootLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/app_bar_height"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        android:id="@+id/appbar">

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

            <com.prolificinteractive.materialcalendarview.MaterialCalendarView
                android:id="@+id/calendarView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:mcv_showOtherDates="all"
                app:mcv_selectionColor="#00F">

            </com.prolificinteractive.materialcalendarview.MaterialCalendarView>

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

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/nickname_profile"
                android:text="@string/nickname"
                android:textColor="@color/text_color"
                android:textSize="24sp"
                android:layout_gravity="bottom|center"
                android:layout_marginBottom="20dp"
                android:layout_marginRight="40dp"
                />
            </android.support.v7.widget.Toolbar>
        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:id="@+id/general_fragment"
                app:layout_behavior="@string/appbar_scrolling_view_behavior">

            </FrameLayout>
</android.support.design.widget.CoordinatorLayout>

And second question: How can I open toolbar only on click without scroll?

like image 685
metalink Avatar asked Oct 20 '22 00:10

metalink


1 Answers

Using CompactCalendarView Library This Guy made something Awsome. HopeFully, this helps you.

like image 113
Habibur Rahman Ovie Avatar answered Oct 23 '22 11:10

Habibur Rahman Ovie