Its now optional!
This commit is contained in:
parent
fb54948f86
commit
c1d98cad00
7 changed files with 30 additions and 7 deletions
|
@ -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", false);
|
||||
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())
|
||||
|
|
|
@ -299,9 +299,12 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||
sensitiveItem=view.findViewById(R.id.sensitive_item);
|
||||
replyText=view.findViewById(R.id.reply_text);
|
||||
|
||||
publishButton=view.findViewById(R.id.publish);
|
||||
publishButton.setText(editingStatus==null || redraftStatus ? R.string.publish : R.string.save);
|
||||
publishButton.setOnClickListener(this::onPublishClick);
|
||||
if(GlobalUserPreferences.relocatePublishButton){
|
||||
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);
|
||||
}
|
||||
|
||||
mediaBtn.setOnClickListener(v->openFilePicker());
|
||||
pollBtn.setOnClickListener(v->togglePoll());
|
||||
|
@ -636,9 +639,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);
|
||||
|
||||
|
@ -661,7 +666,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);
|
||||
|
|
|
@ -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->{
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
|
@ -321,6 +321,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue