MenuAdapter.java
2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package android.support.v7.view.menu;
import android.support.annotation.RestrictTo;
import android.support.v7.appcompat.R.layout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import java.util.ArrayList;
@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public class MenuAdapter
extends BaseAdapter
{
static final int a = R.layout.abc_popup_menu_item_layout;
public MenuBuilder b;
private int c = -1;
private boolean d;
private final boolean e;
private final LayoutInflater f;
public MenuAdapter(MenuBuilder paramMenuBuilder, LayoutInflater paramLayoutInflater, boolean paramBoolean)
{
this.e = paramBoolean;
this.f = paramLayoutInflater;
this.b = paramMenuBuilder;
a();
}
private void a()
{
MenuItemImpl localMenuItemImpl = this.b.getExpandedItem();
if (localMenuItemImpl != null)
{
ArrayList localArrayList = this.b.getNonActionItems();
int j = localArrayList.size();
int i = 0;
while (i < j)
{
if ((MenuItemImpl)localArrayList.get(i) == localMenuItemImpl)
{
this.c = i;
return;
}
i += 1;
}
}
this.c = -1;
}
public MenuBuilder getAdapterMenu()
{
return this.b;
}
public int getCount()
{
if (this.e) {}
for (ArrayList localArrayList = this.b.getNonActionItems(); this.c < 0; localArrayList = this.b.getVisibleItems()) {
return localArrayList.size();
}
return localArrayList.size() - 1;
}
public boolean getForceShowIcon()
{
return this.d;
}
public MenuItemImpl getItem(int paramInt)
{
if (this.e) {}
for (ArrayList localArrayList = this.b.getNonActionItems();; localArrayList = this.b.getVisibleItems())
{
int i = paramInt;
if (this.c >= 0)
{
i = paramInt;
if (paramInt >= this.c) {
i = paramInt + 1;
}
}
return (MenuItemImpl)localArrayList.get(i);
}
}
public long getItemId(int paramInt)
{
return paramInt;
}
public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
{
if (paramView == null) {
paramView = this.f.inflate(a, paramViewGroup, false);
}
for (;;)
{
paramViewGroup = (MenuView.ItemView)paramView;
if (this.d) {
((ListMenuItemView)paramView).setForceShowIcon(true);
}
paramViewGroup.initialize(getItem(paramInt), 0);
return paramView;
}
}
public void notifyDataSetChanged()
{
a();
super.notifyDataSetChanged();
}
public void setForceShowIcon(boolean paramBoolean)
{
this.d = paramBoolean;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/view/menu/MenuAdapter.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/