From 220fefb666bf1119b41f32366902a792480c27e5 Mon Sep 17 00:00:00 2001 From: Thodoris1999 Date: Tue, 16 Oct 2018 18:07:09 +0300 Subject: [PATCH] fix crash when replying fails --- .../java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java index ae692219..d7284ae8 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java @@ -542,8 +542,8 @@ public class TopicActivity extends BaseActivity implements TopicAdapter.OnPostFo default: Timber.w("Post reply unsuccessful"); Toast.makeText(getBaseContext(), "Post failed!", Toast.LENGTH_SHORT).show(); - recyclerView.getChildAt(topicItems.size() - 1).setAlpha(1); - recyclerView.getChildAt(topicItems.size() - 1).setEnabled(true); + recyclerView.getChildAt(recyclerView.getChildCount() - 1).setAlpha(1f); + recyclerView.getChildAt(recyclerView.getChildCount() - 1).setEnabled(true); } } });