导航菜单

页面标题

页面副标题

OLX India v19.42.007 - ChangePasswordActivity.java 源代码

正在查看: OLX India v19.42.007 应用的 ChangePasswordActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.olxgroup.panamera.app.users.myAccount.activities;

import android.R;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.snackbar.Snackbar;
import com.olxgroup.panamera.app.common.infra.m2;
import com.olxgroup.panamera.app.common.utils.c1;
import com.olxgroup.panamera.app.common.utils.h1;
import com.olxgroup.panamera.app.users.auth.views.AuthenticationTextFieldView;
import com.olxgroup.panamera.domain.users.myaccount.presentation_contract.ChangePasswordContract;
import com.olxgroup.panamera.domain.users.myaccount.presentation_impl.ChangePasswordPresenter;

public class ChangePasswordActivity extends v implements ChangePasswordContract.IView, AuthenticationTextFieldView.a, View.OnClickListener {
    ChangePasswordPresenter i0;
    com.olx.southasia.databinding.k j0;

    class a extends Snackbar.Callback {
        a() {
        }

        public void onDismissed(Snackbar snackbar, int i) {
            ChangePasswordActivity.this.i0.clearSessionAndOpenHome();
        }
    }

    public static Intent o3(ChangePasswordPresenter.Action action) {
        Intent intent = new Intent((Context) m2.b, (Class<?>) ChangePasswordActivity.class);
        intent.putExtra("action", action);
        return intent;
    }

    private void p3(AuthenticationTextFieldView authenticationTextFieldView, int i, boolean z) {
        authenticationTextFieldView.setTitleAndHint(i);
        authenticationTextFieldView.s();
        authenticationTextFieldView.r();
        authenticationTextFieldView.setAuthenticationFieldListener(this);
        if (z) {
            authenticationTextFieldView.n(this.j0.G);
        }
    }

    protected int L2() {
        return com.olx.southasia.k.activity_change_password;
    }

    @Override
    public void finishChangePasswordFlow() {
        setResult(-1);
        finish();
    }

    @Override
    public ChangePasswordPresenter.Action getAction() {
        return getIntent() != null ? (ChangePasswordPresenter.Action) getIntent().getSerializableExtra("action") : ChangePasswordPresenter.Action.CHANGE;
    }

    @Override
    public String getCurrentPassword() {
        return this.j0.C.getText();
    }

    @Override
    public void hideCurrentPasswordView() {
        this.j0.C.setVisibility(8);
    }

    @Override
    public void hideLoading() {
        this.j0.D.setVisibility(8);
    }

    @Override
    public void l() {
        this.i0.validateEmptyFields(this.j0.C.getText(), this.j0.E.getText(), this.j0.F.getText());
    }

    public void onBackPressed() {
        super.onBackPressed();
        this.i0.backButtonClicked();
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == com.olx.southasia.i.change_password_button) {
            J2();
            this.i0.changePasswordClicked(this.j0.C.getText(), this.j0.E.getText(), this.j0.F.getText());
        }
    }

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.j0 = androidx.databinding.g.a((ViewGroup) ((ViewGroup) findViewById(R.id.content)).getChildAt(0));
        this.i0.setView(this);
        this.i0.start();
    }

    @Override
    public void setActionBarTitle(boolean z) {
        if (z) {
            this.j0.H.setTitle(com.olx.southasia.p.change_password_title_bar);
        } else {
            this.j0.H.setTitle(com.olx.southasia.p.create_password_title_bar);
        }
        n3(false);
        getSupportActionBar().A(c1.c(this, com.olx.southasia.g.ic_back_vector, N2()));
    }

    @Override
    public void setUpView() {
        p3(this.j0.C, com.olx.southasia.p.change_password_current_placeholder, false);
        p3(this.j0.E, com.olx.southasia.p.change_password_new_placeholder, true);
        p3(this.j0.F, com.olx.southasia.p.change_password_confirm_placeholder, true);
    }

    @Override
    public void showChangePasswordSuccessMessage() {
        h1.b(findViewById(R.id.content), getString(com.olx.southasia.p.password_changed_msg), 0).addCallback(new a()).show();
    }

    @Override
    public void showConfirmPasswordError(String str) {
        this.j0.F.showError(str);
    }

    @Override
    public void showCurrentPasswordError(String str) {
        this.j0.C.showError(str);
    }

    @Override
    public void showDisableLoginButton() {
        this.j0.A.setOnClickListener(null);
        this.j0.A.setBackgroundResource(com.olx.southasia.g.button_selector_disable);
    }

    @Override
    public void showEnableLoginButton() {
        this.j0.A.setOnClickListener(this);
        this.j0.A.setBackgroundResource(com.olx.southasia.g.button_selector);
    }

    @Override
    public void showGenericError() {
        h1.c(findViewById(R.id.content), com.olx.southasia.p.change_password_feedback_error, 0);
    }

    @Override
    public void showLoading() {
        this.j0.D.setVisibility(0);
    }

    @Override
    public void showNewPasswordError(String str) {
        this.j0.E.showError(str);
    }
}