Search in sources :

Example 1 with ChatLinearLayoutManager

use of android.support.v7.widget.ChatLinearLayoutManager in project actor-platform by actorapp.

the class MessagesFragment method configureRecyclerView.

@Override
protected void configureRecyclerView(RecyclerView recyclerView) {
    layoutManager = new ChatLinearLayoutManager(getActivity(), ChatLinearLayoutManager.VERTICAL, true);
    layoutManager.setStackFromEnd(false);
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(layoutManager);
}
Also used : ChatLinearLayoutManager(android.support.v7.widget.ChatLinearLayoutManager)

Example 2 with ChatLinearLayoutManager

use of android.support.v7.widget.ChatLinearLayoutManager in project actor-platform by actorapp.

the class GlobalSearchBaseFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View res = inflater.inflate(R.layout.fragment_global_search, container, false);
    res.setVisibility(View.GONE);
    searchList = (RecyclerView) res.findViewById(R.id.searchList);
    searchList.setLayoutManager(new ChatLinearLayoutManager(getActivity()));
    searchList.addOnScrollListener(new RecyclerView.OnScrollListener() {

        @Override
        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
            if (newState == RecyclerView.SCROLL_STATE_DRAGGING && isSearchVisible) {
                if (searchView != null) {
                    searchView.clearFocus();
                }
            }
        }

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
        }
    });
    searchContainer = res.findViewById(R.id.searchCont);
    searchContainer.setBackgroundColor(ActorSDK.sharedActor().style.getMainBackgroundColor());
    searchEmptyView = (TextView) res.findViewById(R.id.empty);
    searchHintView = (TextView) res.findViewById(R.id.searchHint);
    searchEmptyView.setTextColor(style.getTextSecondaryColor());
    searchHintView.setTextColor(style.getTextSecondaryColor());
    searchHintView.setVisibility(View.GONE);
    searchEmptyView.setVisibility(View.GONE);
    return res;
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) SearchView(android.support.v7.widget.SearchView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) ChatLinearLayoutManager(android.support.v7.widget.ChatLinearLayoutManager) Nullable(android.support.annotation.Nullable)

Aggregations

ChatLinearLayoutManager (android.support.v7.widget.ChatLinearLayoutManager)2 Nullable (android.support.annotation.Nullable)1 RecyclerView (android.support.v7.widget.RecyclerView)1 SearchView (android.support.v7.widget.SearchView)1 View (android.view.View)1 TextView (android.widget.TextView)1