use of com.xabber.android.ui.adapter.ChatListAdapter in project xabber-android by redsolution.
the class RecentChatFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
View rootView = inflater.inflate(R.layout.recent_chats, container, false);
ArrayList<AbstractChat> activeChats = ((ChatViewer) getActivity()).getChatViewerAdapter().getActiveChats();
((ChatListAdapter) getListAdapter()).updateChats(activeChats);
if (getListAdapter().isEmpty()) {
Activity activity = getActivity();
Toast.makeText(activity, R.string.chat_list_is_empty, Toast.LENGTH_LONG).show();
activity.finish();
}
Toolbar toolbar = (Toolbar) rootView.findViewById(R.id.toolbar_default);
toolbar.setTitle(R.string.recent_chats);
toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NavUtils.navigateUpFromSameTask(getActivity());
}
});
toolbar.inflateMenu(R.menu.recent_chats);
toolbar.setOnMenuItemClickListener(this);
toolbar.setBackgroundColor(ColorManager.getInstance().getAccountPainter().getDefaultMainColor());
return rootView;
}
use of com.xabber.android.ui.adapter.ChatListAdapter in project xabber-android by redsolution.
the class RecentChatFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setListAdapter(new ChatListAdapter(getActivity()));
}
Aggregations