1
0
mirror of https://framagit.org/tom79/fedilab-tube synced 2025-06-05 21:09:11 +02:00

Display account

This commit is contained in:
Thomas
2020-06-28 10:02:30 +02:00
parent 9dca09b1d3
commit 37d2e2f034
5 changed files with 60 additions and 53 deletions

View File

@ -268,14 +268,19 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
SpannableString spannableString;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
spannableString = new SpannableString(Html.fromHtml(account.getNote(), FROM_HTML_MODE_LEGACY));
else
spannableString = new SpannableString(Html.fromHtml(account.getNote()));
if( account.getNote() != null && account.getNote().compareTo("null") != 0 && account.getNote().trim().length() > 0 ) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
spannableString = new SpannableString(Html.fromHtml(account.getNote(), FROM_HTML_MODE_LEGACY));
else
spannableString = new SpannableString(Html.fromHtml(account.getNote()));
account.setNoteSpan(spannableString);
account_note.setText(account.getNoteSpan(), TextView.BufferType.SPANNABLE);
account_note.setMovementMethod(LinkMovementMethod.getInstance());
account.setNoteSpan(spannableString);
account_note.setText(account.getNoteSpan(), TextView.BufferType.SPANNABLE);
account_note.setMovementMethod(LinkMovementMethod.getInstance());
account_note.setVisibility(View.VISIBLE);
}else{
account_note.setVisibility(View.GONE);
}
Helper.loadGiF(ShowAccountActivity.this, account, account_pp);
//Follow button
String target = account.getAcct();

View File

@ -362,10 +362,11 @@ public class Helper {
if (url.startsWith("/")) {
url = Helper.getLiveInstance(context) + url;
}
if( !url.startsWith("http")){
url = "https://" + url;
}
try {
Glide.with(imageView.getContext())
.asDrawable()
.load(url)
.thumbnail(0.1f)
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))