Skip to content

Commit

Permalink
fix(discover-fragment): put Posts fragment in the first place
Browse files Browse the repository at this point in the history
Fixes #472
  • Loading branch information
LucasGGamerM committed Jul 22, 2024
1 parent 5b25168 commit 5edbe9b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
for(int i=0;i<tabViews.length;i++){
FrameLayout tabView=new FrameLayout(getActivity());
tabView.setId(switch(i){
case 0 -> R.id.discover_hashtags;
case 1 -> R.id.discover_posts;
case 0 -> R.id.discover_posts;
case 1 -> R.id.discover_hashtags;
case 2 -> R.id.discover_news;
case 3 -> R.id.discover_users;
default -> throw new IllegalStateException("Unexpected value: "+i);
Expand Down Expand Up @@ -127,8 +127,8 @@ public void onPageSelected(int position){
accountsFragment.setArguments(args);

getChildFragmentManager().beginTransaction()
.add(R.id.discover_hashtags, hashtagsFragment)
.add(R.id.discover_posts, postsFragment)
.add(R.id.discover_hashtags, hashtagsFragment)
.add(R.id.discover_news, newsFragment)
.add(R.id.discover_users, accountsFragment)
.commit();
Expand All @@ -138,8 +138,8 @@ public void onPageSelected(int position){
@Override
public void onConfigureTab(@NonNull TabLayout.Tab tab, int position){
tab.setText(switch(position){
case 0 -> R.string.hashtags;
case 1 -> R.string.posts;
case 0 -> R.string.posts;
case 1 -> R.string.hashtags;
case 2 -> R.string.news;
case 3 -> R.string.for_you;
default -> throw new IllegalStateException("Unexpected value: "+position);
Expand Down

0 comments on commit 5edbe9b

Please sign in to comment.