first commit
[bylock.git] / sources / android / support / v7 / a / j.java
blob414a79c0ca537c03fe9ea8cbcd57ff9f4279fd9d
1 package android.support.v7.a;
3 import android.content.Context;
4 import android.content.res.Configuration;
5 import android.content.res.TypedArray;
6 import android.os.Bundle;
7 import android.support.v7.b.c;
8 import android.support.v7.b.d;
9 import android.support.v7.b.f;
10 import android.support.v7.b.h;
11 import android.support.v7.b.k;
12 import android.support.v7.c.a;
13 import android.support.v7.c.b;
14 import android.support.v7.internal.view.menu.ag;
15 import android.support.v7.internal.view.menu.ah;
16 import android.support.v7.internal.view.menu.aj;
17 import android.support.v7.internal.view.menu.o;
18 import android.support.v7.internal.view.menu.q;
19 import android.support.v7.internal.view.menu.r;
20 import android.support.v7.internal.widget.ActionBarContainer;
21 import android.support.v7.internal.widget.ActionBarContextView;
22 import android.support.v7.internal.widget.ActionBarView;
23 import android.view.Menu;
24 import android.view.MenuItem;
25 import android.view.View;
26 import android.view.ViewGroup;
27 import android.widget.FrameLayout;
29 /* access modifiers changed from: package-private */
30 /* compiled from: MyApp */
31 public class j extends g implements ag, r {
32 private static final int[] d = {c.homeAsUpIndicator};
33 private ActionBarView e;
34 private o f;
35 private q g;
36 private a h;
37 private boolean i;
38 private CharSequence j;
39 private boolean k;
40 private boolean l;
41 private boolean m;
42 private boolean n;
43 private boolean o;
44 private Bundle p;
46 j(f fVar) {
47 super(fVar);
50 @Override // android.support.v7.a.g
51 public a a() {
52 k();
53 return new r(this.a, this.a);
56 @Override // android.support.v7.a.g
57 public void a(Configuration configuration) {
58 if (this.b && this.i) {
59 ((r) b()).a(configuration);
63 @Override // android.support.v7.a.g
64 public void d() {
65 r rVar = (r) b();
66 if (rVar != null) {
67 rVar.g(false);
71 @Override // android.support.v7.a.g
72 public void e() {
73 r rVar = (r) b();
74 if (rVar != null) {
75 rVar.g(true);
79 @Override // android.support.v7.a.g
80 public void a(View view) {
81 k();
82 ViewGroup viewGroup = (ViewGroup) this.a.findViewById(16908290);
83 viewGroup.removeAllViews();
84 viewGroup.addView(view);
85 this.a.h();
88 @Override // android.support.v7.a.g
89 public void a(int i2) {
90 k();
91 ViewGroup viewGroup = (ViewGroup) this.a.findViewById(16908290);
92 viewGroup.removeAllViews();
93 this.a.getLayoutInflater().inflate(i2, viewGroup);
94 this.a.h();
97 @Override // android.support.v7.a.g
98 public void a(View view, ViewGroup.LayoutParams layoutParams) {
99 k();
100 ViewGroup viewGroup = (ViewGroup) this.a.findViewById(16908290);
101 viewGroup.removeAllViews();
102 viewGroup.addView(view, layoutParams);
103 this.a.h();
106 @Override // android.support.v7.a.g
107 public void b(View view, ViewGroup.LayoutParams layoutParams) {
108 k();
109 ((ViewGroup) this.a.findViewById(16908290)).addView(view, layoutParams);
110 this.a.h();
113 @Override // android.support.v7.a.g
114 public void h() {
117 /* access modifiers changed from: package-private */
118 public final void k() {
119 boolean z;
120 if (!this.i) {
121 if (this.b) {
122 if (this.c) {
123 this.a.a(h.abc_action_bar_decor_overlay);
124 } else {
125 this.a.a(h.abc_action_bar_decor);
127 this.e = (ActionBarView) this.a.findViewById(f.action_bar);
128 this.e.setWindowCallback(this.a);
129 if (this.k) {
130 this.e.g();
132 if (this.l) {
133 this.e.h();
135 boolean equals = "splitActionBarWhenNarrow".equals(i());
136 if (equals) {
137 z = this.a.getResources().getBoolean(d.abc_split_action_bar_is_narrow);
138 } else {
139 TypedArray obtainStyledAttributes = this.a.obtainStyledAttributes(k.ActionBarWindow);
140 boolean z2 = obtainStyledAttributes.getBoolean(2, false);
141 obtainStyledAttributes.recycle();
142 z = z2;
144 ActionBarContainer actionBarContainer = (ActionBarContainer) this.a.findViewById(f.split_action_bar);
145 if (actionBarContainer != null) {
146 this.e.setSplitView(actionBarContainer);
147 this.e.setSplitActionBar(z);
148 this.e.setSplitWhenNarrow(equals);
149 ActionBarContextView actionBarContextView = (ActionBarContextView) this.a.findViewById(f.action_context_bar);
150 actionBarContextView.setSplitView(actionBarContainer);
151 actionBarContextView.setSplitActionBar(z);
152 actionBarContextView.setSplitWhenNarrow(equals);
154 } else {
155 this.a.a(h.abc_simple_decor);
157 this.a.findViewById(16908290).setId(-1);
158 this.a.findViewById(f.action_bar_activity_content).setId(16908290);
159 if (this.j != null) {
160 this.e.setWindowTitle(this.j);
161 this.j = null;
163 l();
164 this.i = true;
165 this.a.getWindow().getDecorView().post(new k(this));
169 /* JADX WARNING: Removed duplicated region for block: B:36:0x007e */
170 /* JADX WARNING: Removed duplicated region for block: B:47:0x00a9 */
171 /* JADX WARNING: Removed duplicated region for block: B:48:0x00ab */
172 /* Code decompiled incorrectly, please refer to instructions dump. */
173 private void l() {
175 // Method dump skipped, instructions count: 209
177 throw new UnsupportedOperationException("Method not decompiled: android.support.v7.a.j.l():void");
180 @Override // android.support.v7.a.g
181 public void a(CharSequence charSequence) {
182 if (this.e != null) {
183 this.e.setWindowTitle(charSequence);
184 } else {
185 this.j = charSequence;
189 @Override // android.support.v7.a.g
190 public View b(int i2) {
191 if (i2 != 0 || !n()) {
192 return null;
194 return (View) a(this.a, this);
197 @Override // android.support.v7.a.g
198 public boolean a(int i2, Menu menu) {
199 if (i2 != 0) {
200 return this.a.a(i2, menu);
202 return false;
205 @Override // android.support.v7.a.g
206 public boolean a(int i2, View view, Menu menu) {
207 if (i2 != 0) {
208 return this.a.a(i2, view, menu);
210 return false;
213 @Override // android.support.v7.a.g
214 public boolean a(int i2, MenuItem menuItem) {
215 if (i2 == 0) {
216 menuItem = aj.a(menuItem);
218 return this.a.a(i2, menuItem);
221 @Override // android.support.v7.internal.view.menu.r
222 public boolean a(q qVar, MenuItem menuItem) {
223 return this.a.onMenuItemSelected(0, menuItem);
226 @Override // android.support.v7.internal.view.menu.r
227 public void a(q qVar) {
228 b(qVar, true);
231 @Override // android.support.v7.internal.view.menu.ag
232 public void a(q qVar, boolean z) {
233 if (!this.m) {
234 this.m = true;
235 this.a.closeOptionsMenu();
236 this.e.f();
237 this.m = false;
241 @Override // android.support.v7.internal.view.menu.ag
242 public boolean b(q qVar) {
243 return false;
246 @Override // android.support.v7.a.g
247 public a a(b bVar) {
248 if (bVar == null) {
249 throw new IllegalArgumentException("ActionMode callback can not be null.");
251 if (this.h != null) {
252 this.h.b();
254 l lVar = new l(this, bVar);
255 r rVar = (r) b();
256 if (rVar != null) {
257 this.h = rVar.a(lVar);
259 if (this.h != null) {
260 this.a.a(this.h);
262 return this.h;
265 @Override // android.support.v7.a.g
266 public void f() {
267 if (this.g != null) {
268 Bundle bundle = new Bundle();
269 this.g.a(bundle);
270 if (bundle.size() > 0) {
271 this.p = bundle;
273 this.g.g();
274 this.g.clear();
276 this.o = true;
277 if (this.e != null) {
278 this.n = false;
279 n();
283 private void b(q qVar, boolean z) {
284 if (this.e == null || !this.e.e()) {
285 qVar.close();
286 } else if (this.e.d() && z) {
287 this.e.c();
288 } else if (this.e.getVisibility() == 0) {
289 this.e.a();
293 private ah a(Context context, ag agVar) {
294 if (this.g == null) {
295 return null;
297 if (this.f == null) {
298 TypedArray obtainStyledAttributes = context.obtainStyledAttributes(k.Theme);
299 int resourceId = obtainStyledAttributes.getResourceId(4, android.support.v7.b.j.Theme_AppCompat_CompactMenu);
300 obtainStyledAttributes.recycle();
301 this.f = new o(h.abc_list_menu_item_layout, resourceId);
302 this.f.a(agVar);
303 this.g.a(this.f);
304 } else {
305 this.f.c(false);
307 return this.f.a(new FrameLayout(context));
310 @Override // android.support.v7.a.g
311 public boolean g() {
312 if (this.h != null) {
313 this.h.b();
314 return true;
315 } else if (this.e == null || !this.e.k()) {
316 return false;
317 } else {
318 this.e.l();
319 return true;
323 private boolean m() {
324 this.g = new q(j());
325 this.g.a(this);
326 return true;
329 private boolean n() {
330 if (this.n) {
331 return true;
333 if (this.g == null || this.o) {
334 if (this.g == null && (!m() || this.g == null)) {
335 return false;
337 if (this.e != null) {
338 this.e.a(this.g, this);
340 this.g.g();
341 if (!this.a.a(0, this.g)) {
342 this.g = null;
343 if (this.e != null) {
344 this.e.a(null, this);
346 return false;
348 this.o = false;
350 this.g.g();
351 if (this.p != null) {
352 this.g.b(this.p);
353 this.p = null;
355 if (!this.a.a(0, (View) null, this.g)) {
356 if (this.e != null) {
357 this.e.a(null, this);
359 this.g.h();
360 return false;
362 this.g.h();
363 this.n = true;
364 return true;