use of com.waz.zclient.BaseScalaActivity in project wire-android by wireapp.
the class QuickReplyFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.layout_quick_reply, container, false);
name = ViewUtils.getView(view, R.id.ttv__quick_reply__name);
counter = ViewUtils.getView(view, R.id.ttv__quick_reply__counter);
counter.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new SwitchedMessageInQuickReplyEvent());
contentContainer.smoothScrollToPosition((layoutManager.findFirstVisibleItemPosition() + 1) % adapter.getItemCount());
}
});
contentContainer = ViewUtils.getView(view, R.id.rv__quick_reply__content_container);
contentContainer.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new SwitchedMessageInQuickReplyEvent());
updateScrolledItemText();
}
}
});
layoutManager = new ViewPagerLikeLayoutManager(getContext());
contentContainer.setLayoutManager(layoutManager);
message = ViewUtils.getView(view, R.id.tet__quick_reply__message);
message.setOnEditorActionListener(this);
openWire = ViewUtils.getView(view, R.id.ll__quick_reply__open_external);
openWire.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (getActivity() == null || conversation == null || message == null) {
return;
}
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new OpenedAppFromQuickReplyEvent());
Intent appLaunchIntent = IntentUtils.getAppLaunchIntent(getContext(), conversation.getId(), message.getText().toString());
startActivity(appLaunchIntent);
getActivity().finish();
}
});
return view;
}
Aggregations