Search in sources :

Example 1 with BaseRegistrationViewModel

use of org.thoughtcrime.securesms.registration.viewmodel.BaseRegistrationViewModel in project Signal-Android by WhisperSystems.

the class BaseAccountLockedFragment method onViewCreated.

@Override
@CallSuper
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    TextView description = view.findViewById(R.id.account_locked_description);
    BaseRegistrationViewModel viewModel = getViewModel();
    viewModel.getLockedTimeRemaining().observe(getViewLifecycleOwner(), t -> description.setText(getString(R.string.AccountLockedFragment__your_account_has_been_locked_to_protect_your_privacy, durationToDays(t))));
    view.findViewById(R.id.account_locked_next).setOnClickListener(v -> onNext());
    view.findViewById(R.id.account_locked_learn_more).setOnClickListener(v -> learnMore());
    requireActivity().getOnBackPressedDispatcher().addCallback(getViewLifecycleOwner(), new OnBackPressedCallback(true) {

        @Override
        public void handleOnBackPressed() {
            onNext();
        }
    });
}
Also used : BaseRegistrationViewModel(org.thoughtcrime.securesms.registration.viewmodel.BaseRegistrationViewModel) OnBackPressedCallback(androidx.activity.OnBackPressedCallback) TextView(android.widget.TextView) CallSuper(androidx.annotation.CallSuper)

Aggregations

TextView (android.widget.TextView)1 OnBackPressedCallback (androidx.activity.OnBackPressedCallback)1 CallSuper (androidx.annotation.CallSuper)1 BaseRegistrationViewModel (org.thoughtcrime.securesms.registration.viewmodel.BaseRegistrationViewModel)1