mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-01-30 19:05:02 +01:00
fixed tab behaviour
This commit is contained in:
parent
949974af10
commit
3ffdfd96aa
@ -64,7 +64,6 @@ public class MainActivity extends AppCompatActivity implements OnTabSelectedList
|
||||
private FragmentAdapter adapter;
|
||||
private GlobalSettings settings;
|
||||
|
||||
// Views and dialogs
|
||||
private Dialog loadingCircle;
|
||||
private TabLayout tabLayout;
|
||||
private ViewPager pager;
|
||||
|
@ -300,6 +300,7 @@ public class UserlistActivity extends AppCompatActivity implements OnTabSelected
|
||||
|
||||
@Override
|
||||
public void onTabReselected(Tab tab) {
|
||||
adapter.scrollToTop(tab.getPosition());
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,6 +14,7 @@ import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayout.Tab;
|
||||
|
||||
import org.nuclearfog.twidda.R;
|
||||
import org.nuclearfog.twidda.adapter.FragmentAdapter;
|
||||
@ -130,17 +131,18 @@ public class UserlistsActivity extends AppCompatActivity implements TabLayout.On
|
||||
|
||||
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
public void onTabSelected(Tab tab) {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
public void onTabUnselected(Tab tab) {
|
||||
adapter.scrollToTop(tab.getPosition());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
public void onTabReselected(Tab tab) {
|
||||
adapter.scrollToTop(tab.getPosition());
|
||||
}
|
||||
}
|
@ -95,6 +95,7 @@ public class UsersActivity extends AppCompatActivity implements OnTabSelectedLis
|
||||
|
||||
private GlobalSettings settings;
|
||||
private FilterLoader userExclTask;
|
||||
private FragmentAdapter adapter;
|
||||
|
||||
private Toolbar toolbar;
|
||||
private TabLayout tablayout;
|
||||
@ -114,7 +115,7 @@ public class UsersActivity extends AppCompatActivity implements OnTabSelectedLis
|
||||
tablayout = findViewById(R.id.userexclude_tab);
|
||||
ViewPager pager = findViewById(R.id.userexclude_pager);
|
||||
|
||||
FragmentAdapter adapter = new FragmentAdapter(getSupportFragmentManager());
|
||||
adapter = new FragmentAdapter(getSupportFragmentManager());
|
||||
pager.setAdapter(adapter);
|
||||
|
||||
settings = GlobalSettings.getInstance(this);
|
||||
@ -228,11 +229,13 @@ public class UsersActivity extends AppCompatActivity implements OnTabSelectedLis
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(Tab tab) {
|
||||
adapter.scrollToTop(tab.getPosition());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onTabReselected(Tab tab) {
|
||||
adapter.scrollToTop(tab.getPosition());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user