Some fixes

This commit is contained in:
tom79 2019-09-30 17:56:15 +02:00
parent a42ab35702
commit 497da30eb3
2 changed files with 14 additions and 3 deletions

View File

@ -699,8 +699,13 @@ public abstract class BaseMainActivity extends BaseActivity
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.mastodonC4), PorterDuff.Mode.SRC_IN);
if (viewPager.getAdapter() != null) {
Fragment fragment = (Fragment) viewPager.getAdapter().instantiateItem(viewPager, tab.getPosition());
DisplayStatusFragment displayStatusFragment = ((DisplayStatusFragment) fragment);
displayStatusFragment.scrollToTop();
if( fragment instanceof DisplayStatusFragment) {
DisplayStatusFragment displayStatusFragment = ((DisplayStatusFragment) fragment);
displayStatusFragment.scrollToTop();
}else if(fragment instanceof DisplayNotificationsFragment){
DisplayNotificationsFragment displayNotificationsFragment = ((DisplayNotificationsFragment) fragment);
displayNotificationsFragment.scrollToTop();
}
}
}
}

View File

@ -587,9 +587,15 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
}else if(status.getMedia_attachments() != null ){
holder.art_media.setVisibility(View.VISIBLE);
holder.imageSlider.setVisibility(View.GONE);
String url;
if(status.getMedia_attachments().get(0).getPreview_url().endsWith("no-preview.png") ){
url = status.getMedia_attachments().get(0).getUrl();
}else{
url = status.getMedia_attachments().get(0).getPreview_url();
}
GlideApp.with(context)
.asBitmap()
.load(status.getMedia_attachments().get(0).getPreview_url())
.load(url)
.into(holder.art_media);
}