From f6ca688660506a1aff66df2d453ed645e59d79da Mon Sep 17 00:00:00 2001 From: oogee Date: Fri, 23 Nov 2018 21:24:11 +0200 Subject: [PATCH] edit post viewholder style changes --- .../java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java | 3 ++- app/src/main/res/layout/activity_topic_edit_row.xml | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java index bb8bdeb2..11a668d6 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java @@ -711,6 +711,7 @@ class TopicAdapter extends RecyclerView.Adapter { holder.editEditor.requestEditTextFocus(); emojiKeyboard.registerEmojiInputField(holder.editEditor); holder.editEditor.setText(viewModel.getPostBeingEditedText()); + holder.editEditor.getEditText().setSelection(holder.editEditor.getText().length()); holder.editEditor.setOnSubmitListener(view -> { if (holder.editSubject.getText().toString().isEmpty()) return; if (holder.editEditor.getText().toString().isEmpty()) { @@ -727,7 +728,7 @@ class TopicAdapter extends RecyclerView.Adapter { }); if (backPressHidden) { - holder.editEditor.requestFocus(); + holder.editEditor.requestEditTextFocus(); backPressHidden = false; } } diff --git a/app/src/main/res/layout/activity_topic_edit_row.xml b/app/src/main/res/layout/activity_topic_edit_row.xml index 3c29ae33..39b67582 100644 --- a/app/src/main/res/layout/activity_topic_edit_row.xml +++ b/app/src/main/res/layout/activity_topic_edit_row.xml @@ -80,8 +80,10 @@ android:id="@+id/edit_editorview" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" android:background="@color/card_background" - card_view:hint="Post message"/> + card_view:hint="Post message" /> \ No newline at end of file