|
|
|
@ -66,6 +66,7 @@ import android.view.LayoutInflater;
|
|
|
|
|
import android.view.Menu;
|
|
|
|
|
import android.view.MenuInflater;
|
|
|
|
|
import android.view.MenuItem;
|
|
|
|
|
import android.view.MotionEvent;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
import android.view.inputmethod.InputMethodManager;
|
|
|
|
@ -285,6 +286,25 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
// Wire controls
|
|
|
|
|
spIdentity.setOnItemSelectedListener(identitySelected);
|
|
|
|
|
|
|
|
|
|
View.OnTouchListener onTouchListener = new View.OnTouchListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onTouch(View v, MotionEvent event) {
|
|
|
|
|
EditText et = (EditText) v;
|
|
|
|
|
int sstart = et.getSelectionStart();
|
|
|
|
|
int send = et.getSelectionEnd();
|
|
|
|
|
|
|
|
|
|
if (sstart == send && event.getAction() == MotionEvent.ACTION_DOWN) {
|
|
|
|
|
float x = event.getX() + et.getScrollX();
|
|
|
|
|
float y = event.getY() + et.getScrollY();
|
|
|
|
|
int pos = et.getOffsetForPosition(x, y);
|
|
|
|
|
if (pos >= 0)
|
|
|
|
|
et.setSelection(pos);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
View.OnLongClickListener longClickListener = new View.OnLongClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onLongClick(View v) {
|
|
|
|
@ -309,14 +329,17 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
|
|
|
|
|
etTo.setMaxLines(Integer.MAX_VALUE);
|
|
|
|
|
etTo.setHorizontallyScrolling(false);
|
|
|
|
|
etTo.setOnTouchListener(onTouchListener);
|
|
|
|
|
etTo.setOnLongClickListener(longClickListener);
|
|
|
|
|
|
|
|
|
|
etCc.setMaxLines(Integer.MAX_VALUE);
|
|
|
|
|
etCc.setHorizontallyScrolling(false);
|
|
|
|
|
etCc.setOnTouchListener(onTouchListener);
|
|
|
|
|
etCc.setOnLongClickListener(longClickListener);
|
|
|
|
|
|
|
|
|
|
etBcc.setMaxLines(Integer.MAX_VALUE);
|
|
|
|
|
etBcc.setHorizontallyScrolling(false);
|
|
|
|
|
etBcc.setOnTouchListener(onTouchListener);
|
|
|
|
|
etBcc.setOnLongClickListener(longClickListener);
|
|
|
|
|
|
|
|
|
|
etSubject.setMaxLines(Integer.MAX_VALUE);
|
|
|
|
|