package com.a.a; import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.StateListDrawable; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.support.v4.app.Fragment; import android.support.v4.app.j; import android.support.v4.app.m; import android.util.TypedValue; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.TranslateAnimation; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.FrameLayout; import android.widget.LinearLayout; import com.a.a.b; import com.meizu.cloud.pushsdk.constants.PushConstants; /* compiled from: ActionSheet */ public class a extends Fragment implements View.OnClickListener, View.OnKeyListener { /* renamed from: ʻ reason: contains not printable characters */ private boolean f4255 = true; /* renamed from: ʼ reason: contains not printable characters */ private AbstractC0041a f4256; /* renamed from: ʽ reason: contains not printable characters */ private View f4257; /* renamed from: ʾ reason: contains not printable characters */ private LinearLayout f4258; /* renamed from: ʿ reason: contains not printable characters */ private ViewGroup f4259; /* renamed from: ˆ reason: contains not printable characters */ private View f4260; /* renamed from: ˈ reason: contains not printable characters */ private b f4261; /* renamed from: ˉ reason: contains not printable characters */ private boolean f4262 = true; /* renamed from: com.a.a.a$a reason: collision with other inner class name */ /* compiled from: ActionSheet */ public interface AbstractC0041a { /* renamed from: ʻ reason: contains not printable characters */ void m6231(a aVar, int i); /* renamed from: ʻ reason: contains not printable characters */ void m6232(a aVar, boolean z); } /* renamed from: ʻ reason: contains not printable characters */ public void m6224(final j jVar, final String str) { if (this.f4255 && !jVar.m1763()) { this.f4255 = false; new Handler().post(new Runnable() { /* class com.a.a.a.AnonymousClass1 */ public void run() { m r0 = jVar.m1756(); r0.m1907(a.this, str); r0.m1908((String) null); r0.m1911(); } }); } } /* renamed from: ʽ reason: contains not printable characters */ public void m6227() { if (!this.f4255) { this.f4255 = true; new Handler().post(new Runnable() { /* class com.a.a.a.AnonymousClass2 */ public void run() { a.this.m1568().m1760(); m r0 = a.this.m1568().m1756(); r0.m1906(a.this); r0.m1911(); } }); } } @Override // android.support.v4.app.Fragment /* renamed from: ʿ reason: contains not printable characters */ public void m6229(Bundle bundle) { bundle.putBoolean("extra_dismissed", this.f4255); } @Override // android.support.v4.app.Fragment /* renamed from: ʻ reason: contains not printable characters */ public void m6223(Bundle bundle) { super.m1489(bundle); if (bundle != null) { this.f4255 = bundle.getBoolean("extra_dismissed"); } } @Override // android.support.v4.app.Fragment /* renamed from: ʻ reason: contains not printable characters */ public View m6222(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View currentFocus; InputMethodManager inputMethodManager = (InputMethodManager) m1564().getSystemService("input_method"); if (inputMethodManager.isActive() && (currentFocus = m1564().getCurrentFocus()) != null) { inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0); } this.f4261 = m6213(); View r0 = m6211(); this.f4257 = r0; r0.setFocusableInTouchMode(true); this.f4257.requestFocus(); this.f4257.setOnKeyListener(this); this.f4259 = (ViewGroup) m1564().getWindow().getDecorView(); m6212(); this.f4259.addView(this.f4257); this.f4260.startAnimation(m6221()); this.f4258.startAnimation(m6220()); return super.m1475(layoutInflater, viewGroup, bundle); } @Override // android.support.v4.app.Fragment /* renamed from: ˋ reason: contains not printable characters */ public void m6230() { this.f4258.startAnimation(m6209()); this.f4260.startAnimation(m6210()); this.f4257.postDelayed(new Runnable() { /* class com.a.a.a.AnonymousClass3 */ public void run() { a.this.f4259.removeView(a.this.f4257); } }, 300); AbstractC0041a aVar = this.f4256; if (aVar != null) { aVar.m6232(this, this.f4262); } super.m1547(); } /* renamed from: ʿ reason: contains not printable characters */ private Animation m6220() { TranslateAnimation translateAnimation = new TranslateAnimation(1, 0.0f, 1, 0.0f, 1, 1.0f, 1, 0.0f); translateAnimation.setDuration(200); return translateAnimation; } /* renamed from: ˆ reason: contains not printable characters */ private Animation m6221() { AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f); alphaAnimation.setDuration(300); return alphaAnimation; } /* renamed from: ʻˋ reason: contains not printable characters */ private Animation m6209() { TranslateAnimation translateAnimation = new TranslateAnimation(1, 0.0f, 1, 0.0f, 1, 0.0f, 1, 1.0f); translateAnimation.setDuration(200); translateAnimation.setFillAfter(true); return translateAnimation; } /* renamed from: ʻˎ reason: contains not printable characters */ private Animation m6210() { AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f); alphaAnimation.setDuration(300); alphaAnimation.setFillAfter(true); return alphaAnimation; } /* renamed from: ʻˏ reason: contains not printable characters */ private View m6211() { FrameLayout frameLayout = new FrameLayout(m1564()); frameLayout.setLayoutParams(new FrameLayout.LayoutParams(-1, -1)); View view = new View(m1564()); this.f4260 = view; view.setLayoutParams(new FrameLayout.LayoutParams(-1, -1)); this.f4260.setBackgroundColor(Color.argb(136, 0, 0, 0)); this.f4260.setId(10); this.f4260.setOnClickListener(this); this.f4258 = new LinearLayout(m1564()); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -2); layoutParams.gravity = 80; this.f4258.setLayoutParams(layoutParams); this.f4258.setOrientation(1); frameLayout.setPadding(0, 0, 0, m6226(m1564())); frameLayout.addView(this.f4260); frameLayout.addView(this.f4258); return frameLayout; } /* renamed from: ʼ reason: contains not printable characters */ public int m6226(Context context) { Resources resources; int identifier; if (Build.VERSION.SDK_INT < 21 || (identifier = (resources = context.getResources()).getIdentifier("navigation_bar_height", "dimen", "android")) <= 0 || !m6219(context)) { return 0; } return resources.getDimensionPixelSize(identifier); } /* renamed from: ʽ reason: contains not printable characters */ private boolean m6219(Context context) { Resources resources = context.getResources(); int identifier = resources.getIdentifier("config_showNavigationBar", "bool", "android"); boolean z = false; boolean z2 = identifier > 0 ? resources.getBoolean(identifier) : false; try { Class<?> cls = Class.forName("android.os.SystemProperties"); String str = (String) cls.getMethod("get", String.class).invoke(cls, "qemu.hw.mainkeys"); if (!"1".equals(str)) { z = PushConstants.PUSH_TYPE_NOTIFY.equals(str) ? true : z2; } return z; } catch (Exception e) { e.printStackTrace(); return z2; } } /* renamed from: ʻˑ reason: contains not printable characters */ private void m6212() { String[] r0 = m6215(); if (r0 != null) { for (int i = 0; i < r0.length; i++) { Button button = new Button(m1564()); button.setId(i + 100 + 1); button.setOnClickListener(this); button.setBackgroundDrawable(m6217(r0, i)); button.setText(r0[i]); button.setTextColor(this.f4261.f4275); button.setTextSize(0, this.f4261.f4279); if (i > 0) { LinearLayout.LayoutParams r5 = m6228(); r5.topMargin = this.f4261.f4277; this.f4258.addView(button, r5); } else { this.f4258.addView(button); } } } Button button2 = new Button(m1564()); button2.getPaint().setFakeBoldText(true); button2.setTextSize(0, this.f4261.f4279); button2.setId(100); button2.setBackgroundDrawable(this.f4261.f4269); button2.setText(m6214()); button2.setTextColor(this.f4261.f4274); button2.setOnClickListener(this); LinearLayout.LayoutParams r1 = m6228(); r1.topMargin = this.f4261.f4278; this.f4258.addView(button2, r1); this.f4258.setBackgroundDrawable(this.f4261.f4268); this.f4258.setPadding(this.f4261.f4276, this.f4261.f4276, this.f4261.f4276, this.f4261.f4276); } /* renamed from: ʾ reason: contains not printable characters */ public LinearLayout.LayoutParams m6228() { return new LinearLayout.LayoutParams(-1, -2); } /* renamed from: ʼ reason: contains not printable characters */ private Drawable m6217(String[] strArr, int i) { if (strArr.length == 1) { return this.f4261.f4273; } if (strArr.length == 2) { if (i == 0) { return this.f4261.f4270; } if (i == 1) { return this.f4261.f4272; } } if (strArr.length <= 2) { return null; } if (i == 0) { return this.f4261.f4270; } if (i == strArr.length - 1) { return this.f4261.f4272; } return this.f4261.m6234(); } /* renamed from: ʻי reason: contains not printable characters */ private b m6213() { b bVar = new b(m1564()); TypedArray obtainStyledAttributes = m1564().getTheme().obtainStyledAttributes(null, b.C0042b.ActionSheet, b.a.actionSheetStyle, 0); Drawable drawable = obtainStyledAttributes.getDrawable(b.C0042b.ActionSheet_actionSheetBackground); if (drawable != null) { bVar.f4268 = drawable; } Drawable drawable2 = obtainStyledAttributes.getDrawable(b.C0042b.ActionSheet_cancelButtonBackground); if (drawable2 != null) { bVar.f4269 = drawable2; } Drawable drawable3 = obtainStyledAttributes.getDrawable(b.C0042b.ActionSheet_otherButtonTopBackground); if (drawable3 != null) { bVar.f4270 = drawable3; } Drawable drawable4 = obtainStyledAttributes.getDrawable(b.C0042b.ActionSheet_otherButtonMiddleBackground); if (drawable4 != null) { bVar.f4271 = drawable4; } Drawable drawable5 = obtainStyledAttributes.getDrawable(b.C0042b.ActionSheet_otherButtonBottomBackground); if (drawable5 != null) { bVar.f4272 = drawable5; } Drawable drawable6 = obtainStyledAttributes.getDrawable(b.C0042b.ActionSheet_otherButtonSingleBackground); if (drawable6 != null) { bVar.f4273 = drawable6; } bVar.f4274 = obtainStyledAttributes.getColor(b.C0042b.ActionSheet_cancelButtonTextColor, bVar.f4274); bVar.f4275 = obtainStyledAttributes.getColor(b.C0042b.ActionSheet_otherButtonTextColor, bVar.f4275); bVar.f4276 = (int) obtainStyledAttributes.getDimension(b.C0042b.ActionSheet_actionSheetPadding, (float) bVar.f4276); bVar.f4277 = (int) obtainStyledAttributes.getDimension(b.C0042b.ActionSheet_otherButtonSpacing, (float) bVar.f4277); bVar.f4278 = (int) obtainStyledAttributes.getDimension(b.C0042b.ActionSheet_cancelButtonMarginTop, (float) bVar.f4278); bVar.f4279 = (float) obtainStyledAttributes.getDimensionPixelSize(b.C0042b.ActionSheet_actionSheetTextSize, (int) bVar.f4279); obtainStyledAttributes.recycle(); return bVar; } /* renamed from: ʻـ reason: contains not printable characters */ private String m6214() { return m1553().getString("cancel_button_title"); } /* renamed from: ʻٴ reason: contains not printable characters */ private String[] m6215() { return m1553().getStringArray("other_button_titles"); } /* renamed from: ʻᐧ reason: contains not printable characters */ private boolean m6216() { return m1553().getBoolean("cancelable_ontouchoutside"); } /* renamed from: ʻ reason: contains not printable characters */ public void m6225(AbstractC0041a aVar) { this.f4256 = aVar; } public void onClick(View view) { if (view.getId() != 10 || m6216()) { m6227(); if (view.getId() != 100 && view.getId() != 10) { AbstractC0041a aVar = this.f4256; if (aVar != null) { aVar.m6231(this, (view.getId() - 100) - 1); } this.f4262 = false; } } } /* renamed from: ʻ reason: contains not printable characters */ public static c m6208(Context context, j jVar) { return new c(context, jVar); } public boolean onKey(View view, int i, KeyEvent keyEvent) { if (this.f4255 || i != 4 || keyEvent.getAction() != 1) { return false; } m6227(); return true; } /* access modifiers changed from: private */ /* compiled from: ActionSheet */ public static class b { /* renamed from: ʻ reason: contains not printable characters */ Drawable f4268 = new ColorDrawable(0); /* renamed from: ʼ reason: contains not printable characters */ Drawable f4269 = new ColorDrawable(-16777216); /* renamed from: ʽ reason: contains not printable characters */ Drawable f4270; /* renamed from: ʾ reason: contains not printable characters */ Drawable f4271; /* renamed from: ʿ reason: contains not printable characters */ Drawable f4272; /* renamed from: ˆ reason: contains not printable characters */ Drawable f4273; /* renamed from: ˈ reason: contains not printable characters */ int f4274; /* renamed from: ˉ reason: contains not printable characters */ int f4275; /* renamed from: ˊ reason: contains not printable characters */ int f4276; /* renamed from: ˋ reason: contains not printable characters */ int f4277; /* renamed from: ˎ reason: contains not printable characters */ int f4278; /* renamed from: ˏ reason: contains not printable characters */ float f4279; /* renamed from: ˑ reason: contains not printable characters */ private Context f4280; public b(Context context) { this.f4280 = context; ColorDrawable colorDrawable = new ColorDrawable(-7829368); this.f4270 = colorDrawable; this.f4271 = colorDrawable; this.f4272 = colorDrawable; this.f4273 = colorDrawable; this.f4274 = -1; this.f4275 = -16777216; this.f4276 = m6233(20); this.f4277 = m6233(2); this.f4278 = m6233(10); this.f4279 = (float) m6233(16); } /* renamed from: ʻ reason: contains not printable characters */ private int m6233(int i) { return (int) TypedValue.applyDimension(1, (float) i, this.f4280.getResources().getDisplayMetrics()); } /* renamed from: ʻ reason: contains not printable characters */ public Drawable m6234() { if (this.f4271 instanceof StateListDrawable) { TypedArray obtainStyledAttributes = this.f4280.getTheme().obtainStyledAttributes(null, b.C0042b.ActionSheet, b.a.actionSheetStyle, 0); this.f4271 = obtainStyledAttributes.getDrawable(b.C0042b.ActionSheet_otherButtonMiddleBackground); obtainStyledAttributes.recycle(); } return this.f4271; } } /* compiled from: ActionSheet */ public static class c { /* renamed from: ʻ reason: contains not printable characters */ private Context f4281; /* renamed from: ʼ reason: contains not printable characters */ private j f4282; /* renamed from: ʽ reason: contains not printable characters */ private String f4283; /* renamed from: ʾ reason: contains not printable characters */ private String[] f4284; /* renamed from: ʿ reason: contains not printable characters */ private String f4285 = "actionSheet"; /* renamed from: ˆ reason: contains not printable characters */ private boolean f4286; /* renamed from: ˈ reason: contains not printable characters */ private AbstractC0041a f4287; public c(Context context, j jVar) { this.f4281 = context; this.f4282 = jVar; } /* renamed from: ʻ reason: contains not printable characters */ public c m6238(String str) { this.f4283 = str; return this; } /* renamed from: ʻ reason: contains not printable characters */ public c m6236(int i) { return m6238(this.f4281.getString(i)); } /* renamed from: ʻ reason: contains not printable characters */ public c m6240(String... strArr) { this.f4284 = strArr; return this; } /* renamed from: ʻ reason: contains not printable characters */ public c m6237(AbstractC0041a aVar) { this.f4287 = aVar; return this; } /* renamed from: ʻ reason: contains not printable characters */ public c m6239(boolean z) { this.f4286 = z; return this; } /* renamed from: ʻ reason: contains not printable characters */ public Bundle m6235() { Bundle bundle = new Bundle(); bundle.putString("cancel_button_title", this.f4283); bundle.putStringArray("other_button_titles", this.f4284); bundle.putBoolean("cancelable_ontouchoutside", this.f4286); return bundle; } /* renamed from: ʼ reason: contains not printable characters */ public a m6241() { a aVar = (a) Fragment.m1471(this.f4281, a.class.getName(), m6235()); aVar.m6225(this.f4287); aVar.m6224(this.f4282, this.f4285); return aVar; } } }