Search in sources :

Example 1 with QuickConversationAdapter

use of com.applozic.mobicomkit.uiwidgets.conversation.adapter.QuickConversationAdapter in project Applozic-Android-SDK by AppLozic.

the class MobiComQuickConversationFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View list = inflater.inflate(R.layout.mobicom_message_list, container, false);
    recyclerView = (RecyclerView) list.findViewById(R.id.messageList);
    recyclerView.setBackgroundColor(getResources().getColor(R.color.conversation_list_all_background));
    if (messageList != null && !messageList.contains(null)) {
        messageList.add(null);
    }
    recyclerAdapter = new QuickConversationAdapter(getContext(), messageList, null);
    recyclerAdapter.setAlCustomizationSettings(alCustomizationSettings);
    linearLayoutManager = new AlLinearLayoutManager(getContext());
    linearLayoutManager.setOrientation(AlLinearLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(linearLayoutManager);
    DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext());
    recyclerView.addItemDecoration(dividerItemDecoration);
    recyclerView.setAdapter(recyclerAdapter);
    toolbar = (Toolbar) getActivity().findViewById(R.id.my_toolbar);
    toolbar.setClickable(false);
    fabButton = (ImageButton) list.findViewById(R.id.fab_start_new);
    loading = true;
    LinearLayout individualMessageSendLayout = (LinearLayout) list.findViewById(R.id.individual_message_send_layout);
    LinearLayout extendedSendingOptionLayout = (LinearLayout) list.findViewById(R.id.extended_sending_option_layout);
    individualMessageSendLayout.setVisibility(View.GONE);
    extendedSendingOptionLayout.setVisibility(View.GONE);
    emptyTextView = (TextView) list.findViewById(R.id.noConversations);
    emptyTextView.setTextColor(Color.parseColor(alCustomizationSettings.getNoConversationLabelTextColor().trim()));
    fabButton.setVisibility(alCustomizationSettings.isStartNewFloatingButton() ? View.VISIBLE : View.GONE);
    swipeLayout = (SwipeRefreshLayout) list.findViewById(R.id.swipe_container);
    swipeLayout.setColorScheme(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light);
    recyclerView.setLongClickable(true);
    registerForContextMenu(recyclerView);
    ((CustomToolbarListener) getActivity()).setToolbarTitle(ApplozicService.getContext(getContext()).getString(R.string.conversation));
    return list;
}
Also used : QuickConversationAdapter(com.applozic.mobicomkit.uiwidgets.conversation.adapter.QuickConversationAdapter) AlLinearLayoutManager(com.applozic.mobicomkit.uiwidgets.conversation.AlLinearLayoutManager) DividerItemDecoration(com.applozic.mobicomkit.uiwidgets.conversation.activity.DividerItemDecoration) CustomToolbarListener(com.applozic.mobicomkit.uiwidgets.uilistener.CustomToolbarListener) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) LinearLayout(android.widget.LinearLayout)

Aggregations

View (android.view.View)1 ImageView (android.widget.ImageView)1 LinearLayout (android.widget.LinearLayout)1 TextView (android.widget.TextView)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 AlLinearLayoutManager (com.applozic.mobicomkit.uiwidgets.conversation.AlLinearLayoutManager)1 DividerItemDecoration (com.applozic.mobicomkit.uiwidgets.conversation.activity.DividerItemDecoration)1 QuickConversationAdapter (com.applozic.mobicomkit.uiwidgets.conversation.adapter.QuickConversationAdapter)1 CustomToolbarListener (com.applozic.mobicomkit.uiwidgets.uilistener.CustomToolbarListener)1