Commit 4c89a855 authored by Thomas's avatar Thomas
Browse files

Some fixes

parent 0ca53b75
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
            }
        }
+12 −3
Original line number Diff line number Diff line
@@ -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<RecyclerView.ViewHolder> {
@@ -61,9 +62,17 @@ public class CacheAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
        CacheAccount cacheAccount = accountList.get(position);
        AccountCacheViewHolder holder = (AccountCacheViewHolder) viewHolder;

        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)));