diff options
Diffstat (limited to 'java/com/android/dialer/main/impl/toolbar/MainToolbar.java')
-rw-r--r-- | java/com/android/dialer/main/impl/toolbar/MainToolbar.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/java/com/android/dialer/main/impl/toolbar/MainToolbar.java b/java/com/android/dialer/main/impl/toolbar/MainToolbar.java index fc4bd0312..2f36717c9 100644 --- a/java/com/android/dialer/main/impl/toolbar/MainToolbar.java +++ b/java/com/android/dialer/main/impl/toolbar/MainToolbar.java @@ -19,6 +19,7 @@ package com.android.dialer.main.impl.toolbar; import android.animation.ValueAnimator; import android.animation.ValueAnimator.AnimatorUpdateListener; import android.content.Context; +import android.support.annotation.NonNull; import android.support.annotation.StringRes; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; @@ -66,9 +67,9 @@ public final class MainToolbar extends Toolbar implements PopupMenu.OnMenuItemCl return listener.onMenuItemClicked(menuItem); } - public void setSearchBarListener(SearchBarListener listener) { - this.listener = listener; - ((SearchBarView) findViewById(R.id.search_view_container)).setSearchBarListener(listener); + public void setSearchBarListener(@NonNull SearchBarListener listener) { + this.listener = Assert.isNotNull(listener); + searchBar.setSearchBarListener(listener); } /** Slides the toolbar up and off the screen. */ |