Add a drafts icon on the relocated publish button

This commit is contained in:
LucasGGamerM 2023-01-01 16:53:31 -03:00
parent f4c573a95e
commit a617693f93
4 changed files with 26 additions and 3 deletions

View File

@ -1644,9 +1644,15 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
scheduleDraftText.setText(R.string.sk_compose_draft); scheduleDraftText.setText(R.string.sk_compose_draft);
scheduleDraftText.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_fluent_drafts_20_regular, 0, 0, 0); scheduleDraftText.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_fluent_drafts_20_regular, 0, 0, 0);
scheduleDraftDismiss.setContentDescription(getString(R.string.sk_compose_no_draft)); scheduleDraftDismiss.setContentDescription(getString(R.string.sk_compose_no_draft));
draftsBtn.setCompoundDrawablesWithIntrinsicBounds(GlobalUserPreferences.relocatePublishButton ? R.drawable.ic_fluent_drafts_24_filled : R.drawable.ic_fluent_drafts_20_filled, 0, 0, 0); draftsBtn.setCompoundDrawablesWithIntrinsicBounds(GlobalUserPreferences.relocatePublishButton ? R.drawable.ic_fluent_drafts_24_regular : R.drawable.ic_fluent_drafts_20_filled, 0, 0, 0);
publishButton.setText(scheduledStatus != null && scheduledStatus.scheduledAt.isAfter(DRAFTS_AFTER_INSTANT)
? R.string.save : R.string.sk_draft); if(GlobalUserPreferences.relocatePublishButton){
publishButton.setCompoundDrawablesWithIntrinsicBounds(scheduledStatus != null && scheduledStatus.scheduledAt.isAfter(DRAFTS_AFTER_INSTANT)
? R.drawable.ic_fluent_save_24_filled : R.drawable.ic_fluent_drafts_24_selector, 0, 0, 0);
}else{
publishButton.setText(scheduledStatus != null && scheduledStatus.scheduledAt.isAfter(DRAFTS_AFTER_INSTANT)
? R.string.save : R.string.sk_draft);
}
} else { } else {
scheduleMenuItem.setVisible(false); scheduleMenuItem.setVisible(false);
unscheduleMenuItem.setVisible(true); unscheduleMenuItem.setVisible(true);

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M13.94 5l5.061 5.06L9.063 20c-0.277 0.277-0.621 0.477-1 0.58l-5.115 1.395c-0.56 0.153-1.073-0.361-0.92-0.921l1.394-5.116c0.103-0.377 0.303-0.722 0.58-0.999L13.94 5zm-7.414 6l-1.5 1.5H2.75C2.337 12.5 2 12.165 2 11.75 2 11.336 2.337 11 2.75 11h3.775zm14.352-8.174l0.153 0.144 0.145 0.153c1.25 1.405 1.203 3.56-0.145 4.908L20.061 9 15 3.94l0.97-0.97c1.348-1.348 3.503-1.396 4.908-0.144zM10.526 7l-1.5 1.5H2.75C2.337 8.5 2 8.165 2 7.75 2 7.336 2.337 7 2.75 7h7.775zm4-4l-1.5 1.5H2.75C2.337 4.5 2 4.165 2 3.75 2 3.336 2.337 3 2.75 3h11.775z" android:fillColor="?colorButtonText"/>
</vector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_fluent_drafts_24_filled_enabled" android:state_enabled="true"/>
<item android:drawable="@drawable/ic_fluent_drafts_24_regular"/>
</selector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M6.75,3H5.75C4.231,3 3,4.231 3,5.75V18.25C3,19.769 4.231,21 5.75,21H6V15C6,13.757 7.007,12.75 8.25,12.75H15.75C16.993,12.75 18,13.757 18,15V21H18.25C19.769,21 21,19.769 21,18.25V8.286C21,7.424 20.658,6.597 20.048,5.987L18.013,3.952C17.411,3.351 16.599,3.009 15.75,3V7.5C15.75,8.743 14.743,9.75 13.5,9.75H9C7.757,9.75 6.75,8.743 6.75,7.5V3ZM14.25,3V7.5C14.25,7.914 13.914,8.25 13.5,8.25H9C8.586,8.25 8.25,7.914 8.25,7.5V3H14.25ZM16.5,21V15C16.5,14.586 16.164,14.25 15.75,14.25H8.25C7.836,14.25 7.5,14.586 7.5,15V21H16.5Z"
android:fillColor="#212121"/>
</vector>