Fixes a bug with versions >= N and carriage returns
This commit is contained in:
parent
51a6bf7b7c
commit
861105c90d
|
@ -105,7 +105,7 @@ public class InstanceActivity extends AppCompatActivity implements OnRetrieveIns
|
|||
|
||||
instance_title.setText(instance.getTitle());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
instance_description.setText(Html.fromHtml(instance.getDescription(), Html.FROM_HTML_MODE_COMPACT));
|
||||
instance_description.setText(Html.fromHtml(instance.getDescription(), Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
//noinspection deprecation
|
||||
instance_description.setText(Html.fromHtml(instance.getDescription()));
|
||||
|
|
|
@ -1088,7 +1088,7 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
|
|||
if(tootReply.getReblog() != null)
|
||||
content = tootReply.getReblog().getContent();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
toot_reply_content.setText(Html.fromHtml(content, Html.FROM_HTML_MODE_COMPACT));
|
||||
toot_reply_content.setText(Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
//noinspection deprecation
|
||||
toot_reply_content.setText(Html.fromHtml(content));
|
||||
|
|
|
@ -1567,7 +1567,7 @@ public class API {
|
|||
|
||||
private void post(String action, int timeout, RequestParams params, AsyncHttpResponseHandler responseHandler) {
|
||||
try {
|
||||
client.setConnectTimeout(timeout); //10s timeout
|
||||
client.setConnectTimeout(timeout);
|
||||
client.setUserAgent(USER_AGENT);
|
||||
client.addHeader("Authorization", "Bearer "+prefKeyOauthTokenT);
|
||||
MastalabSSLSocketFactory mastalabSSLSocketFactory = new MastalabSSLSocketFactory(MastalabSSLSocketFactory.getKeystore());
|
||||
|
|
|
@ -174,7 +174,7 @@ public class AccountsListAdapter extends BaseAdapter implements OnPostActionInte
|
|||
else
|
||||
holder.account_ac.setVisibility(View.VISIBLE);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
holder.account_ds.setText(Html.fromHtml(account.getNote(), Html.FROM_HTML_MODE_COMPACT));
|
||||
holder.account_ds.setText(Html.fromHtml(account.getNote(), Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
//noinspection deprecation
|
||||
holder.account_ds.setText(Html.fromHtml(account.getNote()));
|
||||
|
|
|
@ -449,7 +449,7 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
|
|||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
builder.setMessage(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_COMPACT));
|
||||
builder.setMessage(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
//noinspection deprecation
|
||||
builder.setMessage(Html.fromHtml(status.getContent()));
|
||||
|
|
|
@ -196,7 +196,7 @@ public class SearchListAdapter extends BaseAdapter {
|
|||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
holder.status_content.setText(Html.fromHtml(content, Html.FROM_HTML_MODE_COMPACT));
|
||||
holder.status_content.setText(Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
//noinspection deprecation
|
||||
holder.status_content.setText(Html.fromHtml(content));
|
||||
|
|
|
@ -902,7 +902,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
|
|||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
builder.setMessage(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_COMPACT));
|
||||
builder.setMessage(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
//noinspection deprecation
|
||||
builder.setMessage(Html.fromHtml(status.getContent()));
|
||||
|
@ -968,7 +968,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
|
|||
if( isOwner) {
|
||||
if( which == 0) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
builderInner.setMessage(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_COMPACT));
|
||||
builderInner.setMessage(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
//noinspection deprecation
|
||||
builderInner.setMessage(Html.fromHtml(status.getContent()));
|
||||
|
@ -976,7 +976,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
|
|||
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
String content;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
content = Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_COMPACT).toString();
|
||||
content = Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
|
||||
else
|
||||
//noinspection deprecation
|
||||
content = Html.fromHtml(status.getContent()).toString();
|
||||
|
@ -998,7 +998,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
|
|||
builderInner.setMessage(status.getAccount().getAcct());
|
||||
}else if( which == 2) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
builderInner.setMessage(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_COMPACT));
|
||||
builderInner.setMessage(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
//noinspection deprecation
|
||||
builderInner.setMessage(Html.fromHtml(status.getContent()));
|
||||
|
@ -1006,7 +1006,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
|
|||
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
String content;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
content = Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_COMPACT).toString();
|
||||
content = Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
|
||||
else
|
||||
//noinspection deprecation
|
||||
content = Html.fromHtml(status.getContent()).toString();
|
||||
|
|
|
@ -130,7 +130,7 @@ public class SettingsProfileFragment extends Fragment implements OnRetrieveAccou
|
|||
|
||||
final String content;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
content = Html.fromHtml(account.getNote(), Html.FROM_HTML_MODE_COMPACT).toString();
|
||||
content = Html.fromHtml(account.getNote(), Html.FROM_HTML_MODE_LEGACY).toString();
|
||||
else
|
||||
//noinspection deprecation
|
||||
content = Html.fromHtml(account.getNote()).toString();
|
||||
|
|
|
@ -1022,7 +1022,7 @@ public class Helper {
|
|||
|
||||
SpannableString spannableString;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
spannableString = new SpannableString(Html.fromHtml(fullContent, Html.FROM_HTML_MODE_COMPACT));
|
||||
spannableString = new SpannableString(Html.fromHtml(fullContent, Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
//noinspection deprecation
|
||||
spannableString = new SpannableString(Html.fromHtml(fullContent));
|
||||
|
@ -1128,7 +1128,7 @@ public class Helper {
|
|||
SpannableString spannableString;
|
||||
fullContent = Helper.shortnameToUnicode(fullContent, true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
spannableString = new SpannableString(Html.fromHtml(fullContent, Html.FROM_HTML_MODE_COMPACT));
|
||||
spannableString = new SpannableString(Html.fromHtml(fullContent, Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
//noinspection deprecation
|
||||
spannableString = new SpannableString(Html.fromHtml(fullContent));
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
android:id="@+id/toot_reply_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="top|start"
|
||||
android:maxLines="4"
|
||||
android:textStyle="italic"
|
||||
android:autoLink="web"
|
||||
android:textSize="12sp"
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
android:id="@+id/toot_reply_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="top|start"
|
||||
android:maxLines="4"
|
||||
android:textStyle="italic"
|
||||
android:autoLink="web"
|
||||
android:textSize="12sp"
|
||||
|
|
Loading…
Reference in New Issue