Open Noobknight opened 9 years ago
The problem is the toolbar, it's inside the materialviewpager :/ I don't know how to fix it properly
Can you put this layout in a fragment, completely change it with an action from the navigationdrawer ?
please can anyone give some example code for drawer item click to change the layout? Thanx in advance
You can hook up the toolbar directly from the fragments like: `@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { .... AppCompatActivity hostActivity = (AppCompatActivity) getActivity();
Toolbar toolbar = mViewPager.getToolbar();
hostActivity.setSupportActionBar(toolbar);
final ActionBar actionBar = hostActivity.getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setHomeButtonEnabled(true);
}`
Just have each fragment have its own toolbar except for the materialviewpager one.
Hi FuriousLlama,
I am using your material design library. Its quite easy and UI is very attractive.
Presently, i am facing one problem is that, if i want to come back to a fragment from an activity. Then what should i have to do.
Please suggest me.
Thanks in advance.
Jaya Gautam
First, you've provided a library very useful and I'm thank for that ^^! Today. I'm want to replace viewpager when choose menu in navigation drawer... But don't success. You can help me ? Sorry! I'm speak English not good. Code below <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="fill_parent" android:layout_height="fill_parent" >
</android.support.v4.widget.DrawerLayout>
ActivityMain.java