use of com.waz.zclient.controllers.tracking.events.navigation.OpenedContactsEvent in project wire-android by wireapp.
the class ConversationListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup c, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_conversation_list, c, false);
layoutNoConversations = ViewUtils.getView(view, R.id.ll__conversation_list__no_contacts);
layoutNoConversations.setVisibility(View.GONE);
conversationsListAdapter = new ConversationListAdapter(conversationCallback, getActivity());
conversationsListAdapter.setConversationListMode(mode);
swipeListView = new SwipeListView(getActivity());
FrameLayout.LayoutParams paramsSticky = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
paramsSticky.topMargin = getResources().getDimensionPixelSize(R.dimen.conversation_list__sticky_view__top_margin);
pullForActionContainer = ViewUtils.getView(view, R.id.pfac__conversation_list);
swipeListView.setAllowSwipeAway(true);
swipeListView.setAdapter(conversationsListAdapter);
swipeListView.setOnItemClickListener(this);
swipeListView.setDivider(null);
swipeListView.setVerticalScrollBarEnabled(false);
swipeListView.setSelector(R.drawable.empty_list_view_selector);
swipeListView.setScrollingCacheEnabled(false);
swipeListView.setAnimationCacheEnabled(false);
conversationsListAdapter.setListView(swipeListView);
archiveBox = ViewUtils.getView(view, R.id.ll__archiving_container);
archiveBox.setVisibility(View.INVISIBLE);
swipeListView.post(new Runnable() {
@Override
public void run() {
if (swipeListView != null) {
swipeListView.setOffsetRight(swipeListView.getMeasuredWidth() - // right side offset
getResources().getDimensionPixelOffset(R.dimen.list_menu_distance_threshold));
}
}
});
swipeListView.setOnScrollListener(new ConversationListViewOnScrollListener());
maxSwipeAlpha = ResourceUtils.getResourceFloat(getResources(), R.dimen.list__swipe_max_alpha);
conversationsListAdapter.setMaxAlpha(maxSwipeAlpha);
pullForActionContainer.setPullForActionView(swipeListView, PullForActionContainer.FillType.WRAP);
pullForActionContainer.setPullToActionListener(this);
pullForActionContainer.setPullForActionMode(PullForActionMode.BOTTOM);
pebbleViewX = getResources().getDimensionPixelSize(R.dimen.framework__general__left_padding);
if (mode != Mode.SHARING) {
pebbleViewX += getResources().getDimensionPixelSize(R.dimen.list_extra_padding_when_unread);
}
hintContainer = ViewUtils.getView(view, R.id.ll__conversation_list__hint_container);
hintHeader = ViewUtils.getView(view, R.id.chttv__conversation_list__hint_header);
listActionsView = ViewUtils.getView(view, R.id.lav__conversation_list_actions);
if (mode == Mode.SHARING) {
listActionsView.setVisibility(View.GONE);
} else {
listActionsView.setCallback(new ListActionsView.Callback() {
@Override
public void onAvatarPress() {
getControllerFactory().getPickUserController().showPickUser(IPickUserController.Destination.CONVERSATION_LIST, null);
boolean hintVisible = hintContainer != null && hintContainer.getVisibility() == View.VISIBLE;
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new OpenedContactsEvent(hintVisible));
getControllerFactory().getOnboardingController().hideConversationListHint();
}
@Override
public void onSettingsPress() {
startActivity(ZetaPreferencesActivity.getDefaultIntent(getContext()));
}
});
}
return view;
}
Aggregations