Fixes issue #303
This commit is contained in:
parent
a7c1d68195
commit
4240f504cf
|
@ -1438,19 +1438,25 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
else
|
else
|
||||||
url = status.getUrl();
|
url = status.getUrl();
|
||||||
}
|
}
|
||||||
String extra_text = (status.getReblog() != null)?status.getReblog().getAccount().getAcct():status.getAccount().getAcct();
|
String extra_text;
|
||||||
if( extra_text.split("@").length == 1)
|
boolean share_details = sharedpreferences.getBoolean(Helper.SET_SHARE_DETAILS, true);
|
||||||
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
|
if( share_details) {
|
||||||
else
|
extra_text = (status.getReblog() != null) ? status.getReblog().getAccount().getAcct() : status.getAccount().getAcct();
|
||||||
extra_text = "@" + extra_text;
|
if (extra_text.split("@").length == 1)
|
||||||
extra_text += " " + Helper.shortnameToUnicode(":link:",true) + " " + url + "\r\n-\n";
|
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
|
||||||
final String contentToot;
|
else
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
extra_text = "@" + extra_text;
|
||||||
contentToot = Html.fromHtml((status.getReblog() != null)?status.getReblog().getContent():status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
|
extra_text += " " + Helper.shortnameToUnicode(":link:", true) + " " + url + "\r\n-\n";
|
||||||
else
|
final String contentToot;
|
||||||
//noinspection deprecation
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
contentToot = Html.fromHtml((status.getReblog() != null)?status.getReblog().getContent():status.getContent()).toString();
|
contentToot = Html.fromHtml((status.getReblog() != null) ? status.getReblog().getContent() : status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
|
||||||
extra_text += contentToot;
|
else
|
||||||
|
//noinspection deprecation
|
||||||
|
contentToot = Html.fromHtml((status.getReblog() != null) ? status.getReblog().getContent() : status.getContent()).toString();
|
||||||
|
extra_text += contentToot;
|
||||||
|
}else {
|
||||||
|
extra_text = url;
|
||||||
|
}
|
||||||
sendIntent.putExtra(Intent.EXTRA_TEXT, extra_text);
|
sendIntent.putExtra(Intent.EXTRA_TEXT, extra_text);
|
||||||
sendIntent.setType("text/plain");
|
sendIntent.setType("text/plain");
|
||||||
context.startActivity(Intent.createChooser(sendIntent, context.getString(R.string.share_with)));
|
context.startActivity(Intent.createChooser(sendIntent, context.getString(R.string.share_with)));
|
||||||
|
|
|
@ -239,6 +239,19 @@ public class SettingsFragment extends Fragment {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
boolean share_details = sharedpreferences.getBoolean(Helper.SET_SHARE_DETAILS, true);
|
||||||
|
final CheckBox set_share_details = rootView.findViewById(R.id.set_share_details);
|
||||||
|
set_share_details.setChecked(share_details);
|
||||||
|
|
||||||
|
set_share_details.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||||
|
editor.putBoolean(Helper.SET_SHARE_DETAILS, set_share_details.isChecked());
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
boolean multiaccount_actions = sharedpreferences.getBoolean(Helper.SET_ALLOW_CROSS_ACTIONS, true);
|
boolean multiaccount_actions = sharedpreferences.getBoolean(Helper.SET_ALLOW_CROSS_ACTIONS, true);
|
||||||
final CheckBox set_multiaccount_actions = rootView.findViewById(R.id.set_multiaccount_actions);
|
final CheckBox set_multiaccount_actions = rootView.findViewById(R.id.set_multiaccount_actions);
|
||||||
set_multiaccount_actions.setChecked(multiaccount_actions);
|
set_multiaccount_actions.setChecked(multiaccount_actions);
|
||||||
|
|
|
@ -243,6 +243,7 @@ public class Helper {
|
||||||
public static final String SET_SHOW_BOOKMARK = "set_show_bookmark";
|
public static final String SET_SHOW_BOOKMARK = "set_show_bookmark";
|
||||||
public static final String SET_FULL_PREVIEW = "set_full_preview";
|
public static final String SET_FULL_PREVIEW = "set_full_preview";
|
||||||
public static final String SET_COMPACT_MODE = "set_compact_mode";
|
public static final String SET_COMPACT_MODE = "set_compact_mode";
|
||||||
|
public static final String SET_SHARE_DETAILS = "set_share_details";
|
||||||
public static final int S_512KO = 1;
|
public static final int S_512KO = 1;
|
||||||
public static final int S_1MO = 2;
|
public static final int S_1MO = 2;
|
||||||
public static final int S_2MO = 3;
|
public static final int S_2MO = 3;
|
||||||
|
|
|
@ -171,6 +171,12 @@
|
||||||
android:text="@string/set_compact_mode"
|
android:text="@string/set_compact_mode"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<!-- PUT THE WHOLE CONTENT WHEN SHARING -->
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/set_share_details"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:text="@string/set_share_details"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<!-- Resize pictures -->
|
<!-- Resize pictures -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
@ -169,6 +169,14 @@
|
||||||
android:text="@string/set_compact_mode"
|
android:text="@string/set_compact_mode"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- PUT THE WHOLE CONTENT WHEN SHARING -->
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/set_share_details"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:text="@string/set_share_details"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<!-- Resize pictures -->
|
<!-- Resize pictures -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
|
|
@ -534,6 +534,7 @@
|
||||||
<string name="poxy_password">Password</string>
|
<string name="poxy_password">Password</string>
|
||||||
<string name="set_theme">Theme:</string>
|
<string name="set_theme">Theme:</string>
|
||||||
<string name="set_compact_mode">Compact mode</string>
|
<string name="set_compact_mode">Compact mode</string>
|
||||||
|
<string name="set_share_details">Add toot details when sharing</string>
|
||||||
<string-array translatable="false" name="proxy_type_choice">
|
<string-array translatable="false" name="proxy_type_choice">
|
||||||
<item>HTTP</item>
|
<item>HTTP</item>
|
||||||
<item>SOCKS</item>
|
<item>SOCKS</item>
|
||||||
|
|
Loading…
Reference in New Issue