use of com.waz.zclient.messages.controllers.EditActionSupport in project wire-android by wireapp.
the class ConversationFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_conversation, viewGroup, false);
extendedCursorContainer = ViewUtils.getView(view, R.id.ecc__conversation);
containerPreview = ViewUtils.getView(view, R.id.fl__conversation_overlay);
cursorLayout = ViewUtils.getView(view, R.id.cl__cursor);
// TODO: remove that once cursorLayout is reimplemented in scala
new EditActionSupport((WireContext) getActivity(), cursorLayout);
audioMessageRecordingView = ViewUtils.getView(view, R.id.amrv_audio_message_recording);
toolbar = ViewUtils.getView(view, R.id.t_conversation_toolbar);
leftMenu = ViewUtils.getView(view, R.id.conversation_left_menu);
toolbarTitle = ViewUtils.getView(toolbar, R.id.tv__conversation_toolbar__title);
shieldView = ViewUtils.getView(view, R.id.sv__conversation_toolbar__verified_shield);
shieldView.setVisibility(View.GONE);
typingIndicatorView = ViewUtils.getView(view, R.id.tiv_typing_indicator_view);
typingIndicatorView.setCallback(this);
listView = ViewUtils.getView(view, R.id.messages_list_view);
toolbar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getControllerFactory().getConversationScreenController().showParticipants(toolbar, false);
}
});
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch(item.getItemId()) {
case R.id.action_audio_call:
getControllerFactory().getCallingController().startCall(false);
cursorLayout.closeEditMessage(false);
return true;
case R.id.action_video_call:
getControllerFactory().getCallingController().startCall(true);
cursorLayout.closeEditMessage(false);
return true;
}
return false;
}
});
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (LayoutSpec.isTablet(getContext()) && ViewUtils.isInLandscape(getContext())) {
return;
}
cursorLayout.closeEditMessage(false);
getActivity().onBackPressed();
KeyboardUtils.closeKeyboardIfShown(getActivity());
}
});
leftMenu.setOnMenuItemClickListener(new ActionMenuView.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch(item.getItemId()) {
case R.id.action_collection:
getCollectionController().openCollection();
return true;
}
return false;
}
});
if (LayoutSpec.isTablet(getContext()) && ViewUtils.isInLandscape(getContext())) {
toolbar.setNavigationIcon(null);
}
conversationLoadingIndicatorViewView = ViewUtils.getView(view, R.id.lbv__conversation__loading_indicator);
if (BuildConfig.SHOW_MENTIONING) {
getChildFragmentManager().beginTransaction().add(R.id.fl__conversation_overlay, MentioningFragment.getInstance(), MentioningFragment.TAG).commit();
}
// invisible footer to scroll over inputfield
invisibleFooter = new FrameLayout(getActivity());
AbsListView.LayoutParams params = new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, getResources().getDimensionPixelSize(R.dimen.cursor__list_view_footer__height));
invisibleFooter.setLayoutParams(params);
cursorLayout.showSendButton(false);
// Recording audio messages
audioMessageRecordingView.setCallback(this);
if (LayoutSpec.isTablet(getActivity())) {
view.setBackgroundColor(Color.WHITE);
}
if (savedInstanceState != null) {
isPreviewShown = savedInstanceState.getBoolean(SAVED_STATE_PREVIEW, false);
}
return view;
}
Aggregations