use of im.actor.sdk.controllers.conversation.quote.QuoteFragment in project actor-platform by actorapp.
the class ChatFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View res = inflater.inflate(R.layout.fragment_chat, container, false);
quoteContainer = res.findViewById(R.id.quoteFragment);
res.findViewById(R.id.sendContainer).setBackgroundColor(style.getMainBackgroundColor());
inputContainer = res.findViewById(R.id.sendFragment);
inputOverlayContainer = res.findViewById(R.id.inputOverlay);
inputOverlayContainer.setBackgroundColor(style.getMainBackgroundColor());
inputOverlayText = (TextView) res.findViewById(R.id.overlayText);
inputOverlayText.setOnClickListener(view -> onOverlayPressed());
inputOverlayContainer.setVisibility(View.GONE);
emptyContainer = res.findViewById(R.id.emptyPlaceholder);
emptyContainer.setVisibility(View.GONE);
if (savedInstanceState == null) {
Fragment toolbarFragment = ActorSDK.sharedActor().getDelegate().fragmentForToolbar(peer);
if (toolbarFragment == null) {
toolbarFragment = new ChatToolbarFragment(peer);
}
InputBarFragment inputBarFragment = ActorSDK.sharedActor().getDelegate().fragmentForChatInput();
if (inputBarFragment == null) {
inputBarFragment = new InputBarFragment();
}
AutocompleteFragment autocompleteFragment = ActorSDK.sharedActor().getDelegate().fragmentForAutocomplete(peer);
if (autocompleteFragment == null) {
autocompleteFragment = AutocompleteFragment.create(peer);
autocompleteFragment.setUnderlyingView(res.findViewById(R.id.messagesFragment));
}
QuoteFragment quoteFragment = ActorSDK.sharedActor().getDelegate().fragmentForQuote();
if (quoteFragment == null) {
quoteFragment = new QuoteFragment();
}
MessagesDefaultFragment messagesDefaultFragment = MessagesDefaultFragment.create(peer);
messagesDefaultFragment.setNewMessageListener(inputBarFragment);
getChildFragmentManager().beginTransaction().add(toolbarFragment, "toolbar").add(R.id.messagesFragment, messagesDefaultFragment).add(R.id.sendFragment, inputBarFragment).add(R.id.quoteFragment, quoteFragment).add(R.id.emptyPlaceholder, new EmptyChatPlaceholder()).add(R.id.autocompleteContainer, autocompleteFragment).commitNow();
AbsAttachFragment fragment = ActorSDK.sharedActor().getDelegate().fragmentForAttachMenu(peer);
if (fragment == null) {
fragment = new AttachFragment(peer);
}
getFragmentManager().beginTransaction().add(R.id.overlay, fragment).commit();
}
return res;
}
Aggregations