Android Open Source - MaterialDemo Toolbar Fragment






From Project

Back to project page MaterialDemo.

License

The source code is released under:

Apache License

If you think the Android project MaterialDemo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.epam.dziashko.aliaksei.materialdemo.fragment;
//  www  .  jav a2s . co m
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.epam.dziashko.aliaksei.materialdemo.R;

public class ToolbarFragment extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        ((ActionBarActivity)getActivity()).getSupportActionBar().hide();
        return inflater.inflate(R.layout.standalone_toolbar, null);
    }

    @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        Toolbar toolbar = (Toolbar) view.findViewById(R.id.my_standalone_toolbar);
        ((ActionBarActivity)getActivity()).setSupportActionBar(toolbar);
        toolbar.setTitle("Standalone toolbar");
    }

    @Override public void onPause() {
        ((ActionBarActivity)getActivity()).getSupportActionBar().show();
        super.onPause();
    }
}




Java Source Code List

com.epam.dziashko.aliaksei.materialdemo.ApplicationTest.java
com.epam.dziashko.aliaksei.materialdemo.DetailActivity.java
com.epam.dziashko.aliaksei.materialdemo.MainActivity.java
com.epam.dziashko.aliaksei.materialdemo.adapter.BaseArrayAdapter.java
com.epam.dziashko.aliaksei.materialdemo.adapter.Function.java
com.epam.dziashko.aliaksei.materialdemo.adapter.IBaseAdapter.java
com.epam.dziashko.aliaksei.materialdemo.data.Data.java
com.epam.dziashko.aliaksei.materialdemo.fragment.GridFragment.java
com.epam.dziashko.aliaksei.materialdemo.fragment.PagerFragment.java
com.epam.dziashko.aliaksei.materialdemo.fragment.RecyclerViewFragment.java
com.epam.dziashko.aliaksei.materialdemo.fragment.ToolbarFragment.java
com.epam.dziashko.aliaksei.materialdemo.view.SlidingTabLayout.java
com.epam.dziashko.aliaksei.materialdemo.view.SlidingTabStrip.java