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);
}
}
}
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);
}
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;
}
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;
}
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);
});
}
Aggregations