正在查看: Mint v5.7.3 应用的 ResetPasswordActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Mint v5.7.3 应用的 ResetPasswordActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.htmedia.mint.ui.activity;
import android.R;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.databinding.DataBindingUtil;
import com.google.android.material.textfield.TextInputLayout;
import com.google.gson.Gson;
import com.htmedia.mint.AppController;
import com.htmedia.mint.htsubscription.CheckSubscriptionFromLocal;
import com.htmedia.mint.pojo.SocialResponsePojo;
import com.htmedia.mint.pojo.config.SSO;
import com.htmedia.mint.ui.activity.ResetPasswordActivity;
import com.htmedia.mint.utils.q;
import com.htmedia.sso.fragments.CountriesDialogFragment;
import com.htmedia.sso.fragments.NewValidateOTPFragment;
import com.htmedia.sso.fragments.ResetPasswordFragment;
import com.htmedia.sso.helpers.EmailOrMobileLayoutHandler;
import com.htmedia.sso.helpers.ToastHelper;
import com.htmedia.sso.helpers.Utils;
import com.htmedia.sso.helpers.WebEngageNewSSOEvents;
import com.htmedia.sso.models.CountryModel;
import com.htmedia.sso.models.EmailOrMobileModel;
import com.htmedia.sso.models.LinkUserResponseModel;
import com.thoughtbot.expandablerecyclerview.BuildConfig;
import java.util.HashMap;
import org.json.JSONException;
import org.json.JSONObject;
import x4.q20;
public class ResetPasswordActivity extends com.htmedia.mint.ui.activity.a implements k6.x1, View.OnClickListener, TextView.OnEditorActionListener, CountriesDialogFragment.CountriesDialogListener {
private q20 a;
private String b = BuildConfig.FLAVOR;
private HashMap<String, String> c;
private SSO d;
private q.g e;
class a implements View.OnClickListener {
a() {
}
@Override
public void onClick(View view) {
ResetPasswordActivity.this.finish();
}
}
class b implements TextWatcher {
b() {
}
public void b() {
ResetPasswordActivity.this.a.i.getRoot().findViewById(2131428336).setSelection(ResetPasswordActivity.this.a.i.getRoot().findViewById(2131428336).getText().length());
}
@Override
public void afterTextChanged(Editable editable) {
if (editable.length() == 0) {
ResetPasswordActivity.this.a.getEmailOrMobileModel().setEmailOrMobile(BuildConfig.FLAVOR);
} else if (!Utils.isNumeric(editable.toString()) || editable.toString().length() <= 14) {
ResetPasswordActivity.this.a.getEmailOrMobileModel().setEmailOrMobile(editable.toString());
} else {
ResetPasswordActivity.this.a.i.getRoot().findViewById(2131428336).setText(ResetPasswordActivity.this.a.getEmailOrMobileModel().getEmailOrMobile());
ResetPasswordActivity.this.a.i.getRoot().findViewById(2131428336).post(new Runnable() {
@Override
public final void run() {
ResetPasswordActivity.b.this.b();
}
});
}
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
}
class c implements RadioGroup.OnCheckedChangeListener {
c() {
}
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
if (ResetPasswordActivity.this.a.E.isChecked()) {
ResetPasswordActivity.this.a.E.setTextColor(ResetPasswordActivity.this.getResources().getColor(2131100598));
ResetPasswordActivity.this.a.D.setTextColor(ResetPasswordActivity.this.getResources().getColor(2131100145));
ResetPasswordActivity.this.a.F.setTextColor(ResetPasswordActivity.this.getResources().getColor(2131100145));
}
if (ResetPasswordActivity.this.a.D.isChecked()) {
ResetPasswordActivity.this.a.E.setTextColor(ResetPasswordActivity.this.getResources().getColor(2131100145));
ResetPasswordActivity.this.a.D.setTextColor(ResetPasswordActivity.this.getResources().getColor(2131100598));
ResetPasswordActivity.this.a.F.setTextColor(ResetPasswordActivity.this.getResources().getColor(2131100145));
}
if (ResetPasswordActivity.this.a.F.isChecked()) {
ResetPasswordActivity.this.a.E.setTextColor(ResetPasswordActivity.this.getResources().getColor(2131100145));
ResetPasswordActivity.this.a.D.setTextColor(ResetPasswordActivity.this.getResources().getColor(2131100145));
ResetPasswordActivity.this.a.F.setTextColor(ResetPasswordActivity.this.getResources().getColor(2131100598));
}
}
}
static class d {
static final int[] a;
static {
int[] iArr = new int[q.g.values().length];
a = iArr;
try {
iArr[q.g.NAME.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[q.g.EMAIL.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[q.g.PHONE.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[q.g.GENDER.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[q.g.PASSWORD.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
}
}
private void L() {
this.a.H.setVisibility(8);
this.a.y.setVisibility(8);
this.a.z.setVisibility(8);
this.a.A.setVisibility(8);
this.a.x.setVisibility(8);
}
private void M() {
Bundle extras = getIntent().getExtras();
if (extras == null || !extras.containsKey("Caption")) {
L();
return;
}
q.g gVar = q.g.values()[extras.getInt("Caption")];
this.e = gVar;
this.a.H.setText(gVar.a());
N(this.e);
if (extras.containsKey("value")) {
String string = extras.getString("value");
if (!TextUtils.isEmpty(string)) {
U(this.e, string);
} else if (this.e == q.g.PHONE) {
this.a.H.setText("Add your Contact Number");
}
}
}
private void N(q.g gVar) {
int i = d.a[gVar.ordinal()];
if (i == 1) {
this.a.y.setVisibility(0);
this.a.w.setVisibility(8);
this.a.z.setVisibility(8);
this.a.A.setVisibility(8);
this.a.x.setVisibility(8);
return;
}
if (i == 2) {
this.a.y.setVisibility(8);
this.a.w.setVisibility(0);
this.a.z.setVisibility(8);
this.a.A.setVisibility(8);
this.a.x.setVisibility(8);
return;
}
if (i == 3) {
this.a.y.setVisibility(8);
this.a.w.setVisibility(8);
this.a.z.setVisibility(0);
this.a.u.setVisibility(8);
this.a.A.setVisibility(8);
this.a.x.setVisibility(8);
f0();
return;
}
if (i == 4) {
this.a.y.setVisibility(8);
this.a.w.setVisibility(8);
this.a.z.setVisibility(8);
this.a.A.setVisibility(8);
this.a.x.setVisibility(0);
return;
}
if (i != 5) {
this.a.y.setVisibility(8);
this.a.w.setVisibility(8);
this.a.z.setVisibility(8);
this.a.A.setVisibility(8);
this.a.x.setVisibility(8);
return;
}
this.a.y.setVisibility(8);
this.a.w.setVisibility(8);
this.a.z.setVisibility(8);
this.a.A.setVisibility(8);
this.a.x.setVisibility(8);
getSupportFragmentManager().beginTransaction().add(2131429738, new ResetPasswordFragment(), ResetPasswordFragment.class.getSimpleName()).commitAllowingStateLoss();
}
private void O(q.g gVar) {
if (this.a.e.getText().toString().trim().length() == 0) {
Toast.makeText((Context) this, (CharSequence) "Please enter email", 0).show();
return;
}
if (!Utils.isValidEmail(this.a.e.getText().toString().trim())) {
Toast.makeText((Context) this, (CharSequence) "Please enter a valid email", 1).show();
return;
}
EmailOrMobileModel emailOrMobileModel = new EmailOrMobileModel();
emailOrMobileModel.setSelectedCountry(new CountryModel("India", "IN", "+91"));
emailOrMobileModel.setEmailOrMobile(this.a.e.getText().toString().trim());
this.a.setEmailOrMobileModel(emailOrMobileModel);
a0(this.a.e.getText().toString().trim());
}
private void P(q.g gVar) {
b0(gVar);
}
private void Q(q.g gVar) {
if (this.a.f.getText().toString().trim().length() < 3) {
Toast.makeText((Context) this, (CharSequence) "Minimum name field length should be of 3 characters", 0).show();
} else if (new com.htmedia.mint.utils.u1(0).a(this.a.f.getText().toString())) {
b0(gVar);
} else {
Toast.makeText((Context) this, (CharSequence) "Name field can't have special characters or numbers", 1).show();
}
}
private void R() {
if (this.a.d.getText().toString().trim().length() < 1) {
Toast.makeText((Context) this, (CharSequence) "Please enter current password", 0).show();
return;
}
if (this.a.g.getText().toString().trim().length() < 6) {
Toast.makeText((Context) this, (CharSequence) "The new password should be between 6-14 characters. Special characters allowed are !@#$%&*_", 0).show();
return;
}
if (this.a.c.getText().toString().trim().length() < 6) {
Toast.makeText((Context) this, (CharSequence) "Please enter valid confirm password", 0).show();
return;
}
if (!new com.htmedia.mint.utils.z1().a(this.a.g.getText().toString())) {
Toast.makeText((Context) this, (CharSequence) "The new password should be between 6-14 characters. Special characters allowed are !@#$%&*_", 1).show();
} else if (this.a.g.getText().toString().equals(this.a.c.getText().toString())) {
c0(this.a.d.getText().toString(), this.a.g.getText().toString().trim(), this.a.c.getText().toString().trim());
} else {
Toast.makeText((Context) this, (CharSequence) "Confirm password should be same as new password", 0).show();
}
}
private void S(q.g gVar) {
if (!this.a.getEmailOrMobileModel().isEmailOrMobileValid()) {
this.a.getEmailOrMobileModel().setShowError(true);
} else {
this.a.getEmailOrMobileModel().setShowError(false);
a0(this.a.getEmailOrMobileModel().getUnformattedMobile());
}
}
private void T() {
ColorStateList colorStateList = new ColorStateList(new int[][]{new int[]{-16842912}, new int[]{R.attr.state_checked}}, new int[]{-1, -1});
this.a.E.setButtonTintList(colorStateList);
this.a.E.setTextColor(getResources().getColor(2131101002));
this.a.E.invalidate();
this.a.D.setButtonTintList(colorStateList);
this.a.D.setTextColor(getResources().getColor(2131101002));
this.a.D.invalidate();
this.a.F.setButtonTintList(colorStateList);
this.a.F.setTextColor(getResources().getColor(2131101002));
this.a.F.invalidate();
}
private void U(q.g gVar, String str) {
int i = d.a[gVar.ordinal()];
if (i == 1) {
this.a.f.setText(str);
return;
}
if (i == 2) {
this.a.e.setText(str);
return;
}
if (i == 3) {
this.a.h.setText(str);
} else if (i == 4 && !TextUtils.isEmpty(str)) {
V(str);
}
}
private void V(String str) {
if (str.equalsIgnoreCase(q.j.MALE.a())) {
this.a.E.setChecked(true);
this.a.D.setChecked(false);
this.a.F.setChecked(false);
} else if (str.equalsIgnoreCase(q.j.FEMALE.a())) {
this.a.E.setChecked(false);
this.a.D.setChecked(true);
this.a.F.setChecked(false);
} else if (str.equalsIgnoreCase(q.j.PREFER_NOT_TO_SAY.a())) {
this.a.E.setChecked(false);
this.a.D.setChecked(false);
this.a.F.setChecked(true);
} else {
this.a.E.setChecked(false);
this.a.D.setChecked(false);
this.a.F.setChecked(true);
}
}
public void X(View view, boolean z) {
if (z) {
this.a.i.getRoot().findViewById(2131428337).setBackground(ContextCompat.getDrawable(this, 2131231519));
this.a.i.getRoot().findViewById(2131428139).setBackgroundColor(ContextCompat.getColor(this, 2131099986));
this.a.getEmailOrMobileModel().setShowError(false);
}
}
public void Y() {
if (AppController.j().E()) {
this.a.i.getRoot().findViewById(2131428337).setBackground(ContextCompat.getDrawable(this, 2131231534));
this.a.i.getRoot().findViewById(2131428139).setBackgroundColor(ContextCompat.getColor(this, 2131100829));
} else {
this.a.i.getRoot().findViewById(2131428337).setBackground(ContextCompat.getDrawable(this, 2131231530));
this.a.i.getRoot().findViewById(2131428139).setBackgroundColor(ContextCompat.getColor(this, 2131100828));
}
}
private void Z() {
ColorStateList colorStateList = new ColorStateList(new int[][]{new int[]{-16842912}, new int[]{R.attr.state_checked}}, new int[]{Color.parseColor("#757575"), -16777216});
if (this.a.E.isChecked()) {
this.a.E.setTextColor(getResources().getColor(2131100598));
this.a.D.setTextColor(getResources().getColor(2131100145));
this.a.F.setTextColor(getResources().getColor(2131100145));
}
if (this.a.D.isChecked()) {
this.a.E.setTextColor(getResources().getColor(2131100145));
this.a.D.setTextColor(getResources().getColor(2131100598));
this.a.F.setTextColor(getResources().getColor(2131100145));
}
if (this.a.F.isChecked()) {
this.a.E.setTextColor(getResources().getColor(2131100145));
this.a.D.setTextColor(getResources().getColor(2131100145));
this.a.F.setTextColor(getResources().getColor(2131100598));
}
this.a.E.setButtonTintList(colorStateList);
this.a.E.invalidate();
this.a.D.setButtonTintList(colorStateList);
this.a.D.invalidate();
this.a.F.setButtonTintList(colorStateList);
this.a.F.invalidate();
this.a.j.setOnCheckedChangeListener(new c());
}
private void checkNightMode() {
if (!AppController.j().E()) {
this.a.B.setBackgroundColor(ContextCompat.getColor(this, 2131101002));
this.a.H.setTextColor(ContextCompat.getColor(this, 2131100598));
this.a.d.setTextColor(ContextCompat.getColor(this, 2131100598));
this.a.c.setTextColor(ContextCompat.getColor(this, 2131100598));
this.a.g.setTextColor(ContextCompat.getColor(this, 2131100598));
this.a.a.setBackground(ContextCompat.getDrawable(this, 2131234079));
this.a.I.setBackgroundColor(ContextCompat.getColor(this, 2131100213));
e0(this.a.d, ContextCompat.getColor(this, 2131100144));
e0(this.a.c, ContextCompat.getColor(this, 2131100144));
e0(this.a.g, ContextCompat.getColor(this, 2131100144));
d0(this.a.q, ContextCompat.getColor(this, 2131100144), ContextCompat.getColor(this, 2131100144));
d0(this.a.p, ContextCompat.getColor(this, 2131100144), ContextCompat.getColor(this, 2131100144));
d0(this.a.t, ContextCompat.getColor(this, 2131100144), ContextCompat.getColor(this, 2131100144));
this.a.q.setPasswordVisibilityToggleDrawable(ContextCompat.getDrawable(this, 2131234189));
this.a.f.setTextColor(ContextCompat.getColor(this, 2131100598));
e0(this.a.f, ContextCompat.getColor(this, 2131100144));
d0(this.a.s, ContextCompat.getColor(this, 2131100144), ContextCompat.getColor(this, 2131100144));
this.a.e.setTextColor(ContextCompat.getColor(this, 2131100598));
e0(this.a.e, ContextCompat.getColor(this, 2131100144));
d0(this.a.r, ContextCompat.getColor(this, 2131100144), ContextCompat.getColor(this, 2131100144));
this.a.h.setTextColor(ContextCompat.getColor(this, 2131100598));
e0(this.a.h, ContextCompat.getColor(this, 2131100144));
d0(this.a.u, ContextCompat.getColor(this, 2131100144), ContextCompat.getColor(this, 2131100144));
Z();
return;
}
this.a.B.setBackgroundColor(ContextCompat.getColor(this, 2131100598));
this.a.H.setTextColor(ContextCompat.getColor(this, 2131100599));
this.a.d.setTextColor(ContextCompat.getColor(this, 2131101002));
this.a.c.setTextColor(ContextCompat.getColor(this, 2131101002));
this.a.g.setTextColor(ContextCompat.getColor(this, 2131101002));
this.a.d.setTextColor(ContextCompat.getColor(this, 2131101002));
this.a.a.setBackground(ContextCompat.getDrawable(this, 2131234078));
this.a.I.setBackgroundColor(ContextCompat.getColor(this, 2131100216));
e0(this.a.d, ContextCompat.getColor(this, 2131101002));
e0(this.a.c, ContextCompat.getColor(this, 2131101002));
e0(this.a.g, ContextCompat.getColor(this, 2131101002));
d0(this.a.q, ContextCompat.getColor(this, 2131101002), ContextCompat.getColor(this, 2131101002));
d0(this.a.p, ContextCompat.getColor(this, 2131101002), ContextCompat.getColor(this, 2131101002));
d0(this.a.t, ContextCompat.getColor(this, 2131101002), ContextCompat.getColor(this, 2131101002));
this.a.q.setPasswordVisibilityToggleDrawable(ContextCompat.getDrawable(this, 2131234190));
this.a.f.setTextColor(ContextCompat.getColor(this, 2131099809));
e0(this.a.f, ContextCompat.getColor(this, 2131099809));
d0(this.a.s, ContextCompat.getColor(this, 2131099809), ContextCompat.getColor(this, 2131099809));
this.a.e.setTextColor(ContextCompat.getColor(this, 2131099809));
e0(this.a.e, ContextCompat.getColor(this, 2131099809));
d0(this.a.r, ContextCompat.getColor(this, 2131099809), ContextCompat.getColor(this, 2131099809));
this.a.h.setTextColor(ContextCompat.getColor(this, 2131099809));
e0(this.a.h, ContextCompat.getColor(this, 2131099809));
d0(this.a.u, ContextCompat.getColor(this, 2131099809), ContextCompat.getColor(this, 2131099809));
this.a.i.getRoot().findViewById(2131428143).setCompoundDrawablesWithIntrinsicBounds((Drawable) null, (Drawable) null, ContextCompat.getDrawable(this, 2131231805), (Drawable) null);
this.a.i.getRoot().findViewById(2131428143).setTextColor(getResources().getColor(2131101002));
this.a.i.getRoot().findViewById(2131428141).setTextColor(getResources().getColor(2131101002));
this.a.i.getRoot().findViewById(2131428338).setTextColor(getResources().getColor(2131100834));
this.a.i.getRoot().findViewById(2131428336).setTextColor(getResources().getColor(2131101002));
T();
}
public static void d0(TextInputLayout textInputLayout, int i, int i2) {
textInputLayout.setDefaultHintTextColor(new ColorStateList(new int[][]{new int[]{R.attr.state_enabled}, new int[]{-16842910}}, new int[]{i, i2}));
}
public static void e0(View view, int i) {
view.getBackground().setTint(i);
}
private void f0() {
EmailOrMobileModel emailOrMobileModel = new EmailOrMobileModel();
emailOrMobileModel.setType(EmailOrMobileModel.FieldType.MOBILE);
emailOrMobileModel.setSelectedCountry(new CountryModel("India", "IN", "+91"));
this.a.setEmailOrMobileModel(emailOrMobileModel);
this.a.c(new EmailOrMobileLayoutHandler());
this.a.i.getRoot().findViewById(2131428338).setText(getString(2131952226));
this.a.i.getRoot().findViewById(2131428336).setOnEditorActionListener(this);
this.a.i.getRoot().findViewById(2131428336).setInputType(2);
this.a.i.getRoot().findViewById(2131428336).addTextChangedListener(new b());
this.a.i.getRoot().findViewById(2131428336).setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public final void onFocusChange(View view, boolean z) {
ResetPasswordActivity.this.X(view, z);
}
});
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
ResetPasswordActivity.this.Y();
}
}, 50L);
}
public String W(String str) {
return str.equalsIgnoreCase("Male") ? "M" : str.equalsIgnoreCase("Female") ? "F" : BuildConfig.FLAVOR;
}
public void a0(String str) {
String str2;
if (Utils.isValidEmail(str)) {
WebEngageNewSSOEvents.trackLinkSubmitted("Link Email Submitted", "Edit Profile", "Edit Profile", str, "LinkEmail");
} else {
WebEngageNewSSOEvents.trackLinkSubmitted("Link Mobile Submitted", "Edit Profile", "Edit Profile", str, "LinkMobile");
}
try {
JSONObject jSONObject = new JSONObject();
if (Utils.isValidEmail(str)) {
str2 = AppController.j().g().getSso().getSsoBaseUrl() + AppController.j().g().getSso().getMobileSSO().getLinkEmailGenerateOtp();
jSONObject.put("email", str);
} else {
str2 = AppController.j().g().getSso().getSsoBaseUrl() + AppController.j().g().getSso().getMobileSSO().getLinkMobileGenerateOtp();
if (str.contains("+")) {
str = str.replaceAll("/+", BuildConfig.FLAVOR);
}
jSONObject.put("cellNumber", str);
}
String str3 = str2;
jSONObject.put("referrer", "LM");
jSONObject.put("otpFor", "AUTHENTICATION");
com.htmedia.mint.utils.o1.a("ResetPasswordActivity", "requestToChangeProfile URL: " + str3);
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("Authorization", com.htmedia.mint.utils.f0.G1(this, "userToken"));
hashMap.put("X-Client", "1004");
hashMap.put("Content-Type", "application/json");
new k6.w1(this, this).a(2, (Utils.isValidEmail(str) ? q.g.EMAIL : q.g.PHONE).a(), str3, jSONObject, hashMap, false, true);
} catch (JSONException e) {
e.printStackTrace();
}
}
public void b0(q.g gVar) {
JSONObject jSONObject = new JSONObject();
try {
int i = d.a[gVar.ordinal()];
if (i == 1) {
jSONObject.put("name", this.a.f.getText().toString().trim());
} else if (i == 2) {
jSONObject.put("email", this.a.e.getText().toString().trim());
} else if (i == 3) {
jSONObject.put("mobileNumber", this.a.h.getText().toString().trim());
} else if (i == 4) {
jSONObject.put("gender", W(((RadioButton) findViewById(this.a.j.getCheckedRadioButtonId())).getText().toString()));
}
com.htmedia.mint.utils.o1.a("ResetPasswordActivity", "requestToChangeProfile URL: " + this.b + this.d.getUpdateUser());
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("Authorization", com.htmedia.mint.utils.f0.G1(this, "userToken"));
hashMap.put("X-Client", "1002");
new k6.w1(this, this).a(2, gVar.a(), this.b + this.d.getUpdateProfile(), jSONObject, hashMap, false, true);
} catch (JSONException e) {
e.printStackTrace();
}
}
public void c0(String str, String str2, String str3) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("oldPassword", str);
jSONObject.put("password", str2);
jSONObject.put("repeatPassword", str3);
com.htmedia.mint.utils.o1.a("ResetPasswordActivity", "requestToResetPassword URL: " + this.b + this.d.getChangePassword());
new k6.w1(this, this).a(2, "v2/changePassword", this.b + this.d.getChangePassword(), jSONObject, this.c, false, true);
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void getResponse(JSONObject jSONObject, String str) {
com.htmedia.mint.utils.o1.a("ResetPasswordActivity", "getResponse: " + jSONObject.toString());
Gson gson = new Gson();
SocialResponsePojo socialResponsePojo = (SocialResponsePojo) gson.fromJson(jSONObject.toString(), SocialResponsePojo.class);
if (str.equalsIgnoreCase("v2/changePassword")) {
if (!socialResponsePojo.isSuccess()) {
Toast.makeText((Context) this, (CharSequence) socialResponsePojo.getMessage().getText(), 0).show();
return;
} else {
Toast.makeText((Context) this, (CharSequence) "Password changed successfully.", 0).show();
finish();
return;
}
}
if (str.equalsIgnoreCase(q.g.NAME.a())) {
if (!socialResponsePojo.isSuccess()) {
Toast.makeText((Context) this, (CharSequence) socialResponsePojo.getMessage().getText(), 0).show();
return;
}
if (TextUtils.isEmpty(socialResponsePojo.getData().getName())) {
socialResponsePojo.getData().setName("User");
}
com.htmedia.mint.utils.f0.W3(this, "userName", socialResponsePojo.getData().getName());
finish();
return;
}
if (!str.equalsIgnoreCase(q.g.EMAIL.a()) && !str.equalsIgnoreCase(q.g.PHONE.a())) {
if (str.equalsIgnoreCase(q.g.GENDER.a())) {
if (!socialResponsePojo.isSuccess()) {
Toast.makeText((Context) this, (CharSequence) socialResponsePojo.getMessage().getText(), 0).show();
return;
} else {
com.htmedia.mint.utils.f0.W3(this, "userGender", socialResponsePojo.getData().getGender());
finish();
return;
}
}
return;
}
LinkUserResponseModel linkUserResponseModel = (LinkUserResponseModel) gson.fromJson(jSONObject.toString(), LinkUserResponseModel.class);
if (!linkUserResponseModel.isSuccess()) {
if (TextUtils.isEmpty(linkUserResponseModel.getMessage().getText())) {
ToastHelper.showToast(this, getString(2131952559));
return;
} else {
ToastHelper.showToast(this, linkUserResponseModel.getMessage().getText());
return;
}
}
if (linkUserResponseModel.getData().isMergeable()) {
getSupportFragmentManager().beginTransaction().add(2131429738, NewValidateOTPFragment.newInstance("MERGING", "Edit Profile", "Edit Profile", this.a.getEmailOrMobileModel()), NewValidateOTPFragment.class.getSimpleName()).addToBackStack(NewValidateOTPFragment.class.getSimpleName()).commitAllowingStateLoss();
} else if (TextUtils.isEmpty(linkUserResponseModel.getData().getText())) {
ToastHelper.showToast(this, getString(2131952559));
} else {
ToastHelper.showToast(this, linkUserResponseModel.getData().getText());
}
}
protected void onActivityResult(int i, int i2, @Nullable Intent intent) {
super/*androidx.fragment.app.FragmentActivity*/.onActivityResult(i, i2, intent);
if (i == 102) {
startActivity(new Intent((Context) this, (Class<?>) HomeActivity.class));
}
}
@Override
public void onClick(View view) {
int id2 = view.getId();
if (id2 == 2131427729) {
finish();
return;
}
if (id2 != 2131427746) {
return;
}
int i = d.a[this.e.ordinal()];
if (i == 1) {
Q(this.e);
return;
}
if (i == 2) {
O(this.e);
return;
}
if (i == 3) {
S(this.e);
} else if (i == 4) {
P(this.e);
} else {
if (i != 5) {
return;
}
R();
}
}
public void onConfigurationChanged(@NonNull Configuration configuration) {
super.onConfigurationChanged(configuration);
AppController.e(getIntent(), this);
}
@Override
public void onCountrySelected(CountryModel countryModel) {
this.a.getEmailOrMobileModel().setSelectedCountry(countryModel);
}
protected void onCreate(@Nullable Bundle bundle) {
super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
this.a = DataBindingUtil.setContentView(this, 2131624656);
Toolbar findViewById = findViewById(2131430942);
findViewById.setContentInsetStartWithNavigation(0);
setSupportActionBar(findViewById);
getSupportActionBar().setDisplayShowTitleEnabled(false);
findViewById.setTitle("Back");
findViewById.setTitleTextColor(ResourcesCompat.getColor(getResources(), 2131100950, (Resources.Theme) null));
findViewById.setNavigationIcon(2131231330);
if (findViewById.getTitle() != null) {
String charSequence = findViewById.getTitle().toString();
for (int i = 0; i < findViewById.getChildCount(); i++) {
AppCompatTextView childAt = findViewById.getChildAt(i);
if ("androidx.appcompat.widget.AppCompatTextView".equals(childAt.getClass().getName())) {
AppCompatTextView appCompatTextView = childAt;
if (appCompatTextView.getText().equals(charSequence)) {
appCompatTextView.setTypeface(ResourcesCompat.getFont(this, 2131296270));
childAt.setOnClickListener(new a());
}
}
}
}
M();
this.b = AppController.j().g().getSso().getSsoBaseUrl();
this.d = AppController.j().g().getSso();
HashMap<String, String> hashMap = new HashMap<>();
this.c = hashMap;
hashMap.put("Authorization", com.htmedia.mint.utils.f0.G1(this, "userToken"));
this.a.a.setOnClickListener(this);
this.a.b.setOnClickListener(this);
this.a.c.setOnEditorActionListener(this);
this.a.f.setOnEditorActionListener(this);
this.a.h.setOnEditorActionListener(this);
this.a.e.setOnEditorActionListener(this);
checkNightMode();
}
protected void onDestroy() {
super.onDestroy();
AppController.j().d();
}
@Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
switch (textView.getId()) {
case 2131428303:
R();
break;
case 2131428307:
O(this.e);
break;
case 2131428311:
Q(this.e);
break;
case 2131428336:
S(this.e);
break;
}
((InputMethodManager) getSystemService("input_method")).hideSoftInputFromWindow(textView.getWindowToken(), 0);
return false;
}
@Override
public void onError(String str, String str2) {
if (TextUtils.isEmpty(str)) {
Toast.makeText((Context) this, (CharSequence) getString(2131952559), 0).show();
return;
}
try {
SocialResponsePojo socialResponsePojo = (SocialResponsePojo) new Gson().fromJson(str, SocialResponsePojo.class);
if (socialResponsePojo.isSuccess()) {
return;
}
Toast.makeText((Context) this, (CharSequence) socialResponsePojo.getMessage().getText(), 0).show();
} catch (Exception e) {
e.printStackTrace();
}
}
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (menuItem.getItemId() != 16908332) {
return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
}
finish();
return true;
}
protected void onResume() {
super/*androidx.fragment.app.FragmentActivity*/.onResume();
if (AppController.j().E()) {
getWindow().setStatusBarColor(-16777216);
getWindow().getDecorView().setSystemUiVisibility(0);
this.a.G.setBackgroundColor(getResources().getColor(2131100008));
this.a.G.setTitleTextColor(ResourcesCompat.getColor(getResources(), 2131101009, (Resources.Theme) null));
this.a.G.setNavigationIcon(2131231333);
} else {
getWindow().setStatusBarColor(-1);
getWindow().getDecorView().setSystemUiVisibility(8192);
this.a.G.setBackgroundColor(getResources().getColor(2131101002));
this.a.G.setTitleTextColor(ResourcesCompat.getColor(getResources(), 2131101008, (Resources.Theme) null));
this.a.G.setNavigationIcon(2131231330);
}
setImageByUrl();
}
public void setImageByUrl() {
try {
com.htmedia.mint.utils.m1.b(this, CheckSubscriptionFromLocal.isSubscribedUser(this), this.a.o, AppController.j() != null ? AppController.j().g() : null);
} catch (Exception unused) {
}
}
}