Fixes issue #162 - Cursor's Default Position for replies

This commit is contained in:
stom79 2018-01-06 08:19:26 +01:00
parent 74e356ebe7
commit 8c147d4c0a
6 changed files with 35 additions and 2 deletions

View File

@ -1843,7 +1843,11 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
}
if( tootReply.getMentions() != null ){
//Put other accounts mentioned at the bottom
toot_content.setText(String.format("%s", (toot_content.getText().toString() + "\n\n")));
boolean capitalize = sharedpreferences.getBoolean(Helper.SET_CAPITALIZE, true);
if( capitalize)
toot_content.setText(String.format("%s", (toot_content.getText().toString() + "\n\n")));
else
toot_content.setText(String.format("%s", (toot_content.getText().toString() + " \n")));
for(Mention mention : tootReply.getMentions()){
if( mention.getAcct() != null && !mention.getId().equals(userIdReply) && !mentionedAccountsAdded.contains(mention.getAcct())) {
mentionedAccountsAdded.add(mention.getAcct());

View File

@ -285,6 +285,21 @@ public class SettingsFragment extends Fragment {
}
});
boolean capitalize = sharedpreferences.getBoolean(Helper.SET_CAPITALIZE, true);
final CheckBox set_capitalize = rootView.findViewById(R.id.set_capitalize);
set_capitalize.setChecked(capitalize);
set_capitalize.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_CAPITALIZE, set_capitalize.isChecked());
editor.apply();
}
});
final CheckBox set_embedded_browser = rootView.findViewById(R.id.set_embedded_browser);
final LinearLayout set_javascript_container = rootView.findViewById(R.id.set_javascript_container);
final SwitchCompat set_javascript = rootView.findViewById(R.id.set_javascript);

View File

@ -223,6 +223,7 @@ public class Helper {
public static final String INSTANCE_VERSION = "instance_version";
public static final String SET_LIVE_NOTIFICATIONS = "set_live_notifications";
public static final String SET_DISABLE_GIF = "set_disable_gif";
public static final String SET_CAPITALIZE = "set_capitalize";
public static final int ATTACHMENT_ALWAYS = 1;
public static final int ATTACHMENT_WIFI = 2;
public static final int ATTACHMENT_ASK = 3;

View File

@ -112,6 +112,13 @@
android:text="@string/set_display_global"
android:layout_height="wrap_content" />
<!-- CARRIAGE RETURN AFTER MENTION IN REPLIES -->
<CheckBox
android:id="@+id/set_capitalize"
android:layout_width="wrap_content"
android:text="@string/set_capitalize"
android:layout_height="wrap_content" />
<!-- LIVE NOTIFICATIONS SETTINGS -->
<CheckBox
android:id="@+id/set_live_notify"

View File

@ -112,6 +112,12 @@
android:text="@string/set_display_global"
android:layout_height="wrap_content" />
<!-- CARRIAGE RETURN AFTER MENTION IN REPLIES -->
<CheckBox
android:id="@+id/set_capitalize"
android:layout_width="wrap_content"
android:text="@string/set_capitalize"
android:layout_height="wrap_content" />
<!-- LIVE NOTIFICATIONS SETTINGS -->
<CheckBox

View File

@ -364,7 +364,7 @@
<string name="followed_by">Follows you</string>
<string name="action_search">Search</string>
<string name="set_capitalize">First letter in capital for replies</string>
<!-- Quick settings for notifications -->
<string name="settings_popup_title">Push notifications</string>
<string name="settings_popup_message">