Fixed top chat message not being visible when keyboard is open

This commit is contained in:
Sylvain Berfini 2018-10-03 17:09:05 +02:00
parent d1fcfa4aa6
commit df51b88bff

View file

@ -111,6 +111,7 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
private LinearLayoutManager layoutManager;
private int mContextMenuMessagePosition;
private ChatScrollListener mChatScrollListener;
private LinearLayout mTopBar;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@ -127,6 +128,7 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
mInflater = inflater;
View view = inflater.inflate(R.layout.chat, container, false);
mTopBar = view.findViewById(R.id.top_bar);
mBackButton = view.findViewById(R.id.back);
mBackButton.setOnClickListener(new View.OnClickListener() {
@ -271,7 +273,7 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
addVirtualKeyboardVisiblityListener();
// Force hide keyboard
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(INPUT_METHOD_SERVICE);
if (getActivity().getCurrentFocus() != null) {
inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
@ -483,10 +485,14 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
public void showKeyboardVisibleMode() {
LinphoneActivity.instance().hideTabBar(true);
LinphoneActivity.instance().hideStatusBar();
mTopBar.setVisibility(View.GONE);
}
public void hideKeyboardVisibleMode() {
LinphoneActivity.instance().hideTabBar(false);
LinphoneActivity.instance().showStatusBar();
mTopBar.setVisibility(View.VISIBLE);
}
/**