Search in sources :

Example 71 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager in project xabber-android by redsolution.

the class BookmarksActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_bokmarks);
    final Intent intent = getIntent();
    AccountJid account = getAccount(intent);
    if (account == null) {
        finish();
        return;
    }
    accountItem = AccountManager.getInstance().getAccount(account);
    if (accountItem == null) {
        Application.getInstance().onError(R.string.NO_SUCH_ACCOUNT);
        finish();
        return;
    }
    toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    toolbar.setTitle(R.string.account_bookmarks);
    toolbar.inflateMenu(R.menu.toolbar_bookmark_list);
    toolbar.setOnMenuItemClickListener(this);
    barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.server_info_recycler_view);
    bookmarksAdapter = new BookmarkAdapter(this);
    bookmarksAdapter.setListener(this);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(bookmarksAdapter);
    progressBar = findViewById(R.id.server_info_progress_bar);
    tvNotSupport = (TextView) findViewById(R.id.tvNotSupport);
    requestBookmarks(false);
}
Also used : BookmarkAdapter(com.xabber.android.ui.adapter.BookmarkAdapter) AccountJid(com.xabber.android.data.entity.AccountJid) Intent(android.content.Intent) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 72 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager 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)

Example 73 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager in project xabber-android by redsolution.

the class AccountSyncFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    tvLastSyncDate = (TextView) view.findViewById(R.id.tvLastSyncDate);
    switchSyncAll = (Switch) view.findViewById(R.id.switchSyncAll);
    switchSyncAll.setChecked(SettingsManager.isSyncAllAccounts());
    switchSyncAll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
            if (adapter != null)
                adapter.setAllChecked(b);
            saveSyncSettings();
        }
    });
    if (AccountManager.getInstance().haveNotAllowedSyncAccounts())
        switchSyncAll.setEnabled(false);
    setXmppAccounts(XabberAccountManager.getInstance().getXmppAccountsForSync());
    adapter = new XMPPAccountAdapter(getActivity(), this);
    adapter.setItems(xmppAccounts);
    if (adapter != null && SettingsManager.isSyncAllAccounts())
        adapter.setAllChecked(true);
    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.list);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setAdapter(adapter);
}
Also used : XMPPAccountAdapter(com.xabber.android.ui.adapter.XMPPAccountAdapter) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) CompoundButton(android.widget.CompoundButton)

Example 74 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager in project Signal-Android by WhisperSystems.

the class BaseSettingsFragment method onActivityCreated.

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    BaseSettingsAdapter adapter = new BaseSettingsAdapter();
    recycler.setLayoutManager(new LinearLayoutManager(requireContext()));
    recycler.setAdapter(adapter);
    Configuration configuration = (Configuration) Objects.requireNonNull(requireArguments().getSerializable(CONFIGURATION_ARGUMENT));
    configuration.configure(requireActivity(), adapter);
    configuration.setArguments(getArguments());
    configuration.configureAdapter(adapter);
    adapter.submitList(configuration.getSettings());
}
Also used : LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Example 75 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager in project Signal-Android by WhisperSystems.

the class OnboardingMegaphoneView method present.

public void present(@NonNull Megaphone megaphone, @NonNull MegaphoneActionController listener) {
    this.cardList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
    this.cardList.setAdapter(new CardAdapter(getContext(), listener));
}
Also used : LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)470 RecyclerView (androidx.recyclerview.widget.RecyclerView)281 View (android.view.View)183 TextView (android.widget.TextView)65 ArrayList (java.util.ArrayList)37 Nullable (androidx.annotation.Nullable)33 Bundle (android.os.Bundle)32 Toolbar (androidx.appcompat.widget.Toolbar)32 Intent (android.content.Intent)30 ImageView (android.widget.ImageView)27 List (java.util.List)24 Test (org.junit.Test)24 Context (android.content.Context)23 NonNull (androidx.annotation.NonNull)23 ViewGroup (android.view.ViewGroup)22 AlertDialog (androidx.appcompat.app.AlertDialog)21 ContextualCard (com.android.settings.homepage.contextualcards.ContextualCard)20 LayoutInflater (android.view.LayoutInflater)18 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)16 SwipeRefreshLayout (androidx.swiperefreshlayout.widget.SwipeRefreshLayout)16