From adba22d32f72308bed29548974838f33966bd1ca Mon Sep 17 00:00:00 2001 From: Thodoris Tyrovouzis Date: Fri, 29 May 2020 11:37:30 +0300 Subject: [PATCH] fix bug where changing the orientation while guest would make EditorView visible --- .../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 | 2 +- 3 files changed, 3 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..ae0e8133 100644 --- a/app/src/main/res/layout/fragment_shoutbox.xml +++ b/app/src/main/res/layout/fragment_shoutbox.xml @@ -30,7 +30,7 @@ android:layout_marginStart="8dp" android:layout_marginEnd="8dp" android:paddingTop="8dp" - android:visibility="visible"/> + android:visibility="gone"/>