Skip to content

Commit

Permalink
Closes #664
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamantcheese committed Feb 17, 2020
1 parent 2e1245d commit f452cb4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void onSlidingPaneLayoutStateRestored() {
}
if (restoredOpen != leftOpen) {
leftOpen = restoredOpen;
slideStateChanged(leftOpen);
slideStateChanged();
}
}

Expand All @@ -104,15 +104,15 @@ public void onPanelSlide(View panel, float slideOffset) {
public void onPanelOpened(View panel) {
if (this.leftOpen != leftOpen()) {
this.leftOpen = leftOpen();
slideStateChanged(leftOpen());
slideStateChanged();
}
}

@Override
public void onPanelClosed(View panel) {
if (this.leftOpen != leftOpen()) {
this.leftOpen = leftOpen();
slideStateChanged(leftOpen());
slideStateChanged();
}
}

Expand All @@ -130,7 +130,7 @@ public void switchToController(boolean leftController) {
if (slidingPaneLayout.getWidth() == 0) {
// It won't tell us it switched when it's not laid out yet.
leftOpen = leftController;
slideStateChanged(leftController);
slideStateChanged();
}
}
}
Expand Down Expand Up @@ -266,7 +266,7 @@ private boolean leftOpen() {
return slidingPaneLayout.isOpen();
}

private void slideStateChanged(boolean leftOpen) {
private void slideStateChanged() {
setParentNavigationItem(leftOpen);

notifySlideChanged(leftOpen ? leftController : rightController);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ public void setArrowMenu(ArrowMenuDrawable arrowMenu) {
}

public void set(NavigationItem item, Theme theme, ToolbarPresenter.AnimationStyle animation) {
if (transitionView != null) {
if (transitionView != null || (currentView != null && currentView.item == item)) {
// Happens when you are in Phone layout, moving the thread fragment and at the same time
// thread update occurs. We probably should just skip it. But maybe there is a better
// solution.
// Also prevent setting of an item that already exists in the current view
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import static com.github.adamantcheese.chan.utils.AndroidUtils.removeFromParentView;

/**
* An item for the Toolbar menu. These are ImageViews with an icon, that wehen pressed call
* An item for the Toolbar menu. These are ImageViews with an icon, that when pressed call
* some callback. Add them with the NavigationItem MenuBuilder.
*/
public class ToolbarMenuItem {
Expand Down

0 comments on commit f452cb4

Please sign in to comment.