|
@@ -6,6 +6,7 @@ import android.graphics.PorterDuffColorFilter;
|
6
|
6
|
import android.graphics.Typeface;
|
7
|
7
|
import android.graphics.drawable.Drawable;
|
8
|
8
|
import android.support.annotation.NonNull;
|
|
9
|
+import android.support.v7.widget.ActionMenuView;
|
9
|
10
|
import android.support.v7.widget.Toolbar;
|
10
|
11
|
import android.text.Spannable;
|
11
|
12
|
import android.text.SpannableString;
|
|
@@ -20,10 +21,12 @@ import java.util.ArrayList;
|
20
|
21
|
|
21
|
22
|
public class ButtonOptionsPresenter {
|
22
|
23
|
private final Toolbar toolbar;
|
|
24
|
+ private final ActionMenuView actionMenuView;
|
23
|
25
|
private Button button;
|
24
|
26
|
|
25
|
27
|
public ButtonOptionsPresenter(Toolbar toolbar, Button button) {
|
26
|
28
|
this.toolbar = toolbar;
|
|
29
|
+ actionMenuView = ViewUtils.findChildrenByClass(toolbar, ActionMenuView.class).get(0);
|
27
|
30
|
this.button = button;
|
28
|
31
|
}
|
29
|
32
|
|
|
@@ -77,7 +80,7 @@ public class ButtonOptionsPresenter {
|
77
|
80
|
private ArrayList<View> findActualTextViewInMenu() {
|
78
|
81
|
ArrayList<View> outViews = new ArrayList<>();
|
79
|
82
|
if (button.text.hasValue()) {
|
80
|
|
- toolbar.findViewsWithText(outViews, button.text.get(), View.FIND_VIEWS_WITH_TEXT);
|
|
83
|
+ actionMenuView.findViewsWithText(outViews, button.text.get(), View.FIND_VIEWS_WITH_TEXT);
|
81
|
84
|
}
|
82
|
85
|
return outViews;
|
83
|
86
|
}
|