Search in sources :

Example 61 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project Signal-Android by signalapp.

the class CameraContactSelectionFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    this.contactList = view.findViewById(R.id.camera_contacts_list);
    this.selectionList = view.findViewById(R.id.camera_contacts_selected_list);
    this.toolbar = view.findViewById(R.id.camera_contacts_toolbar);
    this.sendButton = view.findViewById(R.id.camera_contacts_send_button);
    this.selectionFooterGroup = view.findViewById(R.id.camera_contacts_footer_group);
    this.cameraContactsEmpty = view.findViewById(R.id.camera_contacts_empty);
    this.inviteButton = view.findViewById(R.id.camera_contacts_invite_button);
    this.contactAdapter = new CameraContactAdapter(GlideApp.with(this), this);
    this.selectionAdapter = new CameraContactSelectionAdapter();
    contactList.setLayoutManager(new LinearLayoutManager(requireContext()));
    contactList.setAdapter(contactAdapter);
    selectionList.setLayoutManager(new LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false));
    selectionList.setAdapter(selectionAdapter);
    ((AppCompatActivity) requireActivity()).setSupportActionBar(toolbar);
    ((AppCompatActivity) requireActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    toolbar.setNavigationOnClickListener(v -> requireActivity().onBackPressed());
    inviteButton.setOnClickListener(v -> onInviteContactsClicked());
    initViewModel();
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Example 62 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project Signal-Android by signalapp.

the class EnterPhoneNumberFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    setDebugLogSubmitMultiTapView(view.findViewById(R.id.verify_header));
    countryCode = view.findViewById(R.id.country_code);
    number = view.findViewById(R.id.number);
    countrySpinner = view.findViewById(R.id.country_spinner);
    cancel = view.findViewById(R.id.cancel_button);
    scrollView = view.findViewById(R.id.scroll_view);
    register = view.findViewById(R.id.registerButton);
    RegistrationNumberInputController controller = new RegistrationNumberInputController(requireContext(), countryCode, number, countrySpinner, true, this);
    register.setOnClickListener(v -> handleRegister(requireContext()));
    disposables.bindTo(getViewLifecycleOwner().getLifecycle());
    viewModel = new ViewModelProvider(requireActivity()).get(RegistrationViewModel.class);
    if (viewModel.isReregister()) {
        cancel.setVisibility(View.VISIBLE);
        cancel.setOnClickListener(v -> Navigation.findNavController(v).navigateUp());
    } else {
        cancel.setVisibility(View.GONE);
    }
    viewModel.getLiveNumber().observe(getViewLifecycleOwner(), controller::updateNumber);
    if (viewModel.hasCaptchaToken()) {
        ThreadUtil.runOnMainDelayed(() -> handleRegister(requireContext()), 250);
    }
    Toolbar toolbar = view.findViewById(R.id.toolbar);
    ((AppCompatActivity) requireActivity()).setSupportActionBar(toolbar);
    ((AppCompatActivity) requireActivity()).getSupportActionBar().setTitle(null);
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) RegistrationNumberInputController(org.thoughtcrime.securesms.registration.util.RegistrationNumberInputController) ViewModelProvider(androidx.lifecycle.ViewModelProvider) RegistrationViewModel(org.thoughtcrime.securesms.registration.viewmodel.RegistrationViewModel) Toolbar(androidx.appcompat.widget.Toolbar)

Example 63 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project Signal-Android by signalapp.

the class BaseKbsPinFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    initializeViews(view);
    viewModel = initializeViewModel();
    viewModel.getUserEntry().observe(getViewLifecycleOwner(), kbsPin -> {
        boolean isEntryValid = kbsPin.length() >= KbsConstants.MINIMUM_PIN_LENGTH;
        confirm.setEnabled(isEntryValid);
        confirm.setAlpha(isEntryValid ? 1f : 0.5f);
    });
    viewModel.getKeyboard().observe(getViewLifecycleOwner(), keyboardType -> {
        updateKeyboard(keyboardType);
        keyboardToggle.setText(resolveKeyboardToggleText(keyboardType));
    });
    description.setOnLinkClickListener(v -> {
        CommunicationActions.openBrowserLink(requireContext(), getString(R.string.BaseKbsPinFragment__learn_more_url));
    });
    Toolbar toolbar = view.findViewById(R.id.kbs_pin_toolbar);
    ((AppCompatActivity) requireActivity()).setSupportActionBar(toolbar);
    ((AppCompatActivity) requireActivity()).getSupportActionBar().setTitle(null);
    initializeListeners();
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) Toolbar(androidx.appcompat.widget.Toolbar)

Example 64 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project WordPress-Login-Flow-Android by wordpress-mobile.

the class LoginBaseFormFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        buildToolbar(toolbar, actionBar);
    }
    if (savedInstanceState == null) {
        EditTextUtils.showSoftInput(getEditTextToFocusOnStart());
    }
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 65 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project WordPress-Login-Flow-Android by wordpress-mobile.

the class SignupMagicLinkFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    Toolbar toolbar = view.findViewById(R.id.toolbar);
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.sign_up_label);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    if (savedInstanceState == null) {
        mAnalyticsListener.trackSignupMagicLinkOpenEmailClientViewed();
    }
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Aggregations

AppCompatActivity (androidx.appcompat.app.AppCompatActivity)74 ActionBar (androidx.appcompat.app.ActionBar)22 Toolbar (androidx.appcompat.widget.Toolbar)19 View (android.view.View)18 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)10 RecyclerView (androidx.recyclerview.widget.RecyclerView)7 Intent (android.content.Intent)6 TextView (android.widget.TextView)6 Fragment (androidx.fragment.app.Fragment)6 Activity (android.app.Activity)5 Bundle (android.os.Bundle)5 BindView (butterknife.BindView)5 LayoutInflater (android.view.LayoutInflater)4 ImageView (android.widget.ImageView)4 ScrollView (android.widget.ScrollView)4 List (java.util.List)4 Nullable (androidx.annotation.Nullable)3 TargetApi (android.annotation.TargetApi)2 Dialog (android.app.Dialog)2 SharedPreferences (android.content.SharedPreferences)2