From 1f29db97e36469ad5a31cf9b38c99ac81f047207 Mon Sep 17 00:00:00 2001 From: Dan Roundhill Date: Mon, 16 Dec 2013 20:01:55 -0800 Subject: [PATCH 1/2] =?UTF-8?q?Set=20the=20EditPostContentFragment?= =?UTF-8?q?=E2=80=99s=20layout=20to=20have=20focusableInTouchMode=20enable?= =?UTF-8?q?d=20to=20fix=20#497.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- res/layout/fragment_edit_post_content.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/res/layout/fragment_edit_post_content.xml b/res/layout/fragment_edit_post_content.xml index c68a4c94a659..057e7b9d7f20 100644 --- a/res/layout/fragment_edit_post_content.xml +++ b/res/layout/fragment_edit_post_content.xml @@ -2,7 +2,8 @@ + android:orientation="vertical" + android:focusableInTouchMode="true"> Date: Mon, 16 Dec 2013 20:03:00 -0800 Subject: [PATCH 2/2] =?UTF-8?q?Don=E2=80=99t=20change=20the=20selection=20?= =?UTF-8?q?to=20the=20end=20of=20the=20content=20after=20adding=20media,?= =?UTF-8?q?=20instead=20leave=20the=20cursor=20where=20it=20left=20off.=20?= =?UTF-8?q?Fixes=20#493.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../android/ui/posts/EditPostContentFragment.java | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/org/wordpress/android/ui/posts/EditPostContentFragment.java b/src/org/wordpress/android/ui/posts/EditPostContentFragment.java index 080530cd794c..907d82efb9f2 100644 --- a/src/org/wordpress/android/ui/posts/EditPostContentFragment.java +++ b/src/org/wordpress/android/ui/posts/EditPostContentFragment.java @@ -752,11 +752,6 @@ private void addExistingMediaToEditor(String mediaId) { AlignmentSpan.Standard as = new AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER); s.setSpan(as, selectionStart, selectionEnd + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); s.insert(selectionEnd + 1, "\n\n"); - try { - mContentEditText.setSelection(s.length()); - } catch (Exception e) { - e.printStackTrace(); - } } // load image from server @@ -934,11 +929,6 @@ private void handleMediaGalleryResult(Intent data) { AlignmentSpan.Standard as = new AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER); s.setSpan(as, selectionStart, selectionEnd + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); s.insert(selectionEnd + 1, "\n\n"); - try { - mContentEditText.setSelection(s.length()); - } catch (Exception e) { - e.printStackTrace(); - } } private boolean addMedia(Uri imageUri, SpannableStringBuilder ssb) { @@ -1017,11 +1007,6 @@ private boolean addMedia(Uri imageUri, SpannableStringBuilder ssb) { AlignmentSpan.Standard as = new AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER); s.setSpan(as, selectionStart, selectionEnd + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); s.insert(selectionEnd + 1, "\n\n"); - try { - mContentEditText.setSelection(s.length()); - } catch (Exception e) { - e.printStackTrace(); - } } // Show the soft keyboard after adding media if (mActivity != null && !mActivity.getSupportActionBar().isShowing())