From ade1ce8e057fc824824fba964b2830caa61b9e6a Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Wed, 28 Dec 2022 21:33:55 -0300 Subject: [PATCH 1/5] Adding a send icon. Still havent made use of it though --- .../java/org/joinmastodon/android/GlobalUserPreferences.java | 2 +- mastodon/src/main/res/drawable/ic_fluent_send_24_regular.xml | 3 +++ mastodon/src/main/res/layout/fragment_compose.xml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 mastodon/src/main/res/drawable/ic_fluent_send_24_regular.xml diff --git a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java index 52e6420f6..ac3124565 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java +++ b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java @@ -60,7 +60,7 @@ public class GlobalUserPreferences{ disableMarquee=prefs.getBoolean("disableMarquee", false); disableSwipe=prefs.getBoolean("disableSwipe", false); disableDividers=prefs.getBoolean("disableDividers", true); - relocatePublishButton=prefs.getBoolean("relocatePublishButton", false); + relocatePublishButton=prefs.getBoolean("relocatePublishButton", true); voteButtonForSingleChoice=prefs.getBoolean("voteButtonForSingleChoice", true); theme=ThemePreference.values()[prefs.getInt("theme", 0)]; recentLanguages=fromJson(prefs.getString("recentLanguages", "{}"), recentLanguagesType, new HashMap<>()); diff --git a/mastodon/src/main/res/drawable/ic_fluent_send_24_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_send_24_regular.xml new file mode 100644 index 000000000..a26d4548f --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_send_24_regular.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/mastodon/src/main/res/layout/fragment_compose.xml b/mastodon/src/main/res/layout/fragment_compose.xml index b7f8dba37..931340a0b 100644 --- a/mastodon/src/main/res/layout/fragment_compose.xml +++ b/mastodon/src/main/res/layout/fragment_compose.xml @@ -294,7 +294,7 @@ android:id="@+id/btn_visibility" android:layout_width="24dp" android:layout_height="24dp" - android:layout_marginEnd="24dp" + android:layout_marginEnd="16dp" android:background="?android:attr/selectableItemBackgroundBorderless" android:padding="0px" android:tint="@color/compose_button" From 5937215d3add5c0334137cf175cf8ffc849e97ea Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Wed, 28 Dec 2022 21:50:59 -0300 Subject: [PATCH 2/5] I have done something here --- mastodon/src/main/res/values-sw380dp/publish_button.xml | 4 ++++ mastodon/src/main/res/values/publish_button.xml | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 mastodon/src/main/res/values-sw380dp/publish_button.xml create mode 100644 mastodon/src/main/res/values/publish_button.xml diff --git a/mastodon/src/main/res/values-sw380dp/publish_button.xml b/mastodon/src/main/res/values-sw380dp/publish_button.xml new file mode 100644 index 000000000..e7539ec2f --- /dev/null +++ b/mastodon/src/main/res/values-sw380dp/publish_button.xml @@ -0,0 +1,4 @@ + + + false + \ No newline at end of file diff --git a/mastodon/src/main/res/values/publish_button.xml b/mastodon/src/main/res/values/publish_button.xml new file mode 100644 index 000000000..93ee836b6 --- /dev/null +++ b/mastodon/src/main/res/values/publish_button.xml @@ -0,0 +1,4 @@ + + + true + \ No newline at end of file From 4f7737097760e352098971843d76c1f0013ba3c6 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Wed, 28 Dec 2022 22:26:49 -0300 Subject: [PATCH 3/5] Its a lot less broken than before --- .../android/fragments/ComposeFragment.java | 11 +++++++++-- mastodon/src/main/res/layout/fragment_compose.xml | 10 ++++++++++ 2 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 915dde92b..29cc86c89 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java @@ -299,9 +299,16 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr sensitiveItem=view.findViewById(R.id.sensitive_item); replyText=view.findViewById(R.id.reply_text); + boolean smallStyle = getContext().getResources().getBoolean(R.bool.show_small_publish_button); + if(GlobalUserPreferences.relocatePublishButton){ - publishButton=view.findViewById(R.id.publish); - publishButton.setText(editingStatus==null || redraftStatus ? R.string.publish : R.string.save); + if(smallStyle){ + publishButton=view.findViewById(R.id.publishSmall); +// publishButton. + }else{ + publishButton=view.findViewById(R.id.publish); + publishButton.setText(editingStatus==null || redraftStatus ? R.string.publish : R.string.save); + } publishButton.setOnClickListener(this::onPublishClick); publishButton.setVisibility(View.VISIBLE); } diff --git a/mastodon/src/main/res/layout/fragment_compose.xml b/mastodon/src/main/res/layout/fragment_compose.xml index 931340a0b..a049700fe 100644 --- a/mastodon/src/main/res/layout/fragment_compose.xml +++ b/mastodon/src/main/res/layout/fragment_compose.xml @@ -316,6 +316,16 @@ android:textColor="?android:textColorSecondary" tools:text="500"/> +