Comments (6)
Normally you must add this, to your activity, if you don't want to reload the activity in change;
android:configChanges="orientation|screenSize">
from advancedmaterialdrawer.
ok already know it, but if i set multi pane with menu always open on landscape on portrait it still opened and not slide
from advancedmaterialdrawer.
Ok, i know what you mean.
You need a method, which you must called on orientation change. In this method you must reinit the drawer like this:
if (deviceSupportMultiPane()) {
drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN, drawerViewGroup);
DrawerLayout.LayoutParams params = new DrawerLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
params.setMargins((int) (320 * displayDensity), 0, 0, 0);
contentViewGroup.setLayoutParams(params);
drawerLayout.setScrimColor(Color.TRANSPARENT);
drawerLayout.openDrawer(drawerViewGroup);
drawerLayout.setMultipaneSupport(true);
//drawerLayout.requestDisallowInterceptTouchEvent(true);
} else {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
// don't use the constructor with toolbar, or onOptionsItemSelected() method will not be called
actionBarToggle = new ActionBarDrawerToggle(this, drawerLayout/*, toolbar*/, R.string.nothing, R.string.nothing) {
public void onDrawerClosed(View view) {
invalidateOptionsMenu();
drawerTouchLocked = false;
if (drawerStateListener != null)
drawerStateListener.onDrawerClosed(view);
}
public void onDrawerOpened(View drawerView) {
invalidateOptionsMenu();
if (drawerStateListener != null)
drawerStateListener.onDrawerOpened(drawerView);
}
@Override
public void onDrawerSlide(View drawerView, float slideOffset) {
// if user wants the sliding arrow it compare
if (slidingDrawerEffect)
super.onDrawerSlide(drawerView, slideOffset);
else
super.onDrawerSlide(drawerView, 0);
if (drawerStateListener != null)
drawerStateListener.onDrawerSlide(drawerView, slideOffset);
}
@Override
public void onDrawerStateChanged(int newState) {
super.onDrawerStateChanged(newState);
if (drawerStateListener != null)
drawerStateListener.onDrawerStateChanged(newState);
}
};
//actionBarToggle.setToolbarNavigationClickListener(toolbarToggleListener);
drawerLayout.setDrawerListener(actionBarToggle);
drawerLayout.setMultipaneSupport(false);
}
I can outsource the code to a method, so you can call it on change.
https://github.com/madcyph3r/AdvancedMaterialDrawer/blob/master/materialDrawer/src/main/java/de/madcyph3r/materialnavigationdrawer/MaterialNavigationDrawer.java
See line 377 until 434.
You must outsource thos code to a method and then call it on change.
from advancedmaterialdrawer.
great! i'll try it next week :D
from advancedmaterialdrawer.
And worked it?
from advancedmaterialdrawer.
I close it for now. If the problem not gone, then post it.
from advancedmaterialdrawer.
Related Issues (20)
- RTL slide shod HOT 1
- Header title text font HOT 1
- Account photo is changed to color HOT 9
- retain selected fragment on rotation HOT 1
- Master Child Navigation - Update? HOT 1
- support navigation bar in different api levels
- Toolbar cut off HOT 6
- Crashes on API 10 HOT 1
- app:theme is now deprecated. Please move to using android:theme instead. HOT 1
- Color of divider for section bottom HOT 1
- how to change drawer icon? HOT 1
- how to change height of actionbar? HOT 1
- PreferenceFragment support HOT 2
- failed to resolve HOT 2
- Keep fragment on orientation change HOT 2
- ActionBarActivity is deprecated HOT 3
- change background color of ActionBar to primaryColor HOT 2
- ActionBar Style (Colors and background)
- Closed
- Customize Item Background Colour HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from advancedmaterialdrawer.