Collapsing and quick return ToolBar RecyclerView in android

In any app ToolBar is the foremost used it makes our format and content material describe higher method as a identify. As of late in my article we’re focusing about animated Instrument bar . There are lots of customized library to be had to make our toolbar higher glance and really feel. Instrument bar offered in design help library and majorly used in virtually app.

On this article we will be able to focal point on two other technique to make our toolbar animated.
1. Collapsing Toolbar
2. Quick Return Toolbar 

What’s collapsing ToolBar? Collapsing ToolbarLayout is the wrapper for Toolbar which implements a collapsing app bar. It’s designed for use as a right away kid of AppBarLayout.
This is uploaded video that can help you to know to put into effect such collapsing toolbar and quick return toolbar.


Shall we create an android venture identify Collapsing software bar to implements similar as we observed in video.

construct.gradle app stage

follow plugin: 'com.android.software'
follow plugin: 'com.neenbedankt.android-apt'

android

dependencies

ItemModel.java

public magnificence ItemModel 

CollapsingToolBarActivity.java

import android.os.Package deal;
import android.help.design.widget.CollapsingToolbarLayout;
import android.help.v7.app.AppCompatActivity;
import android.help.v7.widget.DividerItemDecoration;
import android.help.v7.widget.LinearLayoutManager;
import android.help.v7.widget.RecyclerView;
import android.help.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;

import java.util.ArrayList;
import java.util.Record;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
* Created through sunil on 12/8/16.
*/

public magnificence CollapsingToolBarActivity extends AppCompatActivity {

@BindView(R.identification.my_recycler_view)
RecyclerView mRecyclerView;
@BindView(R.identification.header)
ImageView header;
@BindView(R.identification.toolbar_flexible_space)
Toolbar toolbarFlexibleSpace;
@BindView(R.identification.collapsing_toolbar)
CollapsingToolbarLayout collapsingToolbar;

String imageUrl[] = Consistent.symbol;
String names[] = Consistent.identify;

@Override
secure void onCreate(Package deal savedInstanceState)

non-public void initView()

non-public Record getList()
}

activity_collapsing.xml

    xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

android:identification="@+identification/my_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+identification/appbar"
android:padding="10dp"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:theme="@taste/ThemeOverlay.AppCompat.Darkish.ActionBar"
android:layout_height="325dp">

android:identification="@+identification/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?colorPrimary"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
android:identification="@+identification/header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />


android:identification="@+identification/toolbar_flexible_space"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin">





QuickReturnToolBarActivity.java

import android.os.Package deal;
import android.help.design.widget.AppBarLayout;
import android.help.v7.app.AppCompatActivity;
import android.help.v7.widget.DividerItemDecoration;
import android.help.v7.widget.LinearLayoutManager;
import android.help.v7.widget.RecyclerView;
import android.help.v7.widget.Toolbar;
import android.view.View;

import java.util.ArrayList;
import java.util.Record;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
* Created through sunil on 12/8/16.
*/

public magnificence QuickReturnToolBarActivity extends AppCompatActivity {

@BindView(R.identification.toolbar)
Toolbar toolbar;
@BindView(R.identification.appbar)
AppBarLayout appbar;
@BindView(R.identification.my_recycler_view)
RecyclerView mRecyclerView;

String imageUrl[] = Consistent.symbol;
String names[] = Consistent.identify;

@Override
secure void onCreate(Package deal savedInstanceState)

non-public void initView()

non-public Record getList()
}

activitt_quick_retrun.xml


xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

android:identification="@+identification/appbar"
android:theme="@taste/ThemeOverlay.AppCompat.Darkish.ActionBar"
android:layout_width="match_parent"
android:layout_height="wrap_content">

android:identification="@+identification/toolbar"
android:titleTextColor="#fff"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways" />


android:identification="@+identification/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />



Screenshot_20161208-201049 Collapsing  and quick return ToolBar RecyclerView in android Android

Thank you for studying this publish. I’m hoping this text will hell to know.

234x60B Collapsing  and quick return ToolBar RecyclerView in android Android