use of androidx.fragment.app.FragmentActivity in project Signal-Android by WhisperSystems.
the class WelcomeFragment method onViewCreated.
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
viewModel = ViewModelProviders.of(requireActivity()).get(RegistrationViewModel.class);
if (viewModel.isReregister()) {
if (viewModel.hasRestoreFlowBeenShown()) {
Log.i(TAG, "We've come back to the home fragment on a restore, user must be backing out");
if (!Navigation.findNavController(view).popBackStack()) {
FragmentActivity activity = requireActivity();
activity.finish();
ActivityNavigator.applyPopAnimationsToPendingTransition(activity);
}
return;
}
initializeNumber();
Log.i(TAG, "Skipping restore because this is a reregistration.");
viewModel.setWelcomeSkippedOnRestore();
SafeNavigation.safeNavigate(Navigation.findNavController(view), WelcomeFragmentDirections.actionSkipRestore());
} else {
setDebugLogSubmitMultiTapView(view.findViewById(R.id.image));
setDebugLogSubmitMultiTapView(view.findViewById(R.id.title));
continueButton = view.findViewById(R.id.welcome_continue_button);
continueButton.setOnClickListener(this::continueClicked);
Button restoreFromBackup = view.findViewById(R.id.welcome_transfer_or_restore);
restoreFromBackup.setOnClickListener(this::restoreFromBackupClicked);
TextView welcomeTermsButton = view.findViewById(R.id.welcome_terms_button);
welcomeTermsButton.setOnClickListener(v -> onTermsClicked());
if (!canUserSelectBackup()) {
restoreFromBackup.setText(R.string.registration_activity__transfer_account);
}
}
}
use of androidx.fragment.app.FragmentActivity in project Signal-Android by WhisperSystems.
the class MediaKeyboard method initView.
private void initView() {
if (!isInitialised) {
LayoutInflater.from(getContext()).inflate(R.layout.media_keyboard, this, true);
if (fragmentManager == null) {
FragmentActivity activity = resolveActivity(getContext());
fragmentManager = activity.getSupportFragmentManager();
}
keyboardPagerFragment = new KeyboardPagerFragment();
fragmentManager.beginTransaction().replace(R.id.media_keyboard_fragment_container, keyboardPagerFragment).commitNowAllowingStateLoss();
keyboardState = State.NORMAL;
latestKeyboardHeight = -1;
isInitialised = true;
}
}
use of androidx.fragment.app.FragmentActivity in project Signal-Android by WhisperSystems.
the class GroupsV1MigrationSuggestionsDialog method display.
private void display() {
AlertDialog dialog = new AlertDialog.Builder(fragmentActivity).setTitle(fragmentActivity.getResources().getQuantityString(R.plurals.GroupsV1MigrationSuggestionsDialog_add_members_question, suggestions.size())).setMessage(fragmentActivity.getResources().getQuantityString(R.plurals.GroupsV1MigrationSuggestionsDialog_these_members_couldnt_be_automatically_added, suggestions.size())).setView(R.layout.dialog_group_members).setPositiveButton(fragmentActivity.getResources().getQuantityString(R.plurals.GroupsV1MigrationSuggestionsDialog_add_members, suggestions.size()), (d, i) -> onAddClicked(d)).setNegativeButton(android.R.string.cancel, (d, i) -> d.dismiss()).show();
GroupMemberListView memberListView = dialog.findViewById(R.id.list_members);
memberListView.initializeAdapter(fragmentActivity);
SimpleTask.run(() -> Recipient.resolvedList(suggestions), memberListView::setDisplayOnlyMembers);
}
use of androidx.fragment.app.FragmentActivity in project mobile-center-sdk-android by Microsoft.
the class EditDateTimeFragment method showTime.
private void showTime() {
FragmentActivity activity = getActivity();
if (activity == null) {
return;
}
Bundle bundle = new Bundle();
bundle.putSerializable(TimePickerFragment.INITIAL_TIME, mDate);
TimePickerFragment fragment = new TimePickerFragment();
fragment.setArguments(bundle);
fragment.setListener(this);
fragment.show(getActivity().getSupportFragmentManager(), "timePicker");
}
use of androidx.fragment.app.FragmentActivity in project mobile-center-sdk-android by Microsoft.
the class EditDateTimeFragment method showDate.
private void showDate() {
FragmentActivity activity = getActivity();
if (activity == null) {
return;
}
Bundle bundle = new Bundle();
bundle.putSerializable(DatePickerFragment.INITIAL_DATE, mDate);
DatePickerFragment fragment = new DatePickerFragment();
fragment.setArguments(bundle);
fragment.setListener(this);
fragment.show(activity.getSupportFragmentManager(), "datePicker");
}
Aggregations