Commit db7f265f authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update MainActivity.java

parent 693dea77
...@@ -4,7 +4,6 @@ import android.os.Bundle; ...@@ -4,7 +4,6 @@ import android.os.Bundle;
import android.support.annotation.Nullable; 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.view.View;
import chat.rocket.android.LaunchUtil; import chat.rocket.android.LaunchUtil;
import chat.rocket.android.R; import chat.rocket.android.R;
...@@ -43,7 +42,6 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract ...@@ -43,7 +42,6 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
toolbar = (RoomToolbar) findViewById(R.id.activity_main_toolbar); toolbar = (RoomToolbar) findViewById(R.id.activity_main_toolbar);
statusTicker = new StatusTicker(); statusTicker = new StatusTicker();
setupSidebar();
} }
@Override @Override
...@@ -63,48 +61,6 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract ...@@ -63,48 +61,6 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
super.onPause(); super.onPause();
} }
private void setupSidebar() {
SlidingPaneLayout pane = (SlidingPaneLayout) findViewById(R.id.sliding_pane);
if (pane == null) {
return;
}
final SlidingPaneLayout subPane = (SlidingPaneLayout) findViewById(R.id.sub_sliding_pane);
pane.setPanelSlideListener(new SlidingPaneLayout.SimplePanelSlideListener() {
@Override
public void onPanelClosed(View panel) {
super.onPanelClosed(panel);
if (subPane != null) {
subPane.closePane();
}
}
});
toolbar.setNavigationOnClickListener(view -> {
if (pane.isSlideable() && !pane.isOpen()) {
pane.openPane();
}
});
//ref: ActionBarDrawerToggle#setProgress
pane.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() {
@Override
public void onPanelSlide(View panel, float slideOffset) {
toolbar.setNavigationIconProgress(slideOffset);
}
@Override
public void onPanelOpened(View panel) {
toolbar.setNavigationIconVerticalMirror(true);
}
@Override
public void onPanelClosed(View panel) {
toolbar.setNavigationIconVerticalMirror(false);
closeUserActionContainer();
}
});
}
private boolean closeSidebarIfNeeded() { private boolean closeSidebarIfNeeded() {
// REMARK: Tablet UI doesn't have SlidingPane! // REMARK: Tablet UI doesn't have SlidingPane!
...@@ -156,14 +112,6 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract ...@@ -156,14 +112,6 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
.commit(); .commit();
} }
private void closeUserActionContainer() {
SidebarMainFragment sidebarFragment = (SidebarMainFragment) getSupportFragmentManager()
.findFragmentById(R.id.sidebar_fragment_container);
if (sidebarFragment != null) {
sidebarFragment.closeUserActionContainer();
}
}
@Override @Override
protected void onRoomIdUpdated() { protected void onRoomIdUpdated() {
super.onRoomIdUpdated(); super.onRoomIdUpdated();
......
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