Commit 5ca73afb authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update MainActivity.java

parent 4eeeae4b
...@@ -5,6 +5,7 @@ import android.support.annotation.Nullable; ...@@ -5,6 +5,7 @@ import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar; import android.support.design.widget.Snackbar;
import android.support.v4.widget.SlidingPaneLayout; import android.support.v4.widget.SlidingPaneLayout;
import android.support.v7.graphics.drawable.DrawerArrowDrawable; import android.support.v7.graphics.drawable.DrawerArrowDrawable;
import android.support.v7.widget.Toolbar;
import android.view.View; import android.view.View;
import chat.rocket.android.LaunchUtil; import chat.rocket.android.LaunchUtil;
...@@ -81,31 +82,11 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract ...@@ -81,31 +82,11 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
} }
}); });
final DrawerArrowDrawable drawerArrowDrawable = new DrawerArrowDrawable(this);
toolbar.setNavigationIcon(drawerArrowDrawable);
toolbar.setNavigationOnClickListener(view -> { toolbar.setNavigationOnClickListener(view -> {
if (pane.isSlideable() && !pane.isOpen()) { if (pane.isSlideable() && !pane.isOpen()) {
pane.openPane(); pane.openPane();
} }
}); });
//ref: ActionBarDrawerToggle#setProgress
pane.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() {
@Override
public void onPanelSlide(View panel, float slideOffset) {
drawerArrowDrawable.setProgress(slideOffset);
}
@Override
public void onPanelOpened(View panel) {
drawerArrowDrawable.setVerticalMirror(true);
}
@Override
public void onPanelClosed(View panel) {
drawerArrowDrawable.setVerticalMirror(false);
}
});
} }
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