Commit 751570e0 by Kunj Gupta

Fixed - Issue#51 - v0.0.33_last message getting overlapped

.
parent 099662d1
......@@ -184,6 +184,34 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
}
});
//Below code for - Last message getting overlapped when virtual keyboard is opened.
mInputMessageView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if(motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
if(mMessagesView.getAdapter().getItemCount() > 0) {
mMessagesView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v,
int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
if (bottom < oldBottom) {
mMessagesView.postDelayed(new Runnable() {
@Override
public void run() {
mMessagesView.smoothScrollToPosition(
mMessagesView.getAdapter().getItemCount() - 1);
}
}, 100);
}
}
});
}
}
return false;
}
});
droidSpeech = new DroidSpeech(this, getSupportFragmentManager());
droidSpeech.setOnDroidSpeechListener(this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment