Commit 9506735b authored by Leonardo Aramaki's avatar Leonardo Aramaki
parent fcce8693
...@@ -95,36 +95,40 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract ...@@ -95,36 +95,40 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
} }
private void setupToolbar() { private void setupToolbar() {
pane.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() { if (pane != null) {
@Override pane.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() {
public void onPanelSlide(View view, float v) { @Override
//Ref: ActionBarDrawerToggle#setProgress public void onPanelSlide(View view, float v) {
toolbar.setNavigationIconProgress(v); //Ref: ActionBarDrawerToggle#setProgress
} toolbar.setNavigationIconProgress(v);
}
@Override @Override
public void onPanelOpened(View view) { public void onPanelOpened(View view) {
toolbar.setNavigationIconVerticalMirror(true); toolbar.setNavigationIconVerticalMirror(true);
} }
@Override @Override
public void onPanelClosed(View view) { public void onPanelClosed(View view) {
toolbar.setNavigationIconVerticalMirror(false); toolbar.setNavigationIconVerticalMirror(false);
Fragment fragment = getSupportFragmentManager() Fragment fragment = getSupportFragmentManager()
.findFragmentById(R.id.sidebar_fragment_container); .findFragmentById(R.id.sidebar_fragment_container);
if (fragment != null && fragment instanceof SidebarMainFragment) { if (fragment != null && fragment instanceof SidebarMainFragment) {
SidebarMainFragment sidebarMainFragment = (SidebarMainFragment) fragment; SidebarMainFragment sidebarMainFragment = (SidebarMainFragment) fragment;
sidebarMainFragment.toggleUserActionContainer(false); sidebarMainFragment.toggleUserActionContainer(false);
sidebarMainFragment.showUserActionContainer(false); sidebarMainFragment.showUserActionContainer(false);
}
} }
} });
}); }
toolbar.setNavigationOnClickListener(view -> { if (toolbar != null) {
if (pane.isSlideable() && !pane.isOpen()) { toolbar.setNavigationOnClickListener(view -> {
pane.openPane(); if (pane.isSlideable() && !pane.isOpen()) {
} pane.openPane();
}); }
});
}
} }
private boolean closeSidebarIfNeeded() { private boolean closeSidebarIfNeeded() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment