Search in sources :

Example 1 with EmailAdapter

use of com.xabber.android.ui.adapter.EmailAdapter in project xabber-android by redsolution.

the class XAccountLinksFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    tvStatusGoogle = view.findViewById(R.id.tvStatusGoogle);
    ivGoogle = view.findViewById(R.id.ivGoogle);
    tvNameGoogle = view.findViewById(R.id.tvNameGoogle);
    tvActionGoogle = view.findViewById(R.id.tvActionGoogle);
    itemGoogle = view.findViewById(R.id.itemGoogle);
    itemGoogle.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (tvActionGoogle.getText().equals(getString(R.string.action_connect)))
                bindListener.onBindClick(AuthManager.PROVIDER_GOOGLE);
            else
                onSocialUnlinkClick(AuthManager.PROVIDER_GOOGLE);
        }
    });
    tvStatusFacebook = view.findViewById(R.id.tvStatusFacebook);
    ivFacebook = view.findViewById(R.id.ivFacebook);
    tvNameFacebook = view.findViewById(R.id.tvNameFacebook);
    tvActionFacebook = view.findViewById(R.id.tvActionFacebook);
    itemFacebook = view.findViewById(R.id.itemFacebook);
    itemFacebook.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (tvActionFacebook.getText().equals(getString(R.string.action_connect)))
                bindListener.onBindClick(AuthManager.PROVIDER_FACEBOOK);
            else
                onSocialUnlinkClick(AuthManager.PROVIDER_FACEBOOK);
        }
    });
    tvStatusTwitter = view.findViewById(R.id.tvStatusTwitter);
    ivTwitter = view.findViewById(R.id.ivTwitter);
    tvNameTwitter = view.findViewById(R.id.tvNameTwitter);
    tvActionTwitter = view.findViewById(R.id.tvActionTwitter);
    itemTwitter = view.findViewById(R.id.itemTwitter);
    itemTwitter.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (tvActionTwitter.getText().equals(getString(R.string.action_connect)))
                bindListener.onBindClick(AuthManager.PROVIDER_TWITTER);
            else
                onSocialUnlinkClick(AuthManager.PROVIDER_TWITTER);
        }
    });
    rvEmails = view.findViewById(R.id.rvEmails);
    rvEmails.setLayoutManager(new LinearLayoutManager(getActivity()));
    emailAdapter = new EmailAdapter(this);
    rvEmails.setAdapter(emailAdapter);
    viewAddEmail = view.findViewById(R.id.viewAddEmail);
    viewAddEmail.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            AddEmailDialogFragment.newInstance().show(getFragmentManager(), AddEmailDialogFragment.class.getSimpleName());
        }
    });
}
Also used : EmailAdapter(com.xabber.android.ui.adapter.EmailAdapter) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView)

Aggregations

View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 EmailAdapter (com.xabber.android.ui.adapter.EmailAdapter)1