Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.emer.beneficiary.ui.dialog;
- import android.os.*;
- import android.view.*;
- import android.widget.*;
- import androidx.annotation.*;
- import androidx.fragment.app.*;
- import com.emer.beneficiary.*;
- public class UserDataDialogFragment extends DialogFragment {
- private TextView textViewTitle;
- private TextView textViewSubTitle;
- private ImageView imageViewIcon;
- public UserDataDialogFragment() {
- // Empty constructor is required for DialogFragment
- // Make sure not to add arguments to the constructor
- // Use `newInstance` instead as shown below
- }
- public static UserDataDialogFragment newInstance(int type) {
- UserDataDialogFragment frag = new UserDataDialogFragment();
- Bundle args = new Bundle();
- args.putInt("type", type);
- frag.setArguments(args);
- return frag;
- }
- @Override
- public void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setStyle(DialogFragment.STYLE_NO_TITLE, R.style.AppTheme_Dialog_Custom);
- }
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- return inflater.inflate(R.layout.popup_data_ok, container);
- }
- @Override
- public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
- // Get field from view
- textViewTitle = (TextView) view.findViewById(R.id.textViewTitle);
- textViewSubTitle = (TextView) view.findViewById(R.id.textViewSubTitle);
- imageViewIcon = (ImageView) view.findViewById(R.id.imageViewIcon);
- int type = getArguments().getInt("type", 0);
- switch (type)
- {
- case 0:
- textViewTitle.setText("Excelente");
- textViewSubTitle.setText("Tus datos fueron aprobados con éxito.");
- break;
- case 1:
- textViewTitle.setText("En proceso");
- textViewSubTitle.setText("Tus datos se encuentran en proceso de validación.");
- break;
- case 2:
- textViewTitle.setText("Ocurrió un error");
- textViewSubTitle.setText("TPara modificar los campos seleccionados, deben transcurrir 7 días desde la última modificación.");
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement