Skip to content

Commit

Permalink
Remove NOOP window insets listener
Browse files Browse the repository at this point in the history
Bug is fixed in the latest support library now
  • Loading branch information
ZacSweers committed Feb 25, 2016
1 parent 02f7b91 commit 0a7049a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions app/src/main/java/io/plaidapp/ui/HomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,6 @@ public class HomeActivity extends AppCompatActivity {
private static final int RC_NEW_DESIGNER_NEWS_STORY = 4;
private static final int RC_NEW_DESIGNER_NEWS_LOGIN = 5;

private static final OnApplyWindowInsetsListener NOOP_WINDOW_INSETS_LISTENER = new OnApplyWindowInsetsListener() {
@Override
public WindowInsetsCompat onApplyWindowInsets(View v, WindowInsetsCompat insets) {
// We have to noop this because the support implementation assumes the input listener is't null
// https://code.google.com/p/android/issues/detail?id=197492
return insets.consumeSystemWindowInsets();
}
};

@Bind(R.id.drawer) DrawerLayout drawer;
@Bind(R.id.toolbar) Toolbar toolbar;
@Bind(R.id.stories_grid) RecyclerView grid;
Expand Down Expand Up @@ -248,7 +239,7 @@ public WindowInsetsCompat onApplyWindowInsets(View v, WindowInsetsCompat insets)
filtersList.getPaddingBottom() + insets.getSystemWindowInsetBottom());

// clear this listener so insets aren't re-applied
ViewCompat.setOnApplyWindowInsetsListener(drawer, NOOP_WINDOW_INSETS_LISTENER);
ViewCompat.setOnApplyWindowInsetsListener(drawer, null);

return insets.consumeSystemWindowInsets();
}
Expand Down

0 comments on commit 0a7049a

Please sign in to comment.