diff --git a/app/src/main/java/app/fedilab/android/mastodon/helper/PinnedTimelineHelper.java b/app/src/main/java/app/fedilab/android/mastodon/helper/PinnedTimelineHelper.java index 0d1b7ccbf..6f0c3944a 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/helper/PinnedTimelineHelper.java +++ b/app/src/main/java/app/fedilab/android/mastodon/helper/PinnedTimelineHelper.java @@ -304,7 +304,7 @@ public class PinnedTimelineHelper { //Small hack to hide first tabs (they represent the item of the bottom menu) toRemove = itemToRemoveInBottomMenu(activity); for (int i = 0; i < (FedilabPageAdapter.BOTTOM_TIMELINE_COUNT - toRemove); i++) { - activityMainBinding.tabLayout.addTab(activityMainBinding.tabLayout.newTab()); + activityMainBinding.tabLayout.addTab(activityMainBinding.tabLayout.newTab(), false); ((ViewGroup) activityMainBinding.tabLayout.getChildAt(0)).getChildAt(i).setVisibility(View.GONE); } } @@ -413,7 +413,7 @@ public class PinnedTimelineHelper { //We be used to fetch position of tabs String slug = pinnedTimeline.type.getValue() + (ident != null ? "|" + ident : ""); tab.setTag(slug); - activityMainBinding.tabLayout.addTab(tab); + activityMainBinding.tabLayout.addTab(tab, false); pinnedTimelineVisibleList.add(pinnedTimeline); } } diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/CacheAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/CacheAdapter.java index 1d57715c2..a174273cb 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/CacheAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/CacheAdapter.java @@ -28,6 +28,7 @@ import app.fedilab.android.databinding.DrawerCacheBinding; import app.fedilab.android.mastodon.client.entities.app.CacheAccount; import app.fedilab.android.mastodon.helper.CacheHelper; import app.fedilab.android.mastodon.helper.MastodonHelper; +import app.fedilab.android.peertube.helper.Helper; public class CacheAdapter extends RecyclerView.Adapter { @@ -61,9 +62,17 @@ public class CacheAdapter extends RecyclerView.Adapter public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) { CacheAccount cacheAccount = accountList.get(position); AccountCacheViewHolder holder = (AccountCacheViewHolder) viewHolder; - MastodonHelper.loadPPMastodon(holder.binding.pp, cacheAccount.account.mastodon_account); - holder.binding.acct.setText(String.format("@%s@%s", cacheAccount.account.mastodon_account.username, cacheAccount.account.instance)); - holder.binding.displayName.setText(cacheAccount.account.mastodon_account.display_name); + + if (cacheAccount.account.mastodon_account != null) { + MastodonHelper.loadPPMastodon(holder.binding.pp, cacheAccount.account.mastodon_account); + holder.binding.acct.setText(String.format("@%s@%s", cacheAccount.account.mastodon_account.username, cacheAccount.account.instance)); + holder.binding.displayName.setText(cacheAccount.account.mastodon_account.display_name); + } else if (cacheAccount.account.peertube_account != null) { + Helper.loadAvatar(context, cacheAccount.account.peertube_account, holder.binding.pp); + holder.binding.acct.setText(String.format("@%s@%s", cacheAccount.account.peertube_account.getUsername(), cacheAccount.account.instance)); + holder.binding.displayName.setText(cacheAccount.account.peertube_account.getDisplayName()); + } + CacheHelper.getTimelineValues(context, cacheAccount.account, countStatuses -> { if (countStatuses != null && countStatuses.size() == 3) { holder.binding.homeCount.setText(String.valueOf(countStatuses.get(0)));