Fix issue with delete & re-draft

This commit is contained in:
stom79 2018-10-16 18:02:52 +02:00
parent b79108f028
commit 88667d96d7
1 changed files with 8 additions and 10 deletions

View File

@ -47,7 +47,6 @@ import android.text.Html;
import android.text.InputFilter;
import android.text.InputType;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
@ -1855,20 +1854,19 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
}
toRemove.clear();
}
String content;
if( !removed )
content = status.getContent();
else
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
content = Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
else
//noinspection deprecation
content = Html.fromHtml(status.getContent()).toString();
String content = status.getContent();
Pattern mentionLink = Pattern.compile("(<\\s?a\\s?href=\"https?:\\/\\/([\\da-z\\.-]+\\.[a-z\\.]{2,10})\\/(@[\\/\\w._-]*)\"\\s?[^.]*<\\s?\\/\\s?a\\s?>)");
Matcher matcher = mentionLink.matcher(content);
if (matcher.find()) {
content = matcher.replaceAll("$3@$2");
}
if( removed ) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
content = Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY).toString();
else
//noinspection deprecation
content = Html.fromHtml(content).toString();
}
if( attachments != null && attachments.size() > 0){
toot_picture_container.setVisibility(View.VISIBLE);
picture_scrollview.setVisibility(View.VISIBLE);