diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java index f74811d7..173bd9e0 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java @@ -224,7 +224,7 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF } else if (sessionManager.isLoggedIn() && sectionsPagerAdapter.getCount() == 2) { sectionsPagerAdapter.addFragment(UnreadFragment.newInstance(3), "UNREAD"); - tabLayout.getTabAt(3).setIcon(R.drawable.ic_fiber_new_white_24dp); + tabLayout.getTabAt(2).setIcon(R.drawable.ic_fiber_new_white_24dp); } } //-------------------------------FragmentPagerAdapter END------------------------------------------- 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 11e2d2d4..22d3dbf3 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 @@ -154,6 +154,8 @@ public class ShoutboxFragment extends Fragment implements EmojiKeyboard.EmojiKey progressBar.setVisibility(View.INVISIBLE); if (resultCode == NetworkResultCodes.SUCCESSFUL) { shoutboxViewModel.setShoutbox(shoutbox); + if (shoutbox.getShoutSend() != null) + editorView.setVisibility(View.VISIBLE); } else if (resultCode == NetworkResultCodes.NETWORK_ERROR) { Timber.w("Failed to retreive shoutbox due to network error"); Toast.makeText(getContext(), "NetworkError", Toast.LENGTH_SHORT).show(); 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 23181d35..59797774 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 @@ -46,7 +46,10 @@ public class ShoutboxTask extends NewParseTask { 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 - String shoutSend = shoutboxForm.select("input[name=shout_send]").first().attr("value"); + Element shoutSendInput = shoutboxForm.select("input[name=shout_send]").first(); + String shoutSend = null; + if (shoutSendInput != null) + shoutSend = shoutSendInput.attr("value"); String shoutUrl = shoutboxForm.select("input[name=tp-shout-url]").first().attr("value"); return new Shoutbox(shouts.toArray(new Shout[0]), sc, formUrl, shoutName, shoutSend, shoutUrl); } diff --git a/app/src/main/res/layout/fragment_shoutbox.xml b/app/src/main/res/layout/fragment_shoutbox.xml index cf6dc7a0..c593aeb0 100644 --- a/app/src/main/res/layout/fragment_shoutbox.xml +++ b/app/src/main/res/layout/fragment_shoutbox.xml @@ -29,7 +29,8 @@ android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginEnd="8dp" - android:paddingTop="8dp" /> + android:paddingTop="8dp" + android:visibility="gone"/>