what-the-bank/sources/com/scb/phone/view/fragment/additionaldocument/PictureSelectionBottomEntry...

121 lines
3.8 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.additionaldocument;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.scb.phone.R;
import java.util.ArrayList;
import java.util.Set;
import o.YW;
/* loaded from: classes5.dex */
public class PictureSelectionBottomEntryFragment extends BottomSheetDialogFragment {
private RVV b;
@BindView
LinearLayout linearLayoutSelectCancel;
@BindView
LinearLayout linearLayoutSelectFromFile;
@BindView
LinearLayout linearLayoutSelectGallery;
@BindView
LinearLayout linearLayoutSelectPhoto;
/* loaded from: classes5.dex */
public interface RVV {
void o();
void r();
void s();
}
public static PictureSelectionBottomEntryFragment a(Set<YW> set) {
Bundle bundle = new Bundle();
bundle.putParcelableArrayList("UPLOAD_METHODS", new ArrayList<>(set));
PictureSelectionBottomEntryFragment pictureSelectionBottomEntryFragment = new PictureSelectionBottomEntryFragment();
pictureSelectionBottomEntryFragment.setArguments(bundle);
return pictureSelectionBottomEntryFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559413, viewGroup, false);
ButterKnife.c(this, inflate);
return inflate;
}
@Override // androidx.fragment.app.Fragment
public void onViewCreated(View view, Bundle bundle) {
super.onViewCreated(view, bundle);
Bundle arguments = getArguments();
if (arguments != null) {
ArrayList parcelableArrayList = arguments.getParcelableArrayList("UPLOAD_METHODS");
this.linearLayoutSelectPhoto.setVisibility((parcelableArrayList == null || !parcelableArrayList.contains(YW.TAKE_PHOTO)) ? 8 : 0);
this.linearLayoutSelectGallery.setVisibility((parcelableArrayList == null || !parcelableArrayList.contains(YW.UPLOAD_PHOTO)) ? 8 : 0);
this.linearLayoutSelectFromFile.setVisibility((parcelableArrayList == null || !parcelableArrayList.contains(YW.UPLOAD_PDF)) ? 8 : 0);
this.linearLayoutSelectCancel.setVisibility((parcelableArrayList == null || !parcelableArrayList.contains(YW.CANCEL)) ? 8 : 0);
}
}
/* JADX WARN: Multi-variable type inference failed */
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof RVV) {
this.b = (RVV) context;
} else {
if (getParentFragment() instanceof RVV) {
this.b = (RVV) getParentFragment();
return;
}
throw new IllegalStateException("This context needs to implement the OnEntrySelectionListener contract");
}
}
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
public void onDetach() {
this.b = null;
super.onDetach();
}
@OnClick
public void takePicture() {
RVV rvv = this.b;
if (rvv != null) {
rvv.s();
}
}
@OnClick
public void chooseFromGallery() {
RVV rvv = this.b;
if (rvv != null) {
rvv.o();
}
}
@OnClick
public void chooseFromPdfFile() {
RVV rvv = this.b;
if (rvv != null) {
rvv.r();
}
}
@OnClick
public void cancel() {
dismiss();
}
}