126 lines
4.6 KiB
Java
126 lines
4.6 KiB
Java
|
package com.scb.phone.view.fragment.findus;
|
||
|
|
||
|
import android.content.Intent;
|
||
|
import android.os.Bundle;
|
||
|
import android.view.LayoutInflater;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewGroup;
|
||
|
import androidx.fragment.app.FragmentActivity;
|
||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||
|
import androidx.recyclerview.widget.RecyclerView;
|
||
|
import butterknife.BindView;
|
||
|
import butterknife.ButterKnife;
|
||
|
import com.scb.phone.R;
|
||
|
import com.scb.phone.view.activity.BaseActivity;
|
||
|
import com.scb.phone.view.adapter.findus.SelectProvinceOrDistrictAdapter;
|
||
|
import java.util.List;
|
||
|
import o.C0693Mj;
|
||
|
import o.C10457eEr;
|
||
|
import o.C4980bkR;
|
||
|
import o.EnumC8951daY;
|
||
|
import o.InterfaceC12824fIT;
|
||
|
import o.InterfaceC13391fZD;
|
||
|
import o.InterfaceC6663cZf;
|
||
|
import o.mvc;
|
||
|
|
||
|
/* loaded from: classes5.dex */
|
||
|
public class SelectProvinceOrDistrictFragment extends Hilt_SelectProvinceOrDistrictFragment implements InterfaceC6663cZf.Sts, InterfaceC12824fIT {
|
||
|
private String c;
|
||
|
|
||
|
@BindView
|
||
|
RecyclerView mRecyclerView;
|
||
|
|
||
|
@InterfaceC13391fZD
|
||
|
public C4980bkR selectProvinceOrDistrictPresenter;
|
||
|
|
||
|
@Override // androidx.fragment.app.Fragment
|
||
|
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||
|
byte b = 0;
|
||
|
View inflate = layoutInflater.inflate(R.layout.2131559906, viewGroup, false);
|
||
|
ButterKnife.c(this, inflate);
|
||
|
if (getActivity() != null && getActivity().getIntent() != null) {
|
||
|
this.c = getActivity().getIntent().getStringExtra("PROVINCE_NAME");
|
||
|
}
|
||
|
aa();
|
||
|
if (this.c.isEmpty()) {
|
||
|
C4980bkR c4980bkR = this.selectProvinceOrDistrictPresenter;
|
||
|
if (c4980bkR.f != 0) {
|
||
|
c4980bkR.f.v();
|
||
|
}
|
||
|
c4980bkR.c.e();
|
||
|
mvc mvcVar = c4980bkR.c;
|
||
|
mvcVar.d(mvcVar.i, new C4980bkR.HBt(c4980bkR, b));
|
||
|
} else {
|
||
|
C4980bkR c4980bkR2 = this.selectProvinceOrDistrictPresenter;
|
||
|
String str = this.c;
|
||
|
if (c4980bkR2.f != 0) {
|
||
|
c4980bkR2.f.v();
|
||
|
}
|
||
|
c4980bkR2.c.a(str);
|
||
|
mvc mvcVar2 = c4980bkR2.c;
|
||
|
mvcVar2.d(mvcVar2.i, new C4980bkR.LWm(c4980bkR2, b));
|
||
|
}
|
||
|
this.selectProvinceOrDistrictPresenter.e((C4980bkR) this);
|
||
|
return inflate;
|
||
|
}
|
||
|
|
||
|
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
||
|
public void onDestroy() {
|
||
|
this.selectProvinceOrDistrictPresenter.w_();
|
||
|
super.onDestroy();
|
||
|
}
|
||
|
|
||
|
@Override // com.scb.phone.view.fragment.BaseFragment
|
||
|
public final void aa() {
|
||
|
super.aa();
|
||
|
String str = this.c;
|
||
|
u(getString((str == null || str.isEmpty()) ? R.string.province_place_holder : R.string.district_place_holder));
|
||
|
Y();
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC12824fIT
|
||
|
public final void a(int i) {
|
||
|
String str;
|
||
|
String string;
|
||
|
Intent intent = new Intent();
|
||
|
intent.setAction("com.scb.phone/BROADCAST_UPDATE_SELECTED_ITEM");
|
||
|
if (!this.c.isEmpty()) {
|
||
|
str = this.c;
|
||
|
} else {
|
||
|
str = this.selectProvinceOrDistrictPresenter.b.get(i);
|
||
|
}
|
||
|
intent.putExtra("PROVINCE_NAME", str);
|
||
|
if (this.c.isEmpty()) {
|
||
|
string = getString(R.string.district_place_holder);
|
||
|
} else {
|
||
|
string = this.selectProvinceOrDistrictPresenter.a.get(i).b;
|
||
|
}
|
||
|
intent.putExtra("DISTRICT_NAME", string);
|
||
|
intent.putExtra("DISTRICT_LAT", !this.c.isEmpty() ? this.selectProvinceOrDistrictPresenter.a.get(i).d : -99.0d);
|
||
|
intent.putExtra("DISTRICT_LON", !this.c.isEmpty() ? this.selectProvinceOrDistrictPresenter.a.get(i).a : -189.0d);
|
||
|
C10457eEr.aqd_(this, intent);
|
||
|
if (getActivity() != null) {
|
||
|
getActivity().finish();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6663cZf.Sts
|
||
|
public final void e(List<String> list) {
|
||
|
getContext();
|
||
|
this.mRecyclerView.setLayoutManager(new LinearLayoutManager());
|
||
|
this.mRecyclerView.setAdapter(new SelectProvinceOrDistrictAdapter(getContext(), list, this));
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC6663cZf.Sts
|
||
|
public final void d(C0693Mj c0693Mj) {
|
||
|
FragmentActivity activity = getActivity();
|
||
|
if (activity != null) {
|
||
|
String str = c0693Mj.c;
|
||
|
EnumC8951daY enumC8951daY = EnumC8951daY.ERROR;
|
||
|
if (getActivity() != null) {
|
||
|
BaseActivity.a(new Object[]{(BaseActivity) getActivity(), activity, Integer.valueOf(R.id.select_province_container_view), str, enumC8951daY}, 855668825, -855668822, R.id.select_province_container_view);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|