正在查看: Clash Legends v0.0.1 应用的 CheckoutActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Clash Legends v0.0.1 应用的 CheckoutActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.payu.ui.view.activities;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.IntentFilter;
import android.graphics.Bitmap;
import android.graphics.PorterDuff;
import android.os.Handler;
import android.os.SystemClock;
import android.text.Editable;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.MutableLiveData;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.onesignal.notifications.internal.bundle.impl.NotificationBundleProcessor;
import com.payu.base.listeners.OnFetchImageListener;
import com.payu.base.models.BaseApiLayer;
import com.payu.base.models.CardBinInfo;
import com.payu.base.models.CardScheme;
import com.payu.base.models.CardType;
import com.payu.base.models.ImageParam;
import com.payu.base.models.OrderDetails;
import com.payu.base.models.PayUOfferDetails;
import com.payu.base.models.PayUPaymentParams;
import com.payu.base.models.PaymentOption;
import com.payu.base.models.PaymentType;
import com.payu.base.models.SavedCardOption;
import com.payu.base.models.UPIOption;
import com.payu.base.models.WalletOption;
import com.payu.payuanalytics.analytics.factory.AnalyticsFactory;
import com.payu.payuanalytics.analytics.model.AnalyticsType;
import com.payu.payuanalytics.analytics.model.BaseAnalytics;
import com.payu.payuanalytics.analytics.model.PayUAnalytics;
import com.payu.payuanalytics.analytics.utils.PayUAnalyticsConstant;
import com.payu.ui.R;
import com.payu.ui.SdkUiInitializer;
import com.payu.ui.model.managers.a;
import com.payu.ui.model.widgets.a;
import com.payu.ui.model.widgets.b;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlin.math.MathKt;
import kotlin.text.Regex;
import org.json.JSONObject;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000Þ\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0010\u0007\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\r\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u000e\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u00012\u00020\u00022\u00020\u00032\u00020\u0004B\b¢\u0006\u0005\b \u0001\u0010\u0017J\u0019\u0010\b\u001a\u00020\u00072\b\u0010\u0006\u001a\u0004\u0018\u00010\u0005H\u0014¢\u0006\u0004\b\b\u0010\tJ\u0017\u0010\u000b\u001a\u00020\u00072\u0006\u0010\n\u001a\u00020\u0005H\u0014¢\u0006\u0004\b\u000b\u0010\tJ\u0017\u0010\u000f\u001a\u00020\u000e2\u0006\u0010\r\u001a\u00020\fH\u0016¢\u0006\u0004\b\u000f\u0010\u0010J\u0019\u0010\u0011\u001a\u00020\u000e2\b\u0010\r\u001a\u0004\u0018\u00010\fH\u0016¢\u0006\u0004\b\u0011\u0010\u0010J\u0017\u0010\u0014\u001a\u00020\u000e2\u0006\u0010\u0013\u001a\u00020\u0012H\u0016¢\u0006\u0004\b\u0014\u0010\u0015J\u000f\u0010\u0016\u001a\u00020\u0007H\u0016¢\u0006\u0004\b\u0016\u0010\u0017J\u001f\u0010\u001c\u001a\u00020\u00072\u0006\u0010\u0019\u001a\u00020\u00182\u0006\u0010\u001b\u001a\u00020\u001aH\u0016¢\u0006\u0004\b\u001c\u0010\u001dJ\u000f\u0010\u001c\u001a\u00020\u0007H\u0016¢\u0006\u0004\b\u001c\u0010\u0017J\u0019\u0010\u001f\u001a\u00020\u00072\b\u0010\u001e\u001a\u0004\u0018\u00010\u0018H\u0016¢\u0006\u0004\b\u001f\u0010 J\u000f\u0010!\u001a\u00020\u0007H\u0014¢\u0006\u0004\b!\u0010\u0017J\u000f\u0010\"\u001a\u00020\u0007H\u0014¢\u0006\u0004\b\"\u0010\u0017J!\u0010$\u001a\u00020\u00072\b\u0010\u001e\u001a\u0004\u0018\u00010\u00182\u0006\u0010#\u001a\u00020\u000eH\u0016¢\u0006\u0004\b$\u0010%J\u0017\u0010\u001c\u001a\u00020\u00072\u0006\u0010'\u001a\u00020&H\u0002¢\u0006\u0004\b\u001c\u0010(J\u000f\u0010)\u001a\u00020\u0007H\u0002¢\u0006\u0004\b)\u0010\u0017J\u001f\u0010\u001c\u001a\u00020\u00072\u0006\u0010+\u001a\u00020*2\u0006\u0010,\u001a\u00020*H\u0002¢\u0006\u0004\b\u001c\u0010-J!\u0010\u001c\u001a\u00020\u00072\u0006\u0010,\u001a\u00020*2\b\u0010\u0019\u001a\u0004\u0018\u00010\u0018H\u0002¢\u0006\u0004\b\u001c\u0010.J!\u0010\u001c\u001a\u00020\u00072\u0006\u00100\u001a\u00020/2\b\u0010\u0019\u001a\u0004\u0018\u00010\u0018H\u0002¢\u0006\u0004\b\u001c\u00101R\u0018\u00105\u001a\u0004\u0018\u0001028\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b3\u00104R\u0018\u00107\u001a\u0004\u0018\u0001028\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b6\u00104R\u0016\u0010;\u001a\u0002088\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b9\u0010:R*\u0010A\u001a\u0016\u0012\u0004\u0012\u00020=\u0018\u00010<j\n\u0012\u0004\u0012\u00020=\u0018\u0001`>8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b?\u0010@R\u0018\u0010D\u001a\u0004\u0018\u00010B8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u001e\u0010CR\u0016\u0010G\u001a\u00020\u000e8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bE\u0010FR\u0018\u0010K\u001a\u0004\u0018\u00010H8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bI\u0010JR\u0018\u0010O\u001a\u0004\u0018\u00010L8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bM\u0010NR\u0018\u0010Q\u001a\u0004\u0018\u0001028\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bP\u00104R\u0018\u0010S\u001a\u0004\u0018\u0001028\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bR\u00104R\u0018\u0010V\u001a\u0004\u0018\u00010T8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b)\u0010UR\u0018\u0010\u001b\u001a\u0004\u0018\u00010\u001a8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bW\u0010XR\u0018\u0010Z\u001a\u0004\u0018\u0001028\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bY\u00104R\u0018\u0010\\\u001a\u0004\u0018\u00010L8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b[\u0010NR\u0018\u0010_\u001a\u0004\u0018\u00010\u00188\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b]\u0010^R\u0018\u0010a\u001a\u0004\u0018\u0001028\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b`\u00104R\u0018\u0010e\u001a\u0004\u0018\u00010b8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bc\u0010dR\u0018\u0010,\u001a\u0004\u0018\u00010*8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bf\u0010gR\u0018\u0010i\u001a\u0004\u0018\u00010L8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bh\u0010NR\u0018\u0010m\u001a\u0004\u0018\u00010j8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bk\u0010lR\u0018\u0010o\u001a\u0004\u0018\u00010L8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bn\u0010NR\u0018\u0010q\u001a\u0004\u0018\u00010B8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bp\u0010CR\u0018\u0010u\u001a\u0004\u0018\u00010r8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bs\u0010tR\u0018\u0010w\u001a\u0004\u0018\u00010B8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bv\u0010CR\u0018\u0010y\u001a\u0004\u0018\u00010\u00188\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bx\u0010^R\u0018\u0010{\u001a\u0004\u0018\u00010L8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bz\u0010NR\u0018\u0010\u007f\u001a\u0004\u0018\u00010|8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b}\u0010~R\u001a\u0010\u0081\u0001\u001a\u0004\u0018\u00010L8\u0002@\u0002X\u0082\u000e¢\u0006\u0007\n\u0005\b\u0080\u0001\u0010NR\u001c\u0010\u0085\u0001\u001a\u0005\u0018\u00010\u0082\u00018\u0002@\u0002X\u0082\u000e¢\u0006\b\n\u0006\b\u0083\u0001\u0010\u0084\u0001R\u001c\u0010\u0089\u0001\u001a\u0005\u0018\u00010\u0086\u00018\u0002@\u0002X\u0082\u000e¢\u0006\b\n\u0006\b\u0087\u0001\u0010\u0088\u0001R\u0018\u0010\u008b\u0001\u001a\u00020&8\u0002@\u0002X\u0082\u000e¢\u0006\u0007\n\u0005\b\u008a\u0001\u0010MR\u001c\u0010\u008d\u0001\u001a\u0005\u0018\u00010\u0082\u00018\u0002@\u0002X\u0082\u000e¢\u0006\b\n\u0006\b\u008c\u0001\u0010\u0084\u0001R.\u0010\u0090\u0001\u001a\u0018\u0012\u0005\u0012\u00030\u008e\u0001\u0018\u00010<j\u000b\u0012\u0005\u0012\u00030\u008e\u0001\u0018\u0001`>8\u0002@\u0002X\u0082\u000e¢\u0006\u0007\n\u0005\b\u008f\u0001\u0010@R\u001a\u0010\u0092\u0001\u001a\u0004\u0018\u00010L8\u0002@\u0002X\u0082\u000e¢\u0006\u0007\n\u0005\b\u0091\u0001\u0010NR\u001c\u0010\u0094\u0001\u001a\u0005\u0018\u00010\u0086\u00018\u0002@\u0002X\u0082\u000e¢\u0006\b\n\u0006\b\u0093\u0001\u0010\u0088\u0001R\u001b\u0010\u0097\u0001\u001a\u0004\u0018\u00010/8\u0002@\u0002X\u0082\u000e¢\u0006\b\n\u0006\b\u0095\u0001\u0010\u0096\u0001R\u001a\u0010\u0099\u0001\u001a\u0004\u0018\u0001028\u0002@\u0002X\u0082\u000e¢\u0006\u0007\n\u0005\b\u0098\u0001\u00104R\u0017\u0010\u009a\u0001\u001a\u00020\u000e8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b:\u0010FR\u001c\u0010\u009c\u0001\u001a\u0005\u0018\u00010\u0082\u00018\u0002@\u0002X\u0082\u000e¢\u0006\b\n\u0006\b\u009b\u0001\u0010\u0084\u0001R\u001b\u0010\u009f\u0001\u001a\u0005\u0018\u00010\u009d\u00018\u0002@\u0002X\u0082\u000e¢\u0006\u0007\n\u0005\b\u001c\u0010\u009e\u0001¨\u0006¡\u0001"}, d2 = {"Lcom/payu/ui/view/activities/CheckoutActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "Lcom/payu/ui/model/widgets/a$b;", "Landroid/view/View$OnClickListener;", "Landroid/view/View$OnFocusChangeListener;", "Landroid/os/Bundle;", "savedInstanceState", "", "onCreate", "(Landroid/os/Bundle;)V", "outState", "onSaveInstanceState", "Landroid/view/Menu;", "menu", "", "onCreateOptionsMenu", "(Landroid/view/Menu;)Z", "onPrepareOptionsMenu", "Landroid/view/MenuItem;", "item", "onOptionsItemSelected", "(Landroid/view/MenuItem;)Z", "onBackPressed", "()V", "Landroid/view/View;", "view", "Lcom/payu/ui/model/widgets/a;", "roundedCornerBottomSheet", "a", "(Landroid/view/View;Lcom/payu/ui/model/widgets/a;)V", "v", "onClick", "(Landroid/view/View;)V", "onStop", "onDestroy", "hasFocus", "onFocusChange", "(Landroid/view/View;Z)V", "", "offset", "(F)V", "b", "Lcom/payu/base/models/PaymentOption;", "specificOption", "paymentOption", "(Lcom/payu/base/models/PaymentOption;Lcom/payu/base/models/PaymentOption;)V", "(Lcom/payu/base/models/PaymentOption;Landroid/view/View;)V", "Lcom/payu/base/models/SavedCardOption;", "savedCardOption", "(Lcom/payu/base/models/SavedCardOption;Landroid/view/View;)V", "Landroid/widget/TextView;", "M", "Landroid/widget/TextView;", "tvSIEnabledErrorForSavedCard", PayUAnalyticsConstant.PA_CT_DATA_PARAM, "tvAmount", "", "z", "J", "mLastClickTime", "Ljava/util/ArrayList;", "Lcom/payu/base/models/PayUOfferDetails;", "Lkotlin/collections/ArrayList;", "C", "Ljava/util/ArrayList;", "offerDetails", "", "Ljava/lang/String;", "upiPackageName", "x", "Z", "isActivityRecreated", "Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;", "D", "Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;", "globalLayoutListener", "Landroid/widget/ImageView;", "F", "Landroid/widget/ImageView;", "ivPayULock", "L", "tvOfferText", "H", "tvSecureText", "Lcom/google/android/material/appbar/CollapsingToolbarLayout;", "Lcom/google/android/material/appbar/CollapsingToolbarLayout;", "collapsingToolbar", "m", "Lcom/payu/ui/model/widgets/a;", "h", "tvOffer", "G", "ivOrderDetails", NotificationBundleProcessor.PUSH_MINIFIED_BUTTON_TEXT, "Landroid/view/View;", "inflatedView", "N", "tvConsentText", "Landroid/widget/Button;", NotificationBundleProcessor.PUSH_MINIFIED_BUTTON_ICON, "Landroid/widget/Button;", "btnPayBottomSheet", "y", "Lcom/payu/base/models/PaymentOption;", "g", "ivOfferDetails", "Landroid/widget/EditText;", NotificationBundleProcessor.PUSH_MINIFIED_BUTTONS_LIST, "Landroid/widget/EditText;", "etCvvBottomSheet", "c", "ivMerchantIcon", "e", "payText", "Lcom/google/android/material/appbar/AppBarLayout;", "k", "Lcom/google/android/material/appbar/AppBarLayout;", "appBarLayout", "w", "phoneNumber", "s", "transparentView", "f", "ivOrderDetailsCollapsed", "Landroid/app/ProgressDialog;", "l", "Landroid/app/ProgressDialog;", "progressDialog", "q", "ivToolTipCvv", "Landroid/widget/LinearLayout;", "r", "Landroid/widget/LinearLayout;", "llPaymentSection", "Landroid/widget/RelativeLayout;", "t", "Landroid/widget/RelativeLayout;", "rlSavedCardBottomSheet", "i", "EXPAND_ICON_SIZE", "A", "llOrderDetails", "Lcom/payu/base/models/OrderDetails;", "B", "orderDetailsArrayList", "E", "ivPayULogo", "j", "rlBottomView", "u", "Lcom/payu/base/models/SavedCardOption;", "saveCardOption", "I", "tvOrderDetails", "isBottomSheetDisplayed", "K", "llOfferText", "Lcom/payu/ui/viewmodel/j;", "Lcom/payu/ui/viewmodel/j;", "paymentOptionViewModel", "<init>", "payu-checkout-pro-ui_release"}, k = 1, mv = {1, 4, 2})
public final class CheckoutActivity extends AppCompatActivity implements a.b, View.OnClickListener, View.OnFocusChangeListener {
public static final int O = 0;
public LinearLayout llOrderDetails;
public ArrayList<OrderDetails> orderDetailsArrayList;
public ArrayList<PayUOfferDetails> offerDetails;
public ViewTreeObserver.OnGlobalLayoutListener globalLayoutListener;
public ImageView ivPayULogo;
public ImageView ivPayULock;
public ImageView ivOrderDetails;
public TextView tvSecureText;
public TextView tvOrderDetails;
public boolean isBottomSheetDisplayed;
public LinearLayout llOfferText;
public TextView tvOfferText;
public TextView tvSIEnabledErrorForSavedCard;
public TextView tvConsentText;
public com.payu.ui.viewmodel.j paymentOptionViewModel;
public CollapsingToolbarLayout collapsingToolbar;
public ImageView ivMerchantIcon;
public TextView tvAmount;
public String payText;
public ImageView ivOrderDetailsCollapsed;
public ImageView ivOfferDetails;
public TextView tvOffer;
public float EXPAND_ICON_SIZE;
public RelativeLayout rlBottomView;
public AppBarLayout appBarLayout;
public ProgressDialog progressDialog;
public com.payu.ui.model.widgets.a roundedCornerBottomSheet;
public View inflatedView;
public EditText etCvvBottomSheet;
public Button btnPayBottomSheet;
public ImageView ivToolTipCvv;
public LinearLayout llPaymentSection;
public View transparentView;
public RelativeLayout rlSavedCardBottomSheet;
public SavedCardOption saveCardOption;
public String upiPackageName;
public String phoneNumber;
public boolean isActivityRecreated;
public PaymentOption paymentOption;
public long mLastClickTime;
public static final class a implements OnFetchImageListener {
public final View a;
public a(View view) {
this.a = view;
}
@Override
public void onImageGenerated(Bitmap bitmap) {
ImageView imageView;
Intrinsics.checkNotNullParameter(bitmap, "bitmap");
View view = this.a;
if (view == null || (imageView = (ImageView) view.findViewById(R.id.ivBank)) == null) {
return;
}
imageView.setImageBitmap(bitmap);
}
}
public static final class b implements View.OnClickListener {
public final PaymentOption b;
public b(PaymentOption paymentOption) {
this.b = paymentOption;
}
@Override
public final void onClick(View view) {
long elapsedRealtime = SystemClock.elapsedRealtime();
CheckoutActivity checkoutActivity = CheckoutActivity.this;
if (elapsedRealtime - checkoutActivity.mLastClickTime < 1000) {
return;
}
checkoutActivity.mLastClickTime = SystemClock.elapsedRealtime();
com.payu.ui.model.utils.f fVar = com.payu.ui.model.utils.f.g;
Context applicationContext = CheckoutActivity.this.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext, "applicationContext");
if (!fVar.a(applicationContext)) {
CheckoutActivity.a(CheckoutActivity.this);
Context applicationContext2 = CheckoutActivity.this.getApplicationContext();
a.C0033a c0033a = new a.C0033a();
com.payu.ui.model.managers.a.a = c0033a;
if (applicationContext2 != null) {
applicationContext2.registerReceiver(c0033a, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
}
fVar.a(CheckoutActivity.this.getResources().getString(R.string.payu_no_internet_connection), Integer.valueOf(R.drawable.payu_no_internet), CheckoutActivity.this);
return;
}
com.payu.ui.model.utils.b bVar = com.payu.ui.model.utils.b.a;
Context applicationContext3 = CheckoutActivity.this.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext3, "applicationContext");
bVar.a(applicationContext3, this.b);
com.payu.ui.viewmodel.j jVar = CheckoutActivity.this.paymentOptionViewModel;
if (jVar != null) {
jVar.a(this.b);
}
}
}
public static final class c implements OnFetchImageListener {
public final View a;
public c(View view) {
this.a = view;
}
@Override
public void onImageGenerated(Bitmap bitmap) {
ImageView imageView;
Intrinsics.checkNotNullParameter(bitmap, "bitmap");
View view = this.a;
if (view == null || (imageView = (ImageView) view.findViewById(R.id.ivPaymentOptionIcon)) == null) {
return;
}
imageView.setImageBitmap(bitmap);
}
}
public static final class d implements Runnable {
public d() {
}
@Override
public final void run() {
InputMethodManager inputMethodManager = (InputMethodManager) CheckoutActivity.this.getSystemService("input_method");
if (inputMethodManager != null) {
inputMethodManager.toggleSoftInput(2, 1);
}
}
}
public static final class e implements View.OnClickListener {
public final SavedCardOption b;
public e(SavedCardOption savedCardOption) {
this.b = savedCardOption;
}
@Override
public final void onClick(View view) {
com.payu.ui.model.utils.f fVar = com.payu.ui.model.utils.f.g;
Context applicationContext = CheckoutActivity.this.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext, "applicationContext");
if (!fVar.a(applicationContext)) {
CheckoutActivity.a(CheckoutActivity.this);
Context applicationContext2 = CheckoutActivity.this.getApplicationContext();
a.C0033a c0033a = new a.C0033a();
com.payu.ui.model.managers.a.a = c0033a;
if (applicationContext2 != null) {
applicationContext2.registerReceiver(c0033a, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
}
fVar.a(CheckoutActivity.this.getApplicationContext().getString(R.string.payu_no_internet_connection), Integer.valueOf(R.drawable.payu_no_internet), CheckoutActivity.this);
return;
}
EditText editText = CheckoutActivity.this.etCvvBottomSheet;
Editable text = editText != null ? editText.getText() : null;
if (text == null || text.length() == 0) {
return;
}
SavedCardOption savedCardOption = this.b;
EditText editText2 = CheckoutActivity.this.etCvvBottomSheet;
savedCardOption.setCvv(String.valueOf(editText2 != null ? editText2.getText() : null));
fVar.a((Activity) CheckoutActivity.this, view);
com.payu.ui.model.utils.b bVar = com.payu.ui.model.utils.b.a;
Context applicationContext3 = CheckoutActivity.this.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext3, "applicationContext");
bVar.a(applicationContext3, this.b);
com.payu.ui.viewmodel.j jVar = CheckoutActivity.this.paymentOptionViewModel;
if (jVar != null) {
SavedCardOption savedCardOption2 = this.b;
Intrinsics.checkNotNullParameter(savedCardOption2, "savedCardOption");
CardBinInfo cardBinInfo = savedCardOption2.getCardBinInfo();
if (cardBinInfo != null) {
if (cardBinInfo.getCom.payu.india.Payu.PayuConstants.IS_DOMESTIC java.lang.String()) {
jVar.a(savedCardOption2);
return;
}
jVar.isPaymentViaMCP = true;
MutableLiveData<Boolean> mutableLiveData = jVar.hideSoftKeyboard;
Boolean bool = Boolean.TRUE;
mutableLiveData.setValue(bool);
jVar.hideBottomSheet.setValue(bool);
jVar.showProgressDialog.setValue(bool);
BaseApiLayer apiLayer = SdkUiInitializer.INSTANCE.getApiLayer();
if (apiLayer != null) {
apiLayer.callLookupApi(savedCardOption2, new com.payu.ui.viewmodel.i(jVar, savedCardOption2));
}
}
}
}
}
public static final class f implements View.OnClickListener {
public final SavedCardOption b;
public f(SavedCardOption savedCardOption) {
this.b = savedCardOption;
}
@Override
public final void onClick(View view) {
com.payu.ui.model.models.e eVar;
com.payu.ui.viewmodel.j jVar = CheckoutActivity.this.paymentOptionViewModel;
if (jVar != null) {
CardBinInfo cardBinInfo = this.b.getCardBinInfo();
CardScheme cardScheme = cardBinInfo != null ? cardBinInfo.getCardScheme() : null;
jVar.showTransparentView.setValue(Boolean.TRUE);
MutableLiveData<com.payu.ui.model.models.e> mutableLiveData = jVar.savedCardCvvToolTip;
if (cardScheme != null && com.payu.ui.viewmodel.h.e[cardScheme.ordinal()] == 1) {
String string = jVar.applicationContext.getString(R.string.payu_what_is_csc);
Intrinsics.checkNotNullExpressionValue(string, "applicationContext.getSt….string.payu_what_is_csc)");
String string2 = jVar.applicationContext.getString(R.string.payu_the_card_security_code);
Intrinsics.checkNotNullExpressionValue(string2, "applicationContext.getSt…u_the_card_security_code)");
eVar = new com.payu.ui.model.models.e(string, string2, Integer.valueOf(R.drawable.payu_tt_amex_cvv));
} else {
String string3 = jVar.applicationContext.getString(R.string.payu_what_is_cvv);
Intrinsics.checkNotNullExpressionValue(string3, "applicationContext.getSt….string.payu_what_is_cvv)");
String string4 = jVar.applicationContext.getString(R.string.payu_the_card_verification_value);
Intrinsics.checkNotNullExpressionValue(string4, "applicationContext.getSt…_card_verification_value)");
eVar = new com.payu.ui.model.models.e(string3, string4, Integer.valueOf(R.drawable.payu_tt_cvv));
}
mutableLiveData.setValue(eVar);
}
}
}
public final void a(float offset) {
if (offset >= 0.15f && offset <= 1.0f) {
TextView textView = this.tvAmount;
if (textView != null) {
if (textView.getVisibility() != 0) {
textView.setVisibility(0);
}
textView.setAlpha((1 - offset) * 0.35f);
}
ImageView imageView = this.ivMerchantIcon;
if (imageView != null) {
if (imageView != null) {
imageView.requestLayout();
}
if (offset < 1) {
float f2 = this.EXPAND_ICON_SIZE;
float f3 = f2 - (offset * f2);
ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
layoutParams.height = MathKt.roundToInt(f3);
layoutParams.width = MathKt.roundToInt(f3);
return;
}
return;
}
return;
}
if (offset < 0.0f || offset > 0.15f) {
return;
}
TextView textView2 = this.tvAmount;
if (textView2 != null) {
textView2.setAlpha(1.0f);
}
ImageView imageView2 = this.ivMerchantIcon;
if (imageView2 != null) {
imageView2.setAlpha(1.0f);
if (offset == 0.0f) {
ViewGroup.LayoutParams layoutParams2 = imageView2.getLayoutParams();
int i = layoutParams2.height;
int i2 = (int) this.EXPAND_ICON_SIZE;
if (i != i2) {
layoutParams2.height = i2;
layoutParams2.width = i2;
imageView2.setLayoutParams(layoutParams2);
}
}
}
}
public final void b() {
Fragment findFragmentByTag = getSupportFragmentManager().findFragmentByTag("ReplacedFragment");
if (findFragmentByTag != null) {
getSupportFragmentManager().beginTransaction().remove(findFragmentByTag).commit();
}
FragmentManager supportFragmentManager = getSupportFragmentManager();
Intrinsics.checkNotNullExpressionValue(supportFragmentManager, "supportFragmentManager");
if (supportFragmentManager.getBackStackEntryCount() <= 0) {
finish();
return;
}
NestedScrollView findViewById = findViewById(R.id.scrollViewActivity);
if (findViewById != null) {
findViewById.setOnTouchListener((View.OnTouchListener) null);
}
FragmentManager supportFragmentManager2 = getSupportFragmentManager();
FragmentManager supportFragmentManager3 = getSupportFragmentManager();
Intrinsics.checkNotNullExpressionValue(supportFragmentManager3, "supportFragmentManager");
FragmentManager.BackStackEntry backStackEntryAt = supportFragmentManager2.getBackStackEntryAt(supportFragmentManager3.getBackStackEntryCount() - 1);
Intrinsics.checkNotNullExpressionValue(backStackEntryAt, "supportFragmentManager.g….backStackEntryCount - 1)");
String name = backStackEntryAt.getName();
com.payu.ui.viewmodel.j jVar = this.paymentOptionViewModel;
if (jVar != null) {
FragmentManager supportFragmentManager4 = getSupportFragmentManager();
Intrinsics.checkNotNullExpressionValue(supportFragmentManager4, "supportFragmentManager");
jVar.a(supportFragmentManager4.getBackStackEntryCount(), name);
}
}
public void onBackPressed() {
JSONObject jSONObject;
String str;
BaseAnalytics analyticsClass;
PayUPaymentParams payUPaymentParams;
PayUPaymentParams payUPaymentParams2;
Context context = getApplicationContext();
Intrinsics.checkNotNullExpressionValue(context, "applicationContext");
Intrinsics.checkNotNullParameter(context, "context");
try {
jSONObject = new JSONObject();
try {
str = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis()));
} catch (Exception e2) {
e2.printStackTrace();
str = "";
}
jSONObject.put("ts", str);
SdkUiInitializer sdkUiInitializer = SdkUiInitializer.INSTANCE;
BaseApiLayer apiLayer = sdkUiInitializer.getApiLayer();
jSONObject.put("txnid", (apiLayer == null || (payUPaymentParams2 = apiLayer.getPayUPaymentParams()) == null) ? null : payUPaymentParams2.getTransactionId());
BaseApiLayer apiLayer2 = sdkUiInitializer.getApiLayer();
jSONObject.put("merchant_key", (apiLayer2 == null || (payUPaymentParams = apiLayer2.getPayUPaymentParams()) == null) ? null : payUPaymentParams.getKey());
jSONObject.put("cta_name", "Back button");
jSONObject.put("event_key", "Back button click");
analyticsClass = new AnalyticsFactory(context, null, 2, null).getAnalyticsClass(AnalyticsType.PAYU_ANALYTICS);
} catch (Exception e3) {
e3.printStackTrace();
}
if (analyticsClass == null) {
throw new NullPointerException("null cannot be cast to non-null type com.payu.payuanalytics.analytics.model.PayUAnalytics");
}
String jSONObject2 = jSONObject.toString();
Intrinsics.checkNotNullExpressionValue(jSONObject2, "analyticsJson.toString()");
((PayUAnalytics) analyticsClass).log(jSONObject2);
b();
}
@Override
public void onClick(View v) {
b.c.C0037c c0037c;
EditText editText;
RelativeLayout relativeLayout;
Integer valueOf = v != null ? Integer.valueOf(v.getId()) : null;
int i = R.id.collapsing_toolbar;
if (valueOf == null || valueOf.intValue() != i) {
int i2 = R.id.anim_toolbar;
if (valueOf == null || valueOf.intValue() != i2) {
int i3 = R.id.rl_bottom_bar;
if (valueOf == null || valueOf.intValue() != i3) {
int i4 = R.id.llPaymentSection;
if (valueOf == null || valueOf.intValue() != i4) {
int i5 = R.id.transparentView;
if (valueOf != null && valueOf.intValue() == i5) {
com.payu.ui.viewmodel.j jVar = this.paymentOptionViewModel;
if (jVar != null) {
jVar.showTransparentView.setValue(Boolean.FALSE);
jVar.hideToolTip.setValue(Boolean.TRUE);
return;
}
return;
}
int i6 = R.id.llOrderDetails;
if (valueOf == null || valueOf.intValue() != i6) {
int i7 = R.id.ivOrderDetailsCollapsed;
if (valueOf == null || valueOf.intValue() != i7) {
int i8 = R.id.tvOffer;
if (valueOf == null || valueOf.intValue() != i8) {
int i9 = R.id.ivOfferDetails;
if (valueOf == null || valueOf.intValue() != i9) {
return;
}
}
com.payu.ui.model.utils.b bVar = com.payu.ui.model.utils.b.a;
Context applicationContext = getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext, "applicationContext");
com.payu.ui.model.utils.b.a(bVar, applicationContext, "Offers", null, false, 12);
com.payu.ui.viewmodel.j jVar2 = this.paymentOptionViewModel;
if (jVar2 != null) {
jVar2.hideSoftKeyboard.setValue(Boolean.TRUE);
jVar2.savedCardInflated = false;
jVar2.exitDialogInflated = false;
jVar2.bankInflated = false;
jVar2.orderDetailsInflated = false;
jVar2.offerDetailsInflated = true;
jVar2.showBottomSheet.setValue(Integer.valueOf(R.layout.layout_offer_details));
return;
}
return;
}
}
com.payu.ui.model.utils.b bVar2 = com.payu.ui.model.utils.b.a;
Context applicationContext2 = getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext2, "applicationContext");
com.payu.ui.model.utils.b.a(bVar2, applicationContext2, "View Details", null, false, 12);
com.payu.ui.viewmodel.j jVar3 = this.paymentOptionViewModel;
if (jVar3 != null) {
jVar3.hideSoftKeyboard.setValue(Boolean.TRUE);
jVar3.savedCardInflated = false;
jVar3.exitDialogInflated = false;
jVar3.bankInflated = false;
jVar3.orderDetailsInflated = true;
jVar3.offerDetailsInflated = false;
jVar3.showBottomSheet.setValue(Integer.valueOf(R.layout.order_details_bottom_sheet_layout));
return;
}
return;
}
}
}
}
Intrinsics.checkNotNullParameter(this, "activity");
if (!isFinishing() && !isDestroyed() && (editText = (EditText) findViewById(R.id.search_src_text)) != null && editText.hasFocus() && (relativeLayout = (RelativeLayout) findViewById(R.id.rlSearchView)) != null && relativeLayout.isFocusable()) {
relativeLayout.requestFocus();
}
com.payu.ui.model.widgets.b bVar3 = com.payu.ui.model.widgets.b.e;
if (bVar3 != null) {
Intrinsics.checkNotNull(bVar3);
com.payu.ui.model.widgets.b bVar4 = com.payu.ui.model.widgets.b.e;
if (bVar4 == null || (c0037c = bVar4.b) == null) {
return;
}
c0037c.a();
}
}
public void onCreate(android.os.Bundle r17) {
throw new UnsupportedOperationException("Method not decompiled: com.payu.ui.view.activities.CheckoutActivity.onCreate(android.os.Bundle):void");
}
public boolean onCreateOptionsMenu(Menu menu) {
Intrinsics.checkNotNullParameter(menu, "menu");
getMenuInflater().inflate(R.menu.payu_checkout_menu, menu);
return true;
}
public void onDestroy() {
ViewTreeObserver viewTreeObserver;
super.onDestroy();
BaseApiLayer apiLayer = SdkUiInitializer.INSTANCE.getApiLayer();
if (apiLayer != null) {
apiLayer.reset();
}
ProgressDialog progressDialog = com.payu.ui.model.utils.f.f;
if (progressDialog != null) {
Intrinsics.checkNotNull(progressDialog);
if (progressDialog.isShowing()) {
ProgressDialog progressDialog2 = com.payu.ui.model.utils.f.f;
Intrinsics.checkNotNull(progressDialog2);
progressDialog2.dismiss();
com.payu.ui.model.utils.f.f = null;
}
}
Context applicationContext = getApplicationContext();
a.C0033a c0033a = com.payu.ui.model.managers.a.a;
if (c0033a != null) {
if (applicationContext != null) {
applicationContext.unregisterReceiver(c0033a);
}
com.payu.ui.model.managers.a.a = null;
}
ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = this.globalLayoutListener;
RelativeLayout relativeLayout = this.rlSavedCardBottomSheet;
if (onGlobalLayoutListener == null || relativeLayout == null || (viewTreeObserver = relativeLayout.getViewTreeObserver()) == null) {
return;
}
viewTreeObserver.removeOnGlobalLayoutListener(onGlobalLayoutListener);
}
@Override
public void onFocusChange(View v, boolean hasFocus) {
com.payu.ui.viewmodel.j jVar;
if (v == null || v.getId() != R.id.etCvv || !hasFocus || (jVar = this.paymentOptionViewModel) == null) {
return;
}
jVar.savedCardCvvFieldColor.setValue(Integer.valueOf(R.drawable.payu_rounded_corner_image_for_edittext_highlighted));
}
public boolean onOptionsItemSelected(MenuItem item) {
Intrinsics.checkNotNullParameter(item, "item");
if (item.getItemId() == 16908332) {
b();
}
return super.onOptionsItemSelected(item);
}
public boolean onPrepareOptionsMenu(Menu menu) {
MenuItem findItem = menu != null ? menu.findItem(R.id.payu_custom_menu) : null;
View actionView = findItem != null ? findItem.getActionView() : null;
this.tvOffer = actionView != null ? (TextView) actionView.findViewById(R.id.tvOffer) : null;
this.ivOrderDetailsCollapsed = actionView != null ? (ImageView) actionView.findViewById(R.id.ivOrderDetailsCollapsed) : null;
this.ivOfferDetails = actionView != null ? (ImageView) actionView.findViewById(R.id.ivOfferDetails) : null;
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(AnimationUtils.loadAnimation(this, R.anim.shake));
animationSet.setAnimationListener(new k0(this, animationSet));
ImageView imageView = this.ivOfferDetails;
if (imageView != null) {
imageView.startAnimation(animationSet);
}
ImageView imageView2 = this.ivOrderDetailsCollapsed;
if (imageView2 != null) {
imageView2.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.one_payu_baseTextColor), PorterDuff.Mode.SRC_IN);
}
ImageView imageView3 = this.ivOrderDetailsCollapsed;
if (imageView3 != null) {
imageView3.setVisibility(0);
}
ArrayList<PayUOfferDetails> arrayList = this.offerDetails;
if (arrayList == null || arrayList.isEmpty()) {
ImageView imageView4 = this.ivOfferDetails;
if (imageView4 != null) {
imageView4.setVisibility(8);
}
} else {
ImageView imageView5 = this.ivOfferDetails;
if (imageView5 != null) {
imageView5.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.one_payu_baseTextColor), PorterDuff.Mode.SRC_IN);
}
ImageView imageView6 = this.ivOfferDetails;
if (imageView6 != null) {
imageView6.setVisibility(0);
}
}
TextView textView = this.tvOffer;
if (textView != null) {
textView.setOnClickListener(this);
}
ImageView imageView7 = this.ivOrderDetailsCollapsed;
if (imageView7 != null) {
imageView7.setOnClickListener(this);
}
ImageView imageView8 = this.ivOfferDetails;
if (imageView8 != null) {
imageView8.setOnClickListener(this);
}
return true;
}
public void onSaveInstanceState(android.os.Bundle r5) {
throw new UnsupportedOperationException("Method not decompiled: com.payu.ui.view.activities.CheckoutActivity.onSaveInstanceState(android.os.Bundle):void");
}
public void onStop() {
super.onStop();
ProgressDialog progressDialog = this.progressDialog;
if (progressDialog != null) {
Intrinsics.checkNotNull(progressDialog);
progressDialog.dismiss();
this.progressDialog = null;
}
if (isFinishing() || isDestroyed()) {
return;
}
Object systemService = getSystemService("input_method");
if (systemService == null) {
throw new NullPointerException("null cannot be cast to non-null type android.view.inputmethod.InputMethodManager");
}
InputMethodManager inputMethodManager = (InputMethodManager) systemService;
View currentFocus = getCurrentFocus();
if (currentFocus == null) {
currentFocus = new View(this);
}
inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
}
public static final void b(CheckoutActivity checkoutActivity) {
ProgressDialog progressDialog = checkoutActivity.progressDialog;
if (progressDialog != null) {
Intrinsics.checkNotNull(progressDialog);
if (progressDialog.isShowing()) {
ProgressDialog progressDialog2 = checkoutActivity.progressDialog;
Intrinsics.checkNotNull(progressDialog2);
progressDialog2.dismiss();
checkoutActivity.progressDialog = null;
}
}
}
public static final void a(CheckoutActivity checkoutActivity) {
com.payu.ui.viewmodel.j jVar = checkoutActivity.paymentOptionViewModel;
if (jVar != null) {
jVar.c();
}
com.payu.ui.model.widgets.a aVar = checkoutActivity.roundedCornerBottomSheet;
if (aVar != null) {
aVar.dismiss();
}
}
@Override
public void a(View view, com.payu.ui.model.widgets.a roundedCornerBottomSheet) {
CardBinInfo cardBinInfo;
CardBinInfo cardBinInfo2;
Intrinsics.checkNotNullParameter(view, "view");
Intrinsics.checkNotNullParameter(roundedCornerBottomSheet, "roundedCornerBottomSheet");
if (!this.isBottomSheetDisplayed) {
roundedCornerBottomSheet.dismiss();
return;
}
this.inflatedView = view;
SavedCardOption savedCardOption = this.saveCardOption;
if (savedCardOption != null) {
if (this.roundedCornerBottomSheet == null) {
this.roundedCornerBottomSheet = roundedCornerBottomSheet;
}
Intrinsics.checkNotNull(savedCardOption);
a(savedCardOption, view);
return;
}
PaymentOption paymentOption = this.paymentOption;
if (paymentOption != null && this.isActivityRecreated) {
if (this.roundedCornerBottomSheet == null) {
this.roundedCornerBottomSheet = roundedCornerBottomSheet;
}
if (paymentOption.getPaymentType() == PaymentType.UPI) {
UPIOption uPIOption = new UPIOption();
PaymentOption paymentOption2 = this.paymentOption;
Intrinsics.checkNotNull(paymentOption2);
a(uPIOption, paymentOption2);
String str = this.upiPackageName;
Intrinsics.checkNotNull(str);
uPIOption.setPackageName(str);
a(uPIOption, view);
} else {
PaymentOption paymentOption3 = this.paymentOption;
if ((paymentOption3 != null ? paymentOption3.getPaymentType() : null) == PaymentType.WALLET) {
WalletOption walletOption = new WalletOption();
PaymentOption paymentOption4 = this.paymentOption;
Intrinsics.checkNotNull(paymentOption4);
a(walletOption, paymentOption4);
String str2 = this.phoneNumber;
Intrinsics.checkNotNull(str2);
walletOption.setPhoneNumber(str2);
a(walletOption, view);
}
}
this.paymentOption = null;
return;
}
com.payu.ui.viewmodel.j jVar = this.paymentOptionViewModel;
if (jVar != null) {
if (jVar.savedCardInflated) {
PaymentOption paymentOption5 = jVar.selectedPaymentOption;
if (!(paymentOption5 instanceof SavedCardOption)) {
paymentOption5 = null;
}
SavedCardOption savedCardOption2 = (SavedCardOption) paymentOption5;
jVar.updateSavedCardBottomSheet.setValue(savedCardOption2);
Double d2 = (savedCardOption2 == null || (cardBinInfo2 = savedCardOption2.getCardBinInfo()) == null) ? null : cardBinInfo2.getCom.payu.india.Payu.PayuConstants.ADDITIONAL_CHARGE java.lang.String();
if (savedCardOption2 != null && (cardBinInfo = savedCardOption2.getCardBinInfo()) != null) {
r1 = cardBinInfo.getGst();
}
jVar.a(d2, r1);
return;
}
if (jVar.exitDialogInflated) {
jVar.updateExitDialogBottomSheet.setValue(Boolean.TRUE);
return;
}
if (jVar.bankInflated) {
jVar.updateBankBottomSheet.setValue(jVar.selectedPaymentOption);
PaymentOption paymentOption6 = jVar.selectedPaymentOption;
Double d3 = paymentOption6 != null ? paymentOption6.getCom.payu.india.Payu.PayuConstants.ADDITIONAL_CHARGE java.lang.String() : null;
PaymentOption paymentOption7 = jVar.selectedPaymentOption;
jVar.a(d3, paymentOption7 != null ? paymentOption7.getGst() : null);
return;
}
if (jVar.orderDetailsInflated) {
jVar.updateOrderDetailsBottomSheet.setValue(Boolean.TRUE);
} else if (jVar.offerDetailsInflated) {
jVar.updateOfferDetailsBottomSheet.setValue(Boolean.TRUE);
}
}
}
public final void a(PaymentOption specificOption, PaymentOption paymentOption) {
specificOption.setBankName(paymentOption.getBankName());
specificOption.setBankDown(paymentOption.getIsBankDown());
specificOption.setDrawable(paymentOption.getDrawable());
specificOption.setOtherParams(paymentOption.getOtherParams());
specificOption.setPaymentType(paymentOption.getPaymentType());
}
@Override
public void a() {
getWindow().setSoftInputMode(3);
TextView textView = this.tvSIEnabledErrorForSavedCard;
if (textView != null) {
textView.setVisibility(8);
}
TextView textView2 = this.tvConsentText;
if (textView2 != null) {
textView2.setVisibility(8);
}
com.payu.ui.viewmodel.j jVar = this.paymentOptionViewModel;
if (jVar != null) {
jVar.c();
}
}
public final void a(PaymentOption paymentOption, View view) {
ImageParam imageParam = new ImageParam(paymentOption, false, R.drawable.payu_credit_debit_cards, null, 8, null);
BaseApiLayer apiLayer = SdkUiInitializer.INSTANCE.getApiLayer();
if (apiLayer != null) {
apiLayer.getImageForPaymentOption(imageParam, new a(view));
}
Button button = view != null ? (Button) view.findViewById(R.id.btnPayBy) : null;
if (button != null) {
button.setText(getString(R.string.payu_pay_by, new Object[]{paymentOption.getBankName()}));
}
if (button != null) {
button.setOnClickListener(new b(paymentOption));
}
}
public final void a(SavedCardOption savedCardOption, View view) {
int i;
CardBinInfo cardBinInfo;
CardBinInfo cardBinInfo2;
TextView textView;
String str;
String str2;
String str3;
TextView textView2;
CardType cardType;
TextView textView3;
PaymentOption paymentOption;
BaseApiLayer apiLayer;
PayUPaymentParams payUPaymentParams;
com.payu.ui.viewmodel.j jVar = this.paymentOptionViewModel;
if (jVar != null) {
CardBinInfo cardBinInfo3 = savedCardOption.getCardBinInfo();
String cardBin = cardBinInfo3 != null ? cardBinInfo3.getBinNumber() : null;
Intrinsics.checkNotNull(cardBin);
Intrinsics.checkNotNullParameter(cardBin, "cardBin");
SdkUiInitializer sdkUiInitializer = SdkUiInitializer.INSTANCE;
BaseApiLayer apiLayer2 = sdkUiInitializer.getApiLayer();
if (((apiLayer2 == null || (payUPaymentParams = apiLayer2.getPayUPaymentParams()) == null) ? null : payUPaymentParams.getPayUSIParams()) != null && (apiLayer = sdkUiInitializer.getApiLayer()) != null) {
apiLayer.getCardBinInfo(cardBin, jVar);
}
}
this.tvSIEnabledErrorForSavedCard = view != null ? (TextView) view.findViewById(R.id.tv_card_error) : null;
this.tvConsentText = view != null ? (TextView) view.findViewById(R.id.tv_consent_text) : null;
TextView textView4 = this.tvSIEnabledErrorForSavedCard;
if (textView4 != null) {
textView4.setVisibility(8);
}
TextView textView5 = this.tvConsentText;
if (textView5 != null) {
textView5.setVisibility(8);
}
if (view != null && (textView3 = (TextView) view.findViewById(R.id.tvBankName)) != null) {
com.payu.ui.viewmodel.j jVar2 = this.paymentOptionViewModel;
textView3.setText((jVar2 == null || (paymentOption = jVar2.selectedPaymentOption) == null) ? null : paymentOption.getBankName());
}
if (view != null && (textView2 = (TextView) view.findViewById(R.id.tvPaymentOption)) != null) {
CardBinInfo cardBinInfo4 = savedCardOption.getCardBinInfo();
textView2.setText((cardBinInfo4 == null || (cardType = cardBinInfo4.getCom.payu.india.Payu.PayuConstants.CARDTYPE java.lang.String()) == null) ? null : cardType.getTypeName());
}
int i2 = 4;
if (view != null && (textView = (TextView) view.findViewById(R.id.tvPaymentOptionDetail)) != null) {
String cardNumber = savedCardOption.getCardNumber();
CardBinInfo cardBinInfo5 = savedCardOption.getCardBinInfo();
CardScheme cardScheme = cardBinInfo5 != null ? cardBinInfo5.getCardScheme() : null;
if (cardScheme != null) {
if (com.payu.ui.model.utils.c.f[cardScheme.ordinal()] != 1) {
cardNumber = cardNumber != null ? new Regex("....(?!$)").replace(cardNumber, "$0 ") : null;
} else {
StringBuilder sb = new StringBuilder();
if (cardNumber != null) {
str = cardNumber.substring(0, 4);
Intrinsics.checkNotNullExpressionValue(str, "(this as java.lang.Strin…ing(startIndex, endIndex)");
} else {
str = null;
}
StringBuilder append = sb.append(str).append(' ');
if (cardNumber != null) {
str2 = cardNumber.substring(4, 10);
Intrinsics.checkNotNullExpressionValue(str2, "(this as java.lang.Strin…ing(startIndex, endIndex)");
} else {
str2 = null;
}
StringBuilder append2 = append.append(str2).append(' ');
if (cardNumber != null) {
str3 = cardNumber.substring(10);
Intrinsics.checkNotNullExpressionValue(str3, "(this as java.lang.String).substring(startIndex)");
} else {
str3 = null;
}
cardNumber = append2.append(str3).toString();
}
}
textView.setText(cardNumber);
}
ImageParam imageParam = new ImageParam(savedCardOption, true, R.drawable.payu_credit_debit_cards, null, 8, null);
BaseApiLayer apiLayer3 = SdkUiInitializer.INSTANCE.getApiLayer();
if (apiLayer3 != null) {
apiLayer3.getImageForPaymentOption(imageParam, new c(view));
}
this.btnPayBottomSheet = view != null ? (Button) view.findViewById(R.id.btnPay) : null;
this.rlSavedCardBottomSheet = view != null ? (RelativeLayout) view.findViewById(R.id.rlSavedCardBottomSheet) : null;
Button button = this.btnPayBottomSheet;
if (button != null) {
button.setAlpha(0.5f);
}
if (button != null) {
button.setEnabled(false);
}
EditText editText = view != null ? (EditText) view.findViewById(R.id.etCvv) : null;
this.etCvvBottomSheet = editText;
if (editText != null) {
editText.requestFocus();
}
this.llOfferText = view != null ? (LinearLayout) view.findViewById(R.id.llOfferText) : null;
this.tvOfferText = view != null ? (TextView) view.findViewById(R.id.tvOfferText) : null;
com.payu.ui.viewmodel.j jVar3 = this.paymentOptionViewModel;
if (jVar3 != null) {
Intrinsics.checkNotNullParameter(savedCardOption, "savedCardOption");
if (savedCardOption.getOfferDetail().length() == 0) {
jVar3.showSavedCardOfferUI.setValue(Boolean.FALSE);
} else {
jVar3.showSavedCardOfferUI.setValue(Boolean.TRUE);
jVar3.savedCardOfferText.setValue(savedCardOption.getOfferDetail());
}
}
new Handler().postDelayed(new d(), 500L);
com.payu.ui.viewmodel.j jVar4 = this.paymentOptionViewModel;
if (jVar4 != null) {
if (!(((savedCardOption == null || (cardBinInfo2 = savedCardOption.getCardBinInfo()) == null) ? null : cardBinInfo2.getCardScheme()) == CardScheme.SMAE)) {
CardScheme cardScheme2 = (savedCardOption == null || (cardBinInfo = savedCardOption.getCardBinInfo()) == null) ? null : cardBinInfo.getCardScheme();
if (cardScheme2 != null && (i = com.payu.ui.model.utils.c.d[cardScheme2.ordinal()]) != 1 && i != 2) {
i2 = 3;
}
jVar4.cvvLengthFilter.setValue(Integer.valueOf(i2));
} else {
jVar4.enablePayButtonBottomSheet.setValue(Boolean.TRUE);
}
}
Button button2 = this.btnPayBottomSheet;
if (button2 != null) {
button2.setOnClickListener(new e(savedCardOption));
}
ImageView imageView = view != null ? (ImageView) view.findViewById(R.id.ivToolTipCvv) : null;
this.ivToolTipCvv = imageView;
if (imageView != null) {
imageView.setOnClickListener(new f(savedCardOption));
}
View findViewById = view != null ? view.findViewById(R.id.transparentView) : null;
this.transparentView = findViewById;
if (findViewById != null) {
findViewById.setOnClickListener(this);
}
this.saveCardOption = null;
EditText editText2 = this.etCvvBottomSheet;
if (editText2 != null) {
editText2.setOnFocusChangeListener(this);
}
}
}