From 1206ce6efc15140a0be87680e0f7e5c495d6aac5 Mon Sep 17 00:00:00 2001 From: FineFindus <63370021+FineFindus@users.noreply.github.com> Date: Tue, 10 Jan 2023 15:43:26 +0100 Subject: [PATCH] feat(compose): move charCounter to action bar if relocatePublishButton is enabled --- .../android/fragments/ComposeFragment.java | 10 ++++++++-- mastodon/src/main/res/layout/compose_action.xml | 10 ++++++++++ mastodon/src/main/res/layout/fragment_compose.xml | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java index d870d2257..54bd6961a 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java @@ -307,12 +307,14 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr draftsBtn=view.findViewById(R.id.drafts_btn); draftsBtn.setVisibility(View.VISIBLE); + } else { + charCounter=view.findViewById(R.id.char_counter); + charCounter.setVisibility(View.VISIBLE); + charCounter.setText(String.valueOf(charLimit)); } mainEditText=view.findViewById(R.id.toot_text); mainEditTextWrap=view.findViewById(R.id.toot_text_wrap); - charCounter=view.findViewById(R.id.char_counter); - charCounter.setText(String.valueOf(charLimit)); scrollView=view.findViewById(R.id.scroll_view); selfName=view.findViewById(R.id.self_name); @@ -748,6 +750,10 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr draftsBtn = wrap.findViewById(R.id.drafts_btn); draftsBtn.setVisibility(View.VISIBLE); + }else{ + charCounter = wrap.findViewById(R.id.char_counter); + charCounter.setVisibility(View.VISIBLE); + charCounter.setText(String.valueOf(charLimit)); } // draftsBtn = wrap.findViewById(R.id.drafts_btn); diff --git a/mastodon/src/main/res/layout/compose_action.xml b/mastodon/src/main/res/layout/compose_action.xml index 7f3109061..e57394af9 100644 --- a/mastodon/src/main/res/layout/compose_action.xml +++ b/mastodon/src/main/res/layout/compose_action.xml @@ -1,5 +1,6 @@ + +