@@ -5209,68 +5209,66 @@ static void *DYYYTabBarHeightContext = &DYYYTabBarHeightContext;
52095209- (void )setHidden:(BOOL )hidden {
52105210 %orig (hidden);
52115211
5212- // 禁用首页刷新功能
5213- if (DYYYGetBool (@" DYYYDisableHomeRefresh" )) {
5214- for (UIView *subview in self.subviews ) {
5215- if ([subview isKindOfClass: generalButtonClass]) {
5216- AWENormalModeTabBarGeneralButton *button = (AWENormalModeTabBarGeneralButton *)subview;
5212+ BOOL disableHomeRefresh = DYYYGetBool (@" DYYYDisableHomeRefresh" );
5213+ BOOL enableFullScreen = DYYYGetBool (@" DYYYEnableFullScreen" );
5214+ BOOL hideBottomBg = DYYYGetBool (@" DYYYHideBottomBg" );
5215+ BOOL hideFriendsButton = DYYYGetBool (@" DYYYHideFriendsButton" );
5216+
5217+ BOOL isHomeSelected = NO ;
5218+ BOOL isFriendsSelected = NO ;
5219+
5220+ for (UIView *subview in self.subviews ) {
5221+ if ([subview isKindOfClass: generalButtonClass]) {
5222+ AWENormalModeTabBarGeneralButton *button = (AWENormalModeTabBarGeneralButton *)subview;
5223+
5224+ // 禁用首页刷新功能
5225+ if (disableHomeRefresh && [button.accessibilityLabel isEqualToString: @" 首页" ]) {
5226+ button.userInteractionEnabled = (button.status != 2 );
5227+ }
5228+
5229+ // 检查当前选中的页
5230+ if (enableFullScreen && button.status == 2 ) {
52175231 if ([button.accessibilityLabel isEqualToString: @" 首页" ]) {
5218- // status == 2 表示选中状态
5219- button.userInteractionEnabled = (button.status != 2 );
5232+ isHomeSelected = YES ;
5233+ } else if ([button.accessibilityLabel containsString: @" 朋友" ]) {
5234+ isFriendsSelected = YES ;
52205235 }
52215236 }
52225237 }
52235238 }
52245239
5225- // 背景和分隔线处理
5226- BOOL hideBottomBg = DYYYGetBool (@" DYYYHideBottomBg" );
5227- BOOL enableFullScreen = DYYYGetBool (@" DYYYEnableFullScreen" );
5228-
52295240 if (hideBottomBg || enableFullScreen) {
52305241 if (self.skinContainerView ) {
52315242 self.skinContainerView .hidden = YES ;
52325243 }
52335244
5234- BOOL isHomeSelected = NO ;
5235- BOOL isFriendsSelected = NO ;
5236-
5237- if (enableFullScreen && !hideBottomBg) {
5238- for (UIView *subview in self.subviews ) {
5239- if ([subview isKindOfClass: generalButtonClass]) {
5240- AWENormalModeTabBarGeneralButton *button = (AWENormalModeTabBarGeneralButton *)subview;
5241- if (button.status == 2 ) {
5242- if ([button.accessibilityLabel isEqualToString: @" 首页" ])
5243- isHomeSelected = YES ;
5244- else if ([button.accessibilityLabel containsString: @" 朋友" ])
5245- isFriendsSelected = YES ;
5246- }
5247- }
5248- }
5245+ BOOL shouldHideBackgrounds = NO ;
5246+ if (hideBottomBg) {
5247+ shouldHideBackgrounds = YES ;
5248+ } else if (enableFullScreen) {
5249+ shouldHideBackgrounds = isHomeSelected || (isFriendsSelected && !hideFriendsButton);
52495250 }
52505251
5251- BOOL hideFriendsButton = DYYYGetBool (@" DYYYHideFriendsButton" );
5252- BOOL shouldHideBackgrounds = hideBottomBg || (enableFullScreen && (isHomeSelected || (isFriendsSelected && !hideFriendsButton)));
5253-
5254- // 单次遍历处理所有背景和分割线
5252+ // 处理所有背景和分割线
52555253 for (UIView *subview in self.subviews ) {
5254+ CGFloat subviewHeight = subview.frame .size .height ;
52565255 // 跳过底栏按钮
52575256 if ([subview isKindOfClass: generalButtonClass] || [subview isKindOfClass: plusButtonClass]) {
52585257 continue ;
52595258 }
52605259 // 隐藏底栏背景
5261- if ([subview isKindOfClass: barBackgroundClass] || ([subview isMemberOfClass: [UIView class ]] && originalTabBarHeight > 0 && fabs (subview. frame . size . height - gCurrentTabBarHeight ) < 0.1 )) {
5260+ if ([subview isKindOfClass: barBackgroundClass] || ([subview isMemberOfClass: [UIView class ]] && originalTabBarHeight > 0 && fabs (subviewHeight - gCurrentTabBarHeight ) < 0.1 )) {
52625261 subview.hidden = shouldHideBackgrounds;
52635262 }
52645263 // 隐藏细分割线
5265- if (subview. frame . size . height > 0 && subview. frame . size . height < 1 && subview.frame .size .width > 300 ) {
5264+ if (subviewHeight > 0 && subviewHeight < 1 && subview.frame .size .width > 300 ) {
52665265 subview.hidden = enableFullScreen;
52675266 }
52685267 }
52695268 } else {
52705269 if (self.skinContainerView ) {
52715270 self.skinContainerView .hidden = NO ;
52725271 }
5273-
52745272 for (UIView *subview in self.subviews ) {
52755273 if ([subview isKindOfClass: barBackgroundClass] || [subview isMemberOfClass: [UIView class ]]) {
52765274 subview.hidden = NO ;
0 commit comments