|
@@ -49,6 +49,7 @@ import java.util.List;
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
import androidx.annotation.Nullable;
|
|
|
+import androidx.constraintlayout.widget.ConstraintLayout;
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
|
|
/**
|
|
@@ -135,7 +136,7 @@ public class HomePageActivity extends BaseMVPActivity<ActivityHomePageNewLayoutB
|
|
|
TabLayoutMediator tabLayoutMediator = new TabLayoutMediator(viewBinding.tabLayout, viewBinding.viewPager, new TabLayoutMediator.TabConfigurationStrategy() {
|
|
|
@Override
|
|
|
public void onConfigureTab(@NonNull TabLayout.Tab tab, int position) {
|
|
|
- createTab(tab, titles[position]);
|
|
|
+ createTab(tab, titles[position],position);
|
|
|
}
|
|
|
});
|
|
|
initListener();
|
|
@@ -239,7 +240,7 @@ public class HomePageActivity extends BaseMVPActivity<ActivityHomePageNewLayoutB
|
|
|
.navigation();
|
|
|
}
|
|
|
|
|
|
- if (id == R.id.fl_fans_group){
|
|
|
+ if (id == R.id.fl_fans_group) {
|
|
|
//粉丝群
|
|
|
showFansListDialog();
|
|
|
return;
|
|
@@ -251,12 +252,16 @@ public class HomePageActivity extends BaseMVPActivity<ActivityHomePageNewLayoutB
|
|
|
badgeDesDialog.show();
|
|
|
}
|
|
|
|
|
|
- private TabLayout.Tab createTab(TabLayout.Tab tab, String text) {
|
|
|
+ private TabLayout.Tab createTab(TabLayout.Tab tab, String text,int position) {
|
|
|
tab.setCustomView(R.layout.view_homepage_tab_layout);
|
|
|
View customView = tab.getCustomView();
|
|
|
if (customView != null) {
|
|
|
TextView tv_text = customView.findViewById(R.id.tv_text);
|
|
|
+ ConstraintLayout cs_root = customView.findViewById(R.id.cs_root);
|
|
|
tv_text.setText(text);
|
|
|
+ if (position == 0) {
|
|
|
+ cs_root.setPadding(0, 0, SizeUtils.dp2px(15), 0);
|
|
|
+ }
|
|
|
}
|
|
|
return tab;
|
|
|
}
|