Search in sources :

Example 56 with RecyclerView

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

the class MessageVH method setupForwarded.

protected void setupForwarded(MessageItem messageItem, MessagesAdapter.MessageExtraData extraData) {
    String[] forwardedIDs = messageItem.getForwardedIdsAsArray();
    if (!Arrays.asList(forwardedIDs).contains(null)) {
        RealmResults<MessageItem> forwardedMessages = MessageDatabaseManager.getInstance().getRealmUiThread().where(MessageItem.class).in(MessageItem.Fields.UNIQUE_ID, forwardedIDs).findAllSorted(MessageItem.Fields.TIMESTAMP, Sort.ASCENDING);
        if (forwardedMessages.size() > 0) {
            RecyclerView recyclerView = forwardLayout.findViewById(R.id.recyclerView);
            ForwardedAdapter adapter = new ForwardedAdapter(forwardedMessages, extraData);
            recyclerView.setLayoutManager(new LinearLayoutManager(extraData.getContext()));
            recyclerView.setAdapter(adapter);
            forwardLayout.setBackgroundColor(ColorManager.getColorWithAlpha(R.color.forwarded_background_color, 0.2f));
            forwardLeftBorder.setBackgroundColor(extraData.getAccountMainColor());
            forwardLayout.setVisibility(View.VISIBLE);
        }
    }
}
Also used : MessageItem(com.xabber.android.data.database.messagerealm.MessageItem) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Example 57 with RecyclerView

use of androidx.recyclerview.widget.RecyclerView 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 58 with RecyclerView

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

the class ForwardedFragment method onCreateView.

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_forwarded, container, false);
    recyclerView = view.findViewById(R.id.recyclerView);
    backgroundView = view.findViewById(R.id.backgroundView);
    return view;
}
Also used : View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) Nullable(androidx.annotation.Nullable)

Example 59 with RecyclerView

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

the class BottomMenu method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.view_bottom_navigation, container, false);
    view.findViewById(R.id.btnRecent).setOnClickListener(this);
    view.findViewById(R.id.btnMenu).setOnClickListener(this);
    btnSearch = (ImageView) view.findViewById(R.id.btnSearch);
    btnSearch.setOnClickListener(this);
    searchLayout = (RelativeLayout) view.findViewById(R.id.searchLayout);
    searchLayout.setOnClickListener(this);
    controlView = (LinearLayout) view.findViewById(R.id.controlView);
    expandSearchLayout = (RelativeLayout) view.findViewById(R.id.expandSearchLayout);
    accountList = (RecyclerView) view.findViewById(R.id.accountList);
    RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
    accountList.setLayoutManager(layoutManager);
    adapter = new AccountShortcutAdapter(items, getActivity(), this);
    accountList.setAdapter(adapter);
    searchView = (SearchView) view.findViewById(R.id.searchView);
    searchView.setQueryHint(getString(R.string.contact_search_hint));
    searchView.setOnQueryTextListener(new android.widget.SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextSubmit(String query) {
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            listener.onSearch(newText);
            return true;
        }
    });
    searchView.setOnCloseListener(new SearchView.OnCloseListener() {

        @Override
        public boolean onClose() {
            closeSearch();
            return true;
        }
    });
    tvUnreadCount = (TextView) view.findViewById(R.id.tvUnreadCount);
    return view;
}
Also used : SearchView(android.widget.SearchView) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) SearchView(android.widget.SearchView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) Nullable(androidx.annotation.Nullable)

Example 60 with RecyclerView

use of androidx.recyclerview.widget.RecyclerView in project greenDAO by greenrobot.

the class MainActivity method setUpViews.

protected void setUpViews() {
    RecyclerView recyclerView = findViewById(R.id.recyclerViewNotes);
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    notesAdapter = new NotesAdapter(noteClickListener);
    recyclerView.setAdapter(notesAdapter);
    addNoteButton = findViewById(R.id.buttonAdd);
    editText = findViewById(R.id.editTextNote);
    RxTextView.editorActions(editText).observeOn(AndroidSchedulers.mainThread()).subscribe(actionId -> {
        if (actionId == EditorInfo.IME_ACTION_DONE) {
            addNote();
        }
    });
    RxTextView.afterTextChangeEvents(editText).observeOn(AndroidSchedulers.mainThread()).subscribe(textViewAfterTextChangeEvent -> {
        boolean enable = textViewAfterTextChangeEvent.editable().length() > 0;
        addNoteButton.setEnabled(enable);
    });
}
Also used : RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Aggregations

RecyclerView (androidx.recyclerview.widget.RecyclerView)272 View (android.view.View)174 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)115 TextView (android.widget.TextView)32 Test (org.junit.Test)24 Nullable (androidx.annotation.Nullable)22 GridLayoutManager (androidx.recyclerview.widget.GridLayoutManager)22 ImageView (android.widget.ImageView)18 Toolbar (androidx.appcompat.widget.Toolbar)18 NonNull (androidx.annotation.NonNull)16 Bundle (android.os.Bundle)15 ViewGroup (android.view.ViewGroup)15 ArrayList (java.util.ArrayList)15 Intent (android.content.Intent)14 Rect (android.graphics.Rect)13 LayoutInflater (android.view.LayoutInflater)11 SuppressLint (android.annotation.SuppressLint)10 Context (android.content.Context)10 ContextualCard (com.android.settings.homepage.contextualcards.ContextualCard)10 List (java.util.List)9