use of co.krypt.krypton.silo.IdentityService.GetProfile in project krypton-android by kryptco.
the class MemberEnterEmail method onCreateView.
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
final View v = inflater.inflate(R.layout.fragment_teams_invite_inperson_member_enter_email, container, false);
email = v.findViewById(R.id.memberEmailInPerson);
email.setText("loading...");
email.setTextColor(getResources().getColor(R.color.appGray, null));
email.setEnabled(false);
Email.colorValidEmail(email);
nextButton = v.findViewById(R.id.inpersonEmailNext);
nextButton.setOnClickListener(b -> {
EventBus.getDefault().unregister(this);
nextButton.setEnabled(false);
new Thread(() -> {
try {
new MeStorage(getContext()).setEmail(email.getText().toString().trim());
} catch (CryptoException e) {
co.krypt.krypton.uiutils.Error.shortToast(getContext(), "Failed to set email: " + e.getMessage());
e.printStackTrace();
return;
}
getActivity().runOnUiThread(() -> Transitions.beginSlide(this).replace(R.id.fragmentOverlay, new MemberQR()).addToBackStack(null).commitAllowingStateLoss());
}).start();
});
nextButton.setEnabled(false);
EventBus.getDefault().register(this);
EventBus.getDefault().post(new GetProfile(getContext()));
return v;
}
Aggregations