mirror of
https://github.com/accelforce/Yuito
synced 2025-02-15 19:10:44 +01:00
Make DM tab resetable
This commit is contained in:
parent
cc31f7af70
commit
18f859e43e
@ -133,7 +133,6 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut
|
||||
|
||||
private int notificationTabPosition;
|
||||
private MainPagerAdapter adapter;
|
||||
private List<TabData> tabs;
|
||||
|
||||
private final EmojiCompat.InitCallback emojiInitCallback = new EmojiCompat.InitCallback() {
|
||||
@Override
|
||||
@ -254,11 +253,6 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
if (tabs.get(tab.getPosition()).getId().equals(TabDataKt.DIRECT)) {
|
||||
popupView.findViewById(R.id.tab_reset).setVisibility(View.GONE);
|
||||
popupView.findViewById(R.id.tab_text_reset).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
popupView.findViewById(R.id.tab_jump_to_top)
|
||||
.setOnClickListener(v -> {
|
||||
if (adapter != null) {
|
||||
@ -577,7 +571,7 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut
|
||||
}
|
||||
|
||||
private void setupTabs(boolean selectNotificationTab) {
|
||||
tabs = accountManager.getActiveAccount().getTabPreferences();
|
||||
List<TabData> tabs = accountManager.getActiveAccount().getTabPreferences();
|
||||
|
||||
adapter = new MainPagerAdapter(tabs, this);
|
||||
viewPager.setAdapter(adapter);
|
||||
|
@ -200,14 +200,7 @@ class ConversationsFragment : SFragment(), StatusActionListener, Injectable, Res
|
||||
}
|
||||
|
||||
override fun onReset() {
|
||||
viewModel.conversations.observe(this, Observer<PagedList<ConversationEntity>> {
|
||||
adapter.submitList(it)
|
||||
})
|
||||
viewModel.networkState.observe(this, Observer {
|
||||
adapter.setNetworkState(it)
|
||||
})
|
||||
|
||||
viewModel.load()
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
override fun onVoteInPoll(position: Int, choices: MutableList<Int>) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user