Skip to content

Commit

Permalink
Fix #5476 (#5590)
Browse files Browse the repository at this point in the history
  • Loading branch information
heroic authored and guyca committed Nov 14, 2019
1 parent 764863f commit 35851fc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
public class ComponentPresenterBase {
public void applyTopInsets(@NonNull View view, int topInsets) {
MarginLayoutParams lp = (MarginLayoutParams) view.getLayoutParams();
if (lp.topMargin != topInsets) {
if (lp != null && lp.topMargin != topInsets) {
lp.topMargin = topInsets;
view.requestLayout();
}
}

public void applyBottomInset(@NonNull View view, int bottomInset) {
MarginLayoutParams lp = (MarginLayoutParams) view.getLayoutParams();
if (lp.bottomMargin!= bottomInset) {
if (lp != null && lp.bottomMargin!= bottomInset) {
lp.bottomMargin = bottomInset;
view.requestLayout();
}
Expand Down

0 comments on commit 35851fc

Please sign in to comment.