From 23ff5493a26804e545a264d6591bccda453c39e4 Mon Sep 17 00:00:00 2001 From: oogee Date: Fri, 29 May 2020 13:29:09 +0300 Subject: [PATCH] shoutbox bug fix (#69) * fix bug where changing the orientation while guest would make EditorView visible * +8dp shoutbox EditorView margin bottom --- .../gr/thmmy/mthmmy/activities/shoutbox/ShoutboxFragment.java | 1 + .../java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxTask.java | 2 +- app/src/main/res/layout/fragment_shoutbox.xml | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxFragment.java b/app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxFragment.java index a24b9155..0049fa6b 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxFragment.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxFragment.java @@ -105,6 +105,7 @@ public class ShoutboxFragment extends Fragment { Timber.i("Shoutbox loaded successfully"); shoutAdapter.setShouts(shoutbox.getShouts()); shoutAdapter.notifyDataSetChanged(); + editorView.setVisibility(shoutbox.getShoutSend() == null ? View.GONE : View.VISIBLE); } }); shoutboxViewModel.setOnShoutboxTaskStarted(this::onShoutboxTaskStarted); diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxTask.java b/app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxTask.java index 59797774..8a1d3768 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxTask.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxTask.java @@ -45,7 +45,7 @@ public class ShoutboxTask extends NewParseTask { String formUrl = shoutboxForm.attr("action"); String sc = shoutboxForm.select("input[name=sc]").first().attr("value"); String shoutName = shoutboxForm.select("input[name=tp-shout-name]").first().attr("value"); - // TODO: make shout send nullable and disable shouting + Element shoutSendInput = shoutboxForm.select("input[name=shout_send]").first(); String shoutSend = null; if (shoutSendInput != null) diff --git a/app/src/main/res/layout/fragment_shoutbox.xml b/app/src/main/res/layout/fragment_shoutbox.xml index 7b2d51e7..69a2649c 100644 --- a/app/src/main/res/layout/fragment_shoutbox.xml +++ b/app/src/main/res/layout/fragment_shoutbox.xml @@ -29,8 +29,9 @@ android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginEnd="8dp" + android:layout_marginBottom="8dp" android:paddingTop="8dp" - android:visibility="visible"/> + android:visibility="gone"/>