正在查看: Top浏览器 v4.6.16 应用的 SettingFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Top浏览器 v4.6.16 应用的 SettingFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.pocket.topbrowser.browser.setting;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.activity.OnBackPressedCallback;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModel;
import c.o.a.a;
import c.t.a.d.n;
import c.t.a.w.h0;
import c.t.a.w.j;
import c.t.a.w.p0;
import c.t.a.w.r0;
import c.t.a.x.i.p;
import c.t.c.j.x0;
import com.fm.ui.cell.YaCellView;
import com.fm.ui.toolbar.YaToolbar;
import com.pocket.common.base.BackViewModelFragment;
import com.pocket.common.base.BaseDialogFragment;
import com.pocket.common.base.DataBindingFragment;
import com.pocket.common.base.WebViewActivity;
import com.pocket.common.config.bean.NewVersion;
import com.pocket.common.config.bean.SearchEngine;
import com.pocket.common.dialog.AppUpdatingDialog;
import com.pocket.common.dialog.CustomSearchEngineDialog;
import com.pocket.common.dialog.confirm.ConfirmDialog;
import com.pocket.common.dialog.list.ListSelectDialog;
import com.pocket.common.lifecycle.SingleLiveEvent;
import com.pocket.common.view.GuidanceDialog;
import com.pocket.topbrowser.browser.R$attr;
import com.pocket.topbrowser.browser.R$id;
import com.pocket.topbrowser.browser.R$layout;
import com.pocket.topbrowser.browser.R$string;
import com.pocket.topbrowser.browser.R$style;
import com.pocket.topbrowser.browser.gm.page.JavaScriptFragment;
import com.pocket.topbrowser.browser.setting.SettingFragment;
import d.b.a.b.o;
import h.b0.d.l;
import h.b0.d.m;
import h.u;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
public final class SettingFragment extends BackViewModelFragment {
public SettingViewModel a;
public ListSelectDialog b;
public static final class a extends m implements h.b0.c.a<u> {
public final NewVersion b;
public a(NewVersion newVersion) {
super(0);
this.b = newVersion;
}
public static final void a(NewVersion newVersion, SettingFragment settingFragment, boolean z) {
l.f(newVersion, "$currVersion");
l.f(settingFragment, "this$0");
if (!z) {
c.h.a.e.d.c("拒绝权限无法下载");
return;
}
AppUpdatingDialog.a aVar = AppUpdatingDialog.p;
String download_url = newVersion.getDownload_url();
l.e(download_url, "currVersion.download_url");
aVar.a(download_url).q(settingFragment.getChildFragmentManager());
}
@Override
public u invoke() {
invoke2();
return u.a;
}
public final void invoke2() {
o<Boolean> n = new c.w.a.b((Fragment) SettingFragment.this).n("android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE");
final NewVersion newVersion = this.b;
final SettingFragment settingFragment = SettingFragment.this;
n.L(new d.b.a.e.e() {
@Override
public final void accept(Object obj) {
SettingFragment.a.a(newVersion, settingFragment, ((Boolean) obj).booleanValue());
}
});
}
}
public static final class b extends m implements h.b0.c.a<u> {
public b() {
super(0);
}
@Override
public u invoke() {
invoke2();
return u.a;
}
public final void invoke2() {
c.t.c.j.q1.p.a.a.E();
SettingFragment settingFragment = SettingFragment.this;
settingFragment.showToast(settingFragment.getString(R$string.browser_restored_default_settings));
c.o.a.a.a("night_mode").b(Boolean.FALSE);
p.a().d(false);
SettingFragment.this.finish();
}
}
public static final class c extends m implements h.b0.c.a<u> {
public c() {
super(0);
}
@Override
public u invoke() {
invoke2();
return u.a;
}
public final void invoke2() {
c.t.a.w.m mVar = c.t.a.w.m.a;
FragmentManager parentFragmentManager = SettingFragment.this.getParentFragmentManager();
l.e(parentFragmentManager, "parentFragmentManager");
c.t.a.w.m.b(mVar, parentFragmentManager, "https://www.topc1.com/video", false, false, 12, (Object) null);
}
}
public static final class d extends m implements h.b0.c.a<u> {
public d() {
super(0);
}
@Override
public u invoke() {
invoke2();
return u.a;
}
public final void invoke2() {
c.t.a.w.m mVar = c.t.a.w.m.a;
FragmentManager parentFragmentManager = SettingFragment.this.getParentFragmentManager();
l.e(parentFragmentManager, "parentFragmentManager");
c.t.a.w.m.b(mVar, parentFragmentManager, "https://www.topc1.com/read", false, false, 12, (Object) null);
}
}
public static final class e extends m implements h.b0.c.a<u> {
public e() {
super(0);
}
@Override
public u invoke() {
invoke2();
return u.a;
}
public final void invoke2() {
c.t.a.w.m mVar = c.t.a.w.m.a;
FragmentManager parentFragmentManager = SettingFragment.this.getParentFragmentManager();
l.e(parentFragmentManager, "parentFragmentManager");
c.t.a.w.m.b(mVar, parentFragmentManager, "https://www.topc1.com/comic", false, false, 12, (Object) null);
}
}
public static final class f extends m implements h.b0.c.a<u> {
public f() {
super(0);
}
@Override
public u invoke() {
invoke2();
return u.a;
}
public final void invoke2() {
c.t.a.w.m mVar = c.t.a.w.m.a;
FragmentManager parentFragmentManager = SettingFragment.this.getParentFragmentManager();
l.e(parentFragmentManager, "parentFragmentManager");
c.t.a.w.m.b(mVar, parentFragmentManager, "https://www.topc1.com/subscribe/show", false, false, 12, (Object) null);
}
}
public static final class g extends m implements h.b0.c.a<u> {
public g() {
super(0);
}
public static final void a(SettingFragment settingFragment, Boolean bool) {
l.f(settingFragment, "this$0");
l.e(bool, "it");
if (bool.booleanValue()) {
View view = settingFragment.getView();
((TextView) (view == null ? null : view.findViewById(R$id.tv_logout))).setVisibility(8);
settingFragment.showToast(settingFragment.getString(R$string.browser_logout_success));
c.t.c.n.b.a.e();
c.h.b.c.a.a("logout").h(0);
settingFragment.hideLoadingDialog();
}
}
@Override
public u invoke() {
invoke2();
return u.a;
}
public final void invoke2() {
SettingFragment.this.showLoadingDialog();
c.h.b.b.a.b.d("personal_logout");
SettingViewModel settingViewModel = SettingFragment.this.a;
if (settingViewModel == null) {
l.u("settingViewModel");
settingViewModel = null;
}
SingleLiveEvent<Boolean> o = settingViewModel.o();
final SettingFragment settingFragment = SettingFragment.this;
o.observe(settingFragment, new Observer() {
public final void onChanged(Object obj) {
SettingFragment.g.a(SettingFragment.this, (Boolean) obj);
}
});
}
}
public static final class h extends m implements h.b0.c.l<Integer, u> {
public final List<SearchEngine> a;
public final SettingFragment b;
public static final class a extends m implements h.b0.c.a<u> {
public final int a;
public final SettingFragment b;
public final List<SearchEngine> f1314c;
public a(int i2, SettingFragment settingFragment, List<SearchEngine> list) {
super(0);
this.a = i2;
this.b = settingFragment;
this.f1314c = list;
}
@Override
public u invoke() {
invoke2();
return u.a;
}
public final void invoke2() {
c.t.c.j.q1.p.a.a.c0(this.a);
View view = this.b.getView();
DialogFragment dialogFragment = null;
((YaCellView) (view == null ? null : view.findViewById(R$id.cv_search_engines))).setValueText(this.f1314c.get(this.a).getName());
c.h.b.c.a.a("switch_search_engines").g(0);
c.h.b.i.c.n("switch_search_engine", true);
DialogFragment dialogFragment2 = this.b.b;
if (dialogFragment2 == null) {
l.u("searchEnginesDialog");
} else {
dialogFragment = dialogFragment2;
}
dialogFragment.dismiss();
}
}
public h(List<SearchEngine> list, SettingFragment settingFragment) {
super(1);
this.a = list;
this.b = settingFragment;
}
public final void a(int i2) {
if (i2 == this.a.size() - 1) {
new CustomSearchEngineDialog().w(new a(i2, this.b, this.a)).q(this.b.getChildFragmentManager());
}
}
@Override
public u invoke(Integer num) {
a(num.intValue());
return u.a;
}
}
public static final class i extends m implements h.b0.c.l<Integer, u> {
public final List<SearchEngine> b;
public i(List<SearchEngine> list) {
super(1);
this.b = list;
}
public final void a(int i2) {
c.t.c.j.q1.p.a.a.c0(i2);
View view = SettingFragment.this.getView();
DialogFragment dialogFragment = null;
((YaCellView) (view == null ? null : view.findViewById(R$id.cv_search_engines))).setValueText(this.b.get(i2).getName());
c.h.b.c.a.a("switch_search_engines").g(0);
c.h.b.i.c.n("switch_search_engine", true);
DialogFragment dialogFragment2 = SettingFragment.this.b;
if (dialogFragment2 == null) {
l.u("searchEnginesDialog");
} else {
dialogFragment = dialogFragment2;
}
dialogFragment.dismiss();
}
@Override
public u invoke(Integer num) {
a(num.intValue());
return u.a;
}
}
public static final void J(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
settingFragment.finish();
}
public static final void K(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
settingFragment.f0();
}
public static final void L(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
c.t.a.r.a.c(c.t.a.r.a.a, ((DataBindingFragment) settingFragment).mActivity, (Bundle) null, "/personal/advanced_setting", 0, 10, (Object) null);
}
public static final void M(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
c.t.a.r.a.c(c.t.a.r.a.a, ((DataBindingFragment) settingFragment).mActivity, (Bundle) null, "/personal/privacy_setting", 0, 10, (Object) null);
}
public static final void N(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
c.t.a.w.t0.a.f().c(settingFragment.getParentFragmentManager(), new JavaScriptFragment());
}
public static final void O(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
settingFragment.startActivity(AccountPswActivity.class);
}
public static final void P(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
settingFragment.m();
}
public static final void Q(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
settingFragment.startActivity(ClearDataActivity.class);
}
public static final void R(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
new ConfirmDialog.a().v(settingFragment.getString(R$string.browser_restore_default_settings_tips)).m(settingFragment.new b()).a().q(settingFragment.getChildFragmentManager());
}
public static final void S(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
new GuidanceDialog().G(settingFragment.new c()).I(settingFragment.new d()).H(settingFragment.new e()).J(settingFragment.new f()).q(settingFragment.getChildFragmentManager());
}
public static final void T(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
WebViewActivity.q(((DataBindingFragment) settingFragment).mActivity, "https://app.topc1.com/user/register_agreement", "用户协议");
}
public static final void U(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
WebViewActivity.q(((DataBindingFragment) settingFragment).mActivity, j.b().equals("huawei") ? l.m("https://app.topc1.com/user/privacy_agreement", "/huawei") : "https://app.topc1.com/user/privacy_agreement", "隐私政策");
}
public static final void V(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
c.t.a.w.t0.a.f().c(settingFragment.getParentFragmentManager(), new PersonalDressingFragment());
}
public static final void W(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
new ConfirmDialog.a().v(settingFragment.getString(R$string.common_hint)).r(settingFragment.getString(R$string.browser_logout_tips)).m(settingFragment.new g()).a().q(settingFragment.getChildFragmentManager());
}
public static final void X(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
c.t.a.w.t0.a.f().c(settingFragment.getParentFragmentManager(), new AdBlockFragment());
}
public static final void Y(SettingFragment settingFragment, CompoundButton compoundButton, boolean z) {
l.f(settingFragment, "this$0");
c.h.b.i.c.n("open_av_model", z);
if (z) {
settingFragment.showToast("影音模式已开启");
} else {
settingFragment.showToast("影音模式已关闭");
}
}
public static final void Z(SettingFragment settingFragment, CompoundButton compoundButton, boolean z) {
l.f(settingFragment, "this$0");
c.h.b.i.c.n("open_auto_reader", z);
if (z) {
settingFragment.showToast("阅读模式已开启");
} else {
settingFragment.showToast("阅读模式已关闭");
}
}
public static final void a0(SettingFragment settingFragment, CompoundButton compoundButton, boolean z) {
l.f(settingFragment, "this$0");
c.h.b.b.a.b.d("setting_night_mode");
c.h.b.i.c.k("dark_mode", z ? 2 : 1);
if (c.t.a.u.a.a.b()) {
FragmentActivity activity = settingFragment.getActivity();
if (activity != null) {
activity.setTheme(R$style.NightTheme);
}
} else {
FragmentActivity activity2 = settingFragment.getActivity();
if (activity2 != null) {
activity2.setTheme(R$style.DayTheme);
}
}
settingFragment.e0();
c.o.a.a.a("update_theme").b(0);
}
public static final void b0(CompoundButton compoundButton, boolean z) {
c.h.b.b.a.b.d("setting_disable_third_party_jump_prompts");
c.h.b.i.c.n("disable_tp_forward_tips", z);
}
public static final void c0(CompoundButton compoundButton, boolean z) {
c.h.b.b.a.b.d("setting_quick_gestures");
c.h.b.i.c.n("browser_gesture", z);
c.o.a.a.a("browser_gesture").b(Boolean.valueOf(z));
}
public static final void d0(SettingFragment settingFragment, View view) {
l.f(settingFragment, "this$0");
c.t.a.r.a.c(c.t.a.r.a.a, ((DataBindingFragment) settingFragment).mActivity, (Bundle) null, "/personal/general_setting", 0, 10, (Object) null);
}
public final void e0() {
TypedValue typedValue = new TypedValue();
TypedValue typedValue2 = new TypedValue();
TypedValue typedValue3 = new TypedValue();
Resources.Theme theme = requireActivity().getTheme();
theme.resolveAttribute(R$attr.yaBackground, typedValue, true);
theme.resolveAttribute(R$attr.yaTextPrimary, typedValue2, true);
theme.resolveAttribute(R$attr.yaLine, typedValue3, true);
c.t.a.u.a a2 = c.t.a.u.a.a.a();
AppCompatActivity appCompatActivity = ((DataBindingFragment) this).mActivity;
l.e(appCompatActivity, "mActivity");
int b2 = a2.b(appCompatActivity, R$attr.yaItemBackground);
r0 r0Var = r0.a;
int b3 = r0Var.b(typedValue2.resourceId);
View view = getView();
((LinearLayout) (view == null ? null : view.findViewById(R$id.ll_container))).setBackgroundResource(typedValue.resourceId);
View view2 = getView();
((YaToolbar) (view2 == null ? null : view2.findViewById(R$id.toolbar))).setTitleColor(b3);
View view3 = getView();
((YaToolbar) (view3 == null ? null : view3.findViewById(R$id.toolbar))).setNavIconColor(b3);
View view4 = getView();
((YaToolbar) (view4 == null ? null : view4.findViewById(R$id.toolbar))).setLineColor(r0Var.b(typedValue3.resourceId));
View view5 = getView();
((YaCellView) (view5 == null ? null : view5.findViewById(R$id.cv_general_settings))).setTitleTextColor(b3);
View view6 = getView();
((YaCellView) (view6 == null ? null : view6.findViewById(R$id.cv_search_engines))).setTitleTextColor(b3);
View view7 = getView();
((YaCellView) (view7 == null ? null : view7.findViewById(R$id.cv_personal_dressing))).setTitleTextColor(b3);
View view8 = getView();
((YaCellView) (view8 == null ? null : view8.findViewById(R$id.cv_ad_block))).setTitleTextColor(b3);
View view9 = getView();
((YaCellView) (view9 == null ? null : view9.findViewById(R$id.cv_av_mode))).setTitleTextColor(b3);
View view10 = getView();
((YaCellView) (view10 == null ? null : view10.findViewById(R$id.cv_read_mode))).setTitleTextColor(b3);
View view11 = getView();
((YaCellView) (view11 == null ? null : view11.findViewById(R$id.cv_browser_gesture))).setTitleTextColor(b3);
View view12 = getView();
((YaCellView) (view12 == null ? null : view12.findViewById(R$id.cv_disable_tp_forward_tips))).setTitleTextColor(b3);
View view13 = getView();
((YaCellView) (view13 == null ? null : view13.findViewById(R$id.cv_script_manage))).setTitleTextColor(b3);
View view14 = getView();
((YaCellView) (view14 == null ? null : view14.findViewById(R$id.cv_remember_psw))).setTitleTextColor(b3);
View view15 = getView();
((YaCellView) (view15 == null ? null : view15.findViewById(R$id.cv_dark_mode))).setTitleTextColor(b3);
View view16 = getView();
((YaCellView) (view16 == null ? null : view16.findViewById(R$id.cv_advanced_setting))).setTitleTextColor(b3);
View view17 = getView();
((YaCellView) (view17 == null ? null : view17.findViewById(R$id.cv_privacy_settings))).setTitleTextColor(b3);
View view18 = getView();
((YaCellView) (view18 == null ? null : view18.findViewById(R$id.cv_check_update))).setTitleTextColor(b3);
View view19 = getView();
((YaCellView) (view19 == null ? null : view19.findViewById(R$id.cv_user_guidance))).setTitleTextColor(b3);
View view20 = getView();
((YaCellView) (view20 == null ? null : view20.findViewById(R$id.cv_user_agreement))).setTitleTextColor(b3);
View view21 = getView();
((YaCellView) (view21 == null ? null : view21.findViewById(R$id.cv_privacy_policy))).setTitleTextColor(b3);
View view22 = getView();
((YaCellView) (view22 == null ? null : view22.findViewById(R$id.cv_clear_data))).setTitleTextColor(b3);
View view23 = getView();
((YaCellView) (view23 == null ? null : view23.findViewById(R$id.cv_restore_default_settings))).setTitleTextColor(b3);
View view24 = getView();
((YaCellView) (view24 == null ? null : view24.findViewById(R$id.cv_general_settings))).setNextIvColor(b3);
View view25 = getView();
((YaCellView) (view25 == null ? null : view25.findViewById(R$id.cv_search_engines))).setNextIvColor(b3);
View view26 = getView();
((YaCellView) (view26 == null ? null : view26.findViewById(R$id.cv_ad_block))).setNextIvColor(b3);
View view27 = getView();
((YaCellView) (view27 == null ? null : view27.findViewById(R$id.cv_script_manage))).setNextIvColor(b3);
View view28 = getView();
((YaCellView) (view28 == null ? null : view28.findViewById(R$id.cv_remember_psw))).setNextIvColor(b3);
View view29 = getView();
((YaCellView) (view29 == null ? null : view29.findViewById(R$id.cv_dark_mode))).setNextIvColor(b3);
View view30 = getView();
((YaCellView) (view30 == null ? null : view30.findViewById(R$id.cv_advanced_setting))).setNextIvColor(b3);
View view31 = getView();
((YaCellView) (view31 == null ? null : view31.findViewById(R$id.cv_privacy_settings))).setNextIvColor(b3);
View view32 = getView();
((YaCellView) (view32 == null ? null : view32.findViewById(R$id.cv_check_update))).setNextIvColor(b3);
View view33 = getView();
((YaCellView) (view33 == null ? null : view33.findViewById(R$id.cv_user_guidance))).setNextIvColor(b3);
View view34 = getView();
((YaCellView) (view34 == null ? null : view34.findViewById(R$id.cv_user_agreement))).setNextIvColor(b3);
View view35 = getView();
((YaCellView) (view35 == null ? null : view35.findViewById(R$id.cv_user_feedback))).setNextIvColor(b3);
View view36 = getView();
((YaCellView) (view36 == null ? null : view36.findViewById(R$id.cv_privacy_policy))).setNextIvColor(b3);
View view37 = getView();
((YaCellView) (view37 == null ? null : view37.findViewById(R$id.cv_clear_data))).setNextIvColor(b3);
View view38 = getView();
((YaCellView) (view38 == null ? null : view38.findViewById(R$id.cv_restore_default_settings))).setNextIvColor(b3);
View view39 = getView();
((YaCellView) (view39 == null ? null : view39.findViewById(R$id.cv_general_settings))).setBackgroundResource(b2);
View view40 = getView();
((YaCellView) (view40 == null ? null : view40.findViewById(R$id.cv_search_engines))).setBackgroundResource(b2);
View view41 = getView();
((YaCellView) (view41 == null ? null : view41.findViewById(R$id.cv_personal_dressing))).setBackgroundResource(b2);
View view42 = getView();
((YaCellView) (view42 == null ? null : view42.findViewById(R$id.cv_ad_block))).setBackgroundResource(b2);
View view43 = getView();
((YaCellView) (view43 == null ? null : view43.findViewById(R$id.cv_script_manage))).setBackgroundResource(b2);
View view44 = getView();
((YaCellView) (view44 == null ? null : view44.findViewById(R$id.cv_remember_psw))).setBackgroundResource(b2);
View view45 = getView();
((YaCellView) (view45 == null ? null : view45.findViewById(R$id.cv_dark_mode))).setBackgroundResource(b2);
View view46 = getView();
((YaCellView) (view46 == null ? null : view46.findViewById(R$id.cv_advanced_setting))).setBackgroundResource(b2);
View view47 = getView();
((YaCellView) (view47 == null ? null : view47.findViewById(R$id.cv_privacy_settings))).setBackgroundResource(b2);
View view48 = getView();
((YaCellView) (view48 == null ? null : view48.findViewById(R$id.cv_check_update))).setBackgroundResource(b2);
View view49 = getView();
((YaCellView) (view49 == null ? null : view49.findViewById(R$id.cv_user_guidance))).setBackgroundResource(b2);
View view50 = getView();
((YaCellView) (view50 == null ? null : view50.findViewById(R$id.cv_user_agreement))).setBackgroundResource(b2);
View view51 = getView();
((YaCellView) (view51 == null ? null : view51.findViewById(R$id.cv_user_feedback))).setBackgroundResource(b2);
View view52 = getView();
((YaCellView) (view52 == null ? null : view52.findViewById(R$id.cv_privacy_policy))).setBackgroundResource(b2);
View view53 = getView();
((YaCellView) (view53 == null ? null : view53.findViewById(R$id.cv_clear_data))).setBackgroundResource(b2);
View view54 = getView();
((YaCellView) (view54 == null ? null : view54.findViewById(R$id.cv_restore_default_settings))).setBackgroundResource(b2);
View view55 = getView();
((TextView) (view55 == null ? null : view55.findViewById(R$id.tv_logout))).setBackgroundResource(b2);
View view56 = getView();
(view56 == null ? null : view56.findViewById(R$id.v1)).setBackgroundResource(typedValue3.resourceId);
View view57 = getView();
(view57 == null ? null : view57.findViewById(R$id.v2)).setBackgroundResource(typedValue3.resourceId);
View view58 = getView();
(view58 == null ? null : view58.findViewById(R$id.v3)).setBackgroundResource(typedValue3.resourceId);
View view59 = getView();
(view59 == null ? null : view59.findViewById(R$id.v4)).setBackgroundResource(typedValue3.resourceId);
View view60 = getView();
(view60 == null ? null : view60.findViewById(R$id.v5)).setBackgroundResource(typedValue3.resourceId);
View view61 = getView();
(view61 == null ? null : view61.findViewById(R$id.v6)).setBackgroundResource(typedValue3.resourceId);
View view62 = getView();
(view62 == null ? null : view62.findViewById(R$id.v7)).setBackgroundResource(typedValue3.resourceId);
View view63 = getView();
((TextView) (view63 != null ? view63.findViewById(R$id.tv_icp) : null)).setBackgroundResource(typedValue3.resourceId);
}
public final void f0() {
List b2 = h0.a().b();
l.e(b2, "searchEngineList");
ArrayList arrayList = new ArrayList(h.w.l.q(b2, 10));
Iterator it2 = b2.iterator();
while (it2.hasNext()) {
arrayList.add(((SearchEngine) it2.next()).getName());
}
Object[] array = arrayList.toArray(new String[0]);
Objects.requireNonNull(array, "null cannot be cast to non-null type kotlin.Array<T>");
ListSelectDialog.a aVar = new ListSelectDialog.a();
for (String str : (String[]) array) {
l.e(str, "it");
aVar.a(str);
}
BaseDialogFragment b3 = aVar.q(getString(R$string.browser_search_engines)).m(c.t.c.j.q1.p.a.a.y()).o(new h(b2, this)).k(new i(b2)).b();
this.b = b3;
if (b3 == null) {
l.u("searchEnginesDialog");
b3 = null;
}
b3.q(getChildFragmentManager());
}
public n getDataBindingConfig() {
int i2 = R$layout.browser_setting_fragment;
int i3 = x0.f126c;
ViewModel viewModel = this.a;
if (viewModel == null) {
l.u("settingViewModel");
viewModel = null;
}
return new n(i2, i3, viewModel);
}
public OnBackPressedCallback getOnBackPressedCallback() {
return new OnBackPressedCallback() {
{
super(true);
}
public void handleOnBackPressed() {
SettingFragment.this.finish();
a.a("web_view_resume").b(0);
}
};
}
public void handleHttpError(c.t.a.m.b bVar) {
super/*com.pocket.common.base.BaseViewModelFragment*/.handleHttpError(bVar);
hideLoadingDialog();
}
public void initViewModel() {
SettingViewModel activityScopeViewModel = getActivityScopeViewModel(SettingViewModel.class);
l.e(activityScopeViewModel, "getActivityScopeViewMode…ingViewModel::class.java)");
this.a = activityScopeViewModel;
}
public final void m() {
NewVersion newVersion = (NewVersion) c.h.b.f.f.b.a().h("app", "curr_version", NewVersion.class);
if (newVersion == null) {
return;
}
if (j.e() >= newVersion.getVersion_code()) {
showToast(getString(R$string.browser_curr_last_version));
} else {
if (TextUtils.isEmpty(newVersion.getDownload_url())) {
return;
}
new ConfirmDialog.a().s(true).v("版本更新").r(newVersion.getUpdate_content()).n("更新").m(new a(newVersion)).a().q(getChildFragmentManager());
}
}
public final void n() {
View view = getView();
((YaCellView) (view == null ? null : view.findViewById(R$id.cv_check_update))).setValueText(l.m("V", j.f()));
List b2 = h0.a().b();
int size = b2.size();
c.t.c.j.q1.p.a aVar = c.t.c.j.q1.p.a.a;
if (size > aVar.y()) {
View view2 = getView();
((YaCellView) (view2 != null ? view2.findViewById(R$id.cv_search_engines) : null)).setValueText(((SearchEngine) b2.get(aVar.y())).getName());
}
}
public void onViewCreated(View view, Bundle bundle) {
l.f(view, "view");
super.onViewCreated(view, bundle);
View view2 = getView();
p0.c(view2 == null ? null : view2.findViewById(R$id.toolbar));
View view3 = getView();
((YaToolbar) (view3 == null ? null : view3.findViewById(R$id.toolbar))).setNavImgListener(new View.OnClickListener() {
@Override
public final void onClick(View view4) {
SettingFragment.J(SettingFragment.this, view4);
}
});
View view4 = getView();
((YaCellView) (view4 == null ? null : view4.findViewById(R$id.cv_search_engines))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view5) {
SettingFragment.K(SettingFragment.this, view5);
}
});
View view5 = getView();
((YaCellView) (view5 == null ? null : view5.findViewById(R$id.cv_personal_dressing))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view6) {
SettingFragment.V(SettingFragment.this, view6);
}
});
View view6 = getView();
((YaCellView) (view6 == null ? null : view6.findViewById(R$id.cv_ad_block))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view7) {
SettingFragment.X(SettingFragment.this, view7);
}
});
View view7 = getView();
((YaCellView) (view7 == null ? null : view7.findViewById(R$id.cv_av_mode))).setSwitchChecked(c.h.b.i.c.b("open_av_model", false));
View view8 = getView();
((YaCellView) (view8 == null ? null : view8.findViewById(R$id.cv_av_mode))).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
SettingFragment.Y(SettingFragment.this, compoundButton, z);
}
});
View view9 = getView();
((YaCellView) (view9 == null ? null : view9.findViewById(R$id.cv_read_mode))).setSwitchChecked(c.h.b.i.c.b("open_auto_reader", true));
View view10 = getView();
((YaCellView) (view10 == null ? null : view10.findViewById(R$id.cv_read_mode))).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
SettingFragment.Z(SettingFragment.this, compoundButton, z);
}
});
View view11 = getView();
((YaCellView) (view11 == null ? null : view11.findViewById(R$id.cv_dark_mode))).setSwitchChecked(c.h.b.i.c.d("dark_mode") == 2);
View view12 = getView();
((YaCellView) (view12 == null ? null : view12.findViewById(R$id.cv_dark_mode))).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
SettingFragment.a0(SettingFragment.this, compoundButton, z);
}
});
View view13 = getView();
((YaCellView) (view13 == null ? null : view13.findViewById(R$id.cv_disable_tp_forward_tips))).setSwitchChecked(c.h.b.i.c.b("disable_tp_forward_tips", false));
View view14 = getView();
((YaCellView) (view14 == null ? null : view14.findViewById(R$id.cv_disable_tp_forward_tips))).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
SettingFragment.b0(compoundButton, z);
}
});
View view15 = getView();
((YaCellView) (view15 == null ? null : view15.findViewById(R$id.cv_browser_gesture))).setSwitchChecked(c.h.b.i.c.b("browser_gesture", true));
View view16 = getView();
((YaCellView) (view16 == null ? null : view16.findViewById(R$id.cv_browser_gesture))).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
SettingFragment.c0(compoundButton, z);
}
});
View view17 = getView();
((YaCellView) (view17 == null ? null : view17.findViewById(R$id.cv_general_settings))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view18) {
SettingFragment.d0(SettingFragment.this, view18);
}
});
View view18 = getView();
((YaCellView) (view18 == null ? null : view18.findViewById(R$id.cv_advanced_setting))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view19) {
SettingFragment.L(SettingFragment.this, view19);
}
});
View view19 = getView();
((YaCellView) (view19 == null ? null : view19.findViewById(R$id.cv_privacy_settings))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view20) {
SettingFragment.M(SettingFragment.this, view20);
}
});
View view20 = getView();
((YaCellView) (view20 == null ? null : view20.findViewById(R$id.cv_script_manage))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view21) {
SettingFragment.N(SettingFragment.this, view21);
}
});
View view21 = getView();
((YaCellView) (view21 == null ? null : view21.findViewById(R$id.cv_remember_psw))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view22) {
SettingFragment.O(SettingFragment.this, view22);
}
});
View view22 = getView();
((YaCellView) (view22 == null ? null : view22.findViewById(R$id.cv_check_update))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view23) {
SettingFragment.P(SettingFragment.this, view23);
}
});
View view23 = getView();
((YaCellView) (view23 == null ? null : view23.findViewById(R$id.cv_clear_data))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view24) {
SettingFragment.Q(SettingFragment.this, view24);
}
});
View view24 = getView();
((YaCellView) (view24 == null ? null : view24.findViewById(R$id.cv_restore_default_settings))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view25) {
SettingFragment.R(SettingFragment.this, view25);
}
});
View view25 = getView();
((YaCellView) (view25 == null ? null : view25.findViewById(R$id.cv_user_guidance))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view26) {
SettingFragment.S(SettingFragment.this, view26);
}
});
View view26 = getView();
((YaCellView) (view26 == null ? null : view26.findViewById(R$id.cv_user_agreement))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view27) {
SettingFragment.T(SettingFragment.this, view27);
}
});
View view27 = getView();
((YaCellView) (view27 == null ? null : view27.findViewById(R$id.cv_privacy_policy))).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view28) {
SettingFragment.U(SettingFragment.this, view28);
}
});
View view28 = getView();
((TextView) (view28 == null ? null : view28.findViewById(R$id.tv_logout))).setVisibility(c.t.c.n.b.a.c() ? 0 : 8);
View view29 = getView();
((TextView) (view29 != null ? view29.findViewById(R$id.tv_logout) : null)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view30) {
SettingFragment.W(SettingFragment.this, view30);
}
});
n();
}
}