Skip to content

Commit f289465

Browse files
committed
Fix bug 5449931 - Wrong theme for icon menus
IconMenuPresenter should always use its own theme for the system inflater. Change-Id: Iacadce37d62a60cdf6220d82f1178098ed92d51e
1 parent c291653 commit f289465

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

core/java/com/android/internal/view/menu/IconMenuPresenter.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import android.os.Parcelable;
2323
import android.util.SparseArray;
2424
import android.view.ContextThemeWrapper;
25-
import android.view.LayoutInflater;
2625
import android.view.MenuItem;
2726
import android.view.View;
2827
import android.view.ViewGroup;
@@ -44,15 +43,14 @@ public class IconMenuPresenter extends BaseMenuPresenter {
4443
private static final String OPEN_SUBMENU_KEY = "android:menu:icon:submenu";
4544

4645
public IconMenuPresenter(Context context) {
47-
super(context, com.android.internal.R.layout.icon_menu_layout,
46+
super(new ContextThemeWrapper(context, com.android.internal.R.style.Theme_IconMenu),
47+
com.android.internal.R.layout.icon_menu_layout,
4848
com.android.internal.R.layout.icon_menu_item_layout);
4949
}
5050

5151
@Override
5252
public void initForMenu(Context context, MenuBuilder menu) {
53-
mContext = new ContextThemeWrapper(context, com.android.internal.R.style.Theme_IconMenu);
54-
mInflater = LayoutInflater.from(mContext);
55-
mMenu = menu;
53+
super.initForMenu(context, menu);
5654
mMaxItems = -1;
5755
}
5856

0 commit comments

Comments
 (0)