Closed jueran closed 7 years ago
`` @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_chat, container, false); ButterKnife.bind(this, view); initRecyclerView(); initEmojiRecyclerView(); // panelRoot.setIgnoreRecommendHeight(true); KeyboardUtil.attach(getActivity(),panelRoot); KPSwitchConflictUtil.attach(panelRoot, chatFragmentEmoji, liveEdittext, new KPSwitchConflictUtil.SwitchClickListener() { @Override public void onClickSwitch(boolean switchToPanel) { } }); liveChatRecyclerview.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { if (motionEvent.getAction() == MotionEvent.ACTION_UP) { KPSwitchConflictUtil.hidePanelAndKeyboard(panelRoot); } return false; } }); return view; }
已解决,是因为,我的activity是全屏的,应该使用KPSwitchFSPanelRelativeLayout,但是我错误使用了KPSwitchPanelRelativeLayout。导致了这个问题
`` @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_chat, container, false); ButterKnife.bind(this, view); initRecyclerView(); initEmojiRecyclerView(); // panelRoot.setIgnoreRecommendHeight(true); KeyboardUtil.attach(getActivity(),panelRoot); KPSwitchConflictUtil.attach(panelRoot, chatFragmentEmoji, liveEdittext, new KPSwitchConflictUtil.SwitchClickListener() { @Override public void onClickSwitch(boolean switchToPanel) { } }); liveChatRecyclerview.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { if (motionEvent.getAction() == MotionEvent.ACTION_UP) { KPSwitchConflictUtil.hidePanelAndKeyboard(panelRoot); } return false; } }); return view; }