Skip to content

Commit 0b10cb9

Browse files
committed
Fixing bug with screen rotation on tablets.
1 parent 45b56b8 commit 0b10cb9

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

app/src/main/java/com/donnfelker/android/bootstrap/ui/NavigationDrawerFragment.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.donnfelker.android.bootstrap.Injector;
2323
import com.donnfelker.android.bootstrap.R;
2424
import com.donnfelker.android.bootstrap.events.NavItemSelectedEvent;
25+
import com.donnfelker.android.bootstrap.util.UIUtils;
2526
import com.squareup.otto.Bus;
2627

2728
import javax.inject.Inject;
@@ -213,8 +214,18 @@ public void onSaveInstanceState(Bundle outState) {
213214
@Override
214215
public void onConfigurationChanged(Configuration newConfig) {
215216
super.onConfigurationChanged(newConfig);
216-
// Forward the new configuration the drawer toggle component.
217-
drawerToggle.onConfigurationChanged(newConfig);
217+
218+
if(!isTablet()) {
219+
// Forward the new configuration the drawer toggle component.
220+
drawerToggle.onConfigurationChanged(newConfig);
221+
}
222+
}
223+
224+
private boolean isTablet() {
225+
if(getActivity() != null) {
226+
return UIUtils.isTablet(getActivity());
227+
}
228+
return false;
218229
}
219230

220231
@Override

0 commit comments

Comments
 (0)