forked from mirrors/Fedilab
Some fixes
This commit is contained in:
parent
0ca53b75d2
commit
4c89a855c6
2 changed files with 14 additions and 5 deletions
|
@ -304,7 +304,7 @@ public class PinnedTimelineHelper {
|
||||||
//Small hack to hide first tabs (they represent the item of the bottom menu)
|
//Small hack to hide first tabs (they represent the item of the bottom menu)
|
||||||
toRemove = itemToRemoveInBottomMenu(activity);
|
toRemove = itemToRemoveInBottomMenu(activity);
|
||||||
for (int i = 0; i < (FedilabPageAdapter.BOTTOM_TIMELINE_COUNT - toRemove); i++) {
|
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);
|
((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
|
//We be used to fetch position of tabs
|
||||||
String slug = pinnedTimeline.type.getValue() + (ident != null ? "|" + ident : "");
|
String slug = pinnedTimeline.type.getValue() + (ident != null ? "|" + ident : "");
|
||||||
tab.setTag(slug);
|
tab.setTag(slug);
|
||||||
activityMainBinding.tabLayout.addTab(tab);
|
activityMainBinding.tabLayout.addTab(tab, false);
|
||||||
pinnedTimelineVisibleList.add(pinnedTimeline);
|
pinnedTimelineVisibleList.add(pinnedTimeline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ import app.fedilab.android.databinding.DrawerCacheBinding;
|
||||||
import app.fedilab.android.mastodon.client.entities.app.CacheAccount;
|
import app.fedilab.android.mastodon.client.entities.app.CacheAccount;
|
||||||
import app.fedilab.android.mastodon.helper.CacheHelper;
|
import app.fedilab.android.mastodon.helper.CacheHelper;
|
||||||
import app.fedilab.android.mastodon.helper.MastodonHelper;
|
import app.fedilab.android.mastodon.helper.MastodonHelper;
|
||||||
|
import app.fedilab.android.peertube.helper.Helper;
|
||||||
|
|
||||||
|
|
||||||
public class CacheAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
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) {
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
|
||||||
CacheAccount cacheAccount = accountList.get(position);
|
CacheAccount cacheAccount = accountList.get(position);
|
||||||
AccountCacheViewHolder holder = (AccountCacheViewHolder) viewHolder;
|
AccountCacheViewHolder holder = (AccountCacheViewHolder) viewHolder;
|
||||||
|
|
||||||
|
if (cacheAccount.account.mastodon_account != null) {
|
||||||
MastodonHelper.loadPPMastodon(holder.binding.pp, cacheAccount.account.mastodon_account);
|
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.acct.setText(String.format("@%s@%s", cacheAccount.account.mastodon_account.username, cacheAccount.account.instance));
|
||||||
holder.binding.displayName.setText(cacheAccount.account.mastodon_account.display_name);
|
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 -> {
|
CacheHelper.getTimelineValues(context, cacheAccount.account, countStatuses -> {
|
||||||
if (countStatuses != null && countStatuses.size() == 3) {
|
if (countStatuses != null && countStatuses.size() == 3) {
|
||||||
holder.binding.homeCount.setText(String.valueOf(countStatuses.get(0)));
|
holder.binding.homeCount.setText(String.valueOf(countStatuses.get(0)));
|
||||||
|
|
Loading…
Reference in a new issue