Compare commits

..

7 Commits

Author SHA1 Message Date
LucasGGamerM
e4340f5015 After hours of looking at the code, i found how to fix it 2022-12-29 13:56:18 -03:00
LucasGGamerM
014398e050 I dont know what i am doing with my life 2022-12-28 22:54:40 -03:00
LucasGGamerM
4f77370977 Its a lot less broken than before 2022-12-28 22:26:49 -03:00
LucasGGamerM
5937215d3a I have done something here 2022-12-28 21:50:59 -03:00
LucasGGamerM
ade1ce8e05 Adding a send icon. Still havent made use of it though 2022-12-28 21:33:55 -03:00
LucasGGamerM
c1d98cad00 Its now optional! 2022-12-28 19:49:38 -03:00
LucasGGamerM
fb54948f86 Its now in the bottom. Time to make it optional 2022-12-28 18:42:13 -03:00
10 changed files with 57 additions and 5 deletions

View File

@@ -29,6 +29,7 @@ public class GlobalUserPreferences{
public static boolean disableDividers;
public static boolean voteButtonForSingleChoice;
public static boolean showDifferentiatedPushNoticationIcons;
public static boolean relocatePublishButton;
public static ThemePreference theme;
public static ColorPreference color;
@@ -59,6 +60,7 @@ public class GlobalUserPreferences{
disableMarquee=prefs.getBoolean("disableMarquee", false);
disableSwipe=prefs.getBoolean("disableSwipe", false);
disableDividers=prefs.getBoolean("disableDividers", true);
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<>());
@@ -89,6 +91,7 @@ public class GlobalUserPreferences{
.putBoolean("disableMarquee", disableMarquee)
.putBoolean("disableSwipe", disableSwipe)
.putBoolean("disableDividers", disableDividers)
.putBoolean("relocatePublishButton", relocatePublishButton)
.putBoolean("showDifferentiatedPushNoticationIcons", showDifferentiatedPushNoticationIcons)
.putInt("theme", theme.ordinal())
.putString("color", color.name())

View File

@@ -299,6 +299,15 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
sensitiveItem=view.findViewById(R.id.sensitive_item);
replyText=view.findViewById(R.id.reply_text);
if(GlobalUserPreferences.relocatePublishButton){
publishButton=view.findViewById(R.id.publish);
// publishButton.setText(editingStatus==null || redraftStatus ? R.string.publish : R.string.save);
publishButton.setEllipsize(TextUtils.TruncateAt.END);
publishButton.setOnClickListener(this::onPublishClick);
publishButton.setSingleLine(true);
publishButton.setVisibility(View.VISIBLE);
}
mediaBtn.setOnClickListener(v->openFilePicker());
pollBtn.setOnClickListener(v->togglePoll());
emojiBtn.setOnClickListener(v->emojiKeyboard.toggleKeyboardPopup(mainEditText));
@@ -632,9 +641,11 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){
publishButton=new Button(getActivity());
publishButton.setText(editingStatus==null || redraftStatus ? R.string.publish : R.string.save);
publishButton.setOnClickListener(this::onPublishClick);
if(!GlobalUserPreferences.relocatePublishButton){
publishButton=new Button(getActivity());
publishButton.setText(editingStatus==null || redraftStatus ? R.string.publish : R.string.save);
publishButton.setOnClickListener(this::onPublishClick);
}
LinearLayout wrap=new LinearLayout(getActivity());
wrap.setOrientation(LinearLayout.HORIZONTAL);
@@ -657,7 +668,10 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
langParams.setMarginEnd(V.dp(8));
wrap.addView(buildLanguageSelector(), langParams);
wrap.addView(publishButton, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
if(!GlobalUserPreferences.relocatePublishButton){
wrap.addView(publishButton, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
}
wrap.setPadding(V.dp(16), V.dp(4), V.dp(16), V.dp(8));
wrap.setClipToPadding(false);
MenuItem item=menu.add(editingStatus==null ? R.string.publish : R.string.save);

View File

@@ -150,6 +150,10 @@ public class SettingsFragment extends MastodonToolbarFragment{
GlobalUserPreferences.save();
needAppRestart=true;
}));
items.add(new SwitchItem(R.string.sk_relocate_publish_button, R.drawable.ic_fluent_arrow_autofit_down_24_regular, GlobalUserPreferences.relocatePublishButton, i->{
GlobalUserPreferences.relocatePublishButton=i.checked;
GlobalUserPreferences.save();
}));
items.add(new HeaderItem(R.string.home_timeline));
items.add(new SwitchItem(R.string.sk_settings_show_replies, R.drawable.ic_fluent_chat_multiple_24_regular, GlobalUserPreferences.showReplies, i->{

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.22 17.219c-0.267 0.266-0.29 0.683-0.073 0.976l0.073 0.084 2.367 2.37C15.713 20.859 15.963 21 16.251 21c0.252 0 0.475-0.109 0.611-0.276l0.053-0.075 2.367-2.37 0.073-0.084c0.193-0.26 0.196-0.619 0.007-0.882l-0.08-0.094-0.084-0.073c-0.261-0.193-0.62-0.196-0.883-0.007l-0.094 0.08L17 18.44V3.656l-0.007-0.089C16.943 3.247 16.63 3 16.25 3s-0.694 0.247-0.743 0.567L15.5 3.657V18.44l-1.22-1.221-0.084-0.073c-0.293-0.218-0.71-0.193-0.976 0.073zm-6.97 2.789C5.007 20.008 4 19 4 17.758v-11.5c0-1.243 1.007-2.25 2.25-2.25h6c0.414 0 0.75 0.336 0.75 0.75s-0.336 0.75-0.75 0.75h-6c-0.414 0-0.75 0.336-0.75 0.75v11.5c0 0.414 0.336 0.75 0.75 0.75h4c0.414 0 0.75 0.336 0.75 0.75s-0.336 0.75-0.75 0.75h-4z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

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="M7.47 12.28l0.084 0.073c0.294 0.218 0.71 0.193 0.977-0.073l2.72-2.72v6.69l0.007 0.102C11.308 16.718 11.62 17 12 17l0.101-0.006c0.367-0.05 0.649-0.364 0.649-0.744V9.56l2.72 2.722 0.084 0.072c0.294 0.218 0.71 0.194 0.977-0.072 0.293-0.293 0.293-0.768 0-1.06l-4-4.002-0.084-0.073c-0.294-0.218-0.71-0.194-0.977 0.073l-4 4-0.073 0.085c-0.218 0.293-0.194 0.71 0.072 0.976zM22.001 12c0-5.523-4.477-10-10-10s-10 4.477-10 10 4.477 10 10 10 10-4.477 10-10zm-18.5 0c0-4.694 3.806-8.5 8.5-8.5s8.5 3.806 8.5 8.5-3.806 8.5-8.5 8.5-8.5-3.806-8.5-8.5z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

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="M5.694 12L2.299 3.27C2.063 2.664 2.655 2.083 3.241 2.29l0.093 0.039 18 9c0.518 0.259 0.55 0.968 0.097 1.284l-0.097 0.058-18 9c-0.583 0.291-1.216-0.245-1.065-0.848l0.03-0.095L5.694 12 2.299 3.27 5.694 12zM4.402 4.54l2.61 6.71h6.627c0.38 0 0.693 0.282 0.743 0.648L14.389 12c0 0.38-0.282 0.693-0.649 0.743l-0.1 0.007H7.01l-2.609 6.71L19.322 12 4.401 4.54z" android:fillColor="?colorButtonText"/>
</vector>

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="M5.694 12L2.299 3.27C2.063 2.664 2.655 2.083 3.241 2.29l0.093 0.039 18 9c0.518 0.259 0.55 0.968 0.097 1.284l-0.097 0.058-18 9c-0.583 0.291-1.216-0.245-1.065-0.848l0.03-0.095L5.694 12 2.299 3.27 5.694 12zM4.402 4.54l2.61 6.71h6.627c0.38 0 0.693 0.282 0.743 0.648L14.389 12c0 0.38-0.282 0.693-0.649 0.743l-0.1 0.007H7.01l-2.609 6.71L19.322 12 4.401 4.54z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

View File

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

View File

@@ -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"
@@ -316,6 +316,16 @@
android:textColor="?android:textColorSecondary"
tools:text="500"/>
<Button
android:id="@+id/publish"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:visibility="gone"
android:tooltipText="@string/publish"
android:drawableStart="@drawable/ic_fluent_send_24_selector"
/>
</LinearLayout>
</org.joinmastodon.android.ui.views.SizeListenerLinearLayout>

View File

@@ -38,6 +38,7 @@
<string name="sk_settings_always_reveal_content_warnings">Always reveal content warnings</string>
<string name="sk_disable_marquee">Disable scrolling text in title bars</string>
<string name="sk_disable_dividers">Disable toot dividers</string>
<string name="sk_relocate_publish_button">Relocate publish button</string>
<string name="sk_settings_contribute">Contribute to Moshidon</string>
<string name="sk_settings_show_federated_timeline">Show federated timeline</string>
<string name="sk_notification_type_status">Posts</string>