package com.kwad.components.ct.profile.home; import android.content.Context; import android.content.Intent; import android.os.Bundle; import com.kwad.components.core.j.b; import com.kwad.components.core.n.f; import com.kwad.components.ct.response.kwai.c; import com.kwad.sdk.R; import com.kwad.sdk.api.core.fragment.KsFragment; import com.kwad.sdk.api.proxy.app.BaseFragmentActivity; import java.io.Serializable; public class a extends b { private ProfileHomeParam ayR; private void De() { Intent intent = new Intent(); intent.putExtra("key_shield_state", c.f(this.ayR.mAdTemplate.photoInfo)); getActivity().setResult(-1, intent); } public static void a(Context context, ProfileHomeParam profileHomeParam) { if (profileHomeParam.isValid()) { Intent intent = new Intent(context, BaseFragmentActivity.ProfileHomeActivity.class); intent.addFlags(603979776); intent.putExtra("KEY_PROFILE_HOME_PARAM", profileHomeParam); context.startActivity(intent); } } public static void a(KsFragment ksFragment, int i, ProfileHomeParam profileHomeParam) { if (profileHomeParam.isValid()) { Intent intent = new Intent(ksFragment.getContext(), BaseFragmentActivity.ProfileHomeActivity.class); intent.addFlags(603979776); intent.putExtra("KEY_PROFILE_HOME_PARAM", profileHomeParam); ksFragment.startActivityForResult(intent, 1001); } } public static void init() { com.kwad.sdk.service.a.g(BaseFragmentActivity.ProfileHomeActivity.class, a.class); } private boolean re() { Serializable serializableExtra = getIntent().getSerializableExtra("KEY_PROFILE_HOME_PARAM"); if (serializableExtra instanceof ProfileHomeParam) { this.ayR = (ProfileHomeParam) serializableExtra; } return this.ayR != null; } private void yC() { getSupportFragmentManager().beginTransaction().replace(R.id.ksad_fragment_container, c.a(this.ayR)).commitAllowingStateLoss(); } @Override // com.kwad.components.core.j.b public String getPageName() { return "ProfileHomeActivityImpl"; } @Override // com.kwad.sdk.api.proxy.IActivityProxy, com.kwad.components.core.j.b public void onBackPressed() { De(); super.onBackPressed(); } @Override // com.kwad.sdk.api.proxy.IActivityProxy, com.kwad.components.core.j.b public void onCreate(Bundle bundle) { super.onCreate(bundle); com.kwad.sdk.core.e.b.d("ProfileHomeActivity", "onCreate"); if (!re()) { finish(); return; } getActivity().setTheme(R.style.Theme_AppCompat_Light_NoActionBar); setContentView(R.layout.ksad_activity_profile_home); f.a(getActivity(), 0, false); yC(); } @Override // com.kwad.sdk.api.proxy.IActivityProxy public void onNewIntent(Intent intent) { super.onNewIntent(intent); com.kwad.sdk.core.e.b.d("ProfileHomeActivity", "onNewIntent"); } }