what-the-bank/sources/com/scb/phone/view/fragment/merchant/MerchantWalletSelectorFragm...

92 lines
3.1 KiB
Java

package com.scb.phone.view.fragment.merchant;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.adapter.deposit.MerchantWalletSelectorAdapter;
import java.util.List;
import me.relex.circleindicator.CircleIndicator;
import o.RK;
/* loaded from: classes5.dex */
public class MerchantWalletSelectorFragment extends Hilt_MerchantWalletSelectorFragment {
protected LWm c;
@BindView
protected CircleIndicator mCircleIndicator;
@BindView
protected ViewPager mViewPager;
/* loaded from: classes5.dex */
public interface LWm {
void a(int i);
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559757, viewGroup, false);
ButterKnife.c(this, inflate);
return inflate;
}
public final void c(List<RK> list) {
this.mViewPager.setAdapter(new MerchantWalletSelectorAdapter(list));
this.mViewPager.setClipToPadding(false);
this.mViewPager.setPadding(getResources().getDimensionPixelOffset(R.dimen.f28542131166620), 0, getResources().getDimensionPixelOffset(R.dimen.f28542131166620), 0);
this.mViewPager.addOnPageChangeListener(new ViewPager.ojQ(this) { // from class: com.scb.phone.view.fragment.merchant.MerchantWalletSelectorFragment.1
private MerchantWalletSelectorFragment d;
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageScrollStateChanged(int i) {
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageScrolled(int i, float f, int i2) {
}
{
this.d = this;
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public final void onPageSelected(int i) {
if (this.d.c != null) {
this.d.c.a(i);
}
}
});
this.mCircleIndicator.setViewPager(this.mViewPager);
if (list.size() >= 10) {
this.mCircleIndicator.setVisibility(8);
} else {
this.mCircleIndicator.setVisibility(0);
}
}
public final void c(int i) {
LWm lWm;
boolean z = this.mViewPager.getCurrentItem() != i;
this.mViewPager.setCurrentItem(i, false);
if (z || (lWm = this.c) == null) {
return;
}
lWm.a(i);
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.merchant.Hilt_MerchantWalletSelectorFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof LWm) {
this.c = (LWm) context;
}
}
}