speed up settings menu loading

This commit is contained in:
TrueZhuanjia committed 2025-06-05 16:03:01 +08:00
1 parent 01e379eefe
commit b036e01afc
5 files changed
+31 -10

No files matched your search

+3 -3
View File
@@ -54,7 +54,7 @@
<!--Settings View Controller-->
<scene sceneID="tWo-uo-hHg">
<objects>
<viewController id="BsV-3c-455" customClass="SettingsViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="settingsViewController" id="BsV-3c-455" customClass="SettingsViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="ef6-uF-5Hh"/>
<viewControllerLayoutGuide type="bottom" id="XvO-F3-j4u"/>
@@ -1268,13 +1268,13 @@ ICAgICAgICAgICAgICA
<image name="SquaresArrowUp" width="40" height="40"/>
<image name="Trash" width="40" height="40"/>
<systemColor name="secondaryLabelColor">
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemBrownColor">
<color red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.63529411764705879" green="0.51764705882352946" blue="0.36862745098039218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
+4 -2
View File
@@ -231,12 +231,14 @@
- (void)addSubStackView:(UIStackView *)stackView {
[CATransaction begin];
[CATransaction setDisableActions:YES];
[UIView performWithoutAnimation:^{
if (![_subStackViews containsObject:stackView]) {
[_subStackViews addObject:stackView];
[_rootStackView addArrangedSubview:stackView];
[_rootStackView layoutIfNeeded];
[self updateLayout];
//[_rootStackView layoutIfNeeded];
//[self updateLayout];
}
}];
[CATransaction commit];
// NSLog(@"rootStack height2: %f", _rootStackView.frame.size.height);
}
@@ -1531,6 +1531,14 @@ static NSMutableSet* hostList;
// SettingsViewController* settingsViewController = (SettingsViewController*)[self.revealViewController rearViewController];
// [settingsViewController updateResolutionTable];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPad" bundle:nil];
SettingsViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"settingsViewController"];
// 强制加载视图
__unused UIView *view = viewController.view;
}
-(void)viewDidLayoutSubviews{
@@ -631,6 +631,7 @@ static CGFloat scaledValue( CGFloat v1, CGFloat min2, CGFloat max2, CGFloat min1
SWContextTransitionObject *_rearTransitioningController;
SWContextTransitionObject *_frontTransitioningController;
SWContextTransitionObject *_rightTransitioningController;
CGFloat timeStamp;
}
@end
@@ -1263,6 +1264,7 @@ const int FrontViewPositionNone = 0xff;
- (IBAction)revealToggle:(id)sender
{
timeStamp = CACurrentMediaTime();
[self revealToggleAnimated:YES];
}
@@ -1907,9 +1909,11 @@ const int FrontViewPositionNone = 0xff;
deploymentCompletion();
if ( positionIsChanging )
{
if ( [self->_delegate respondsToSelector:@selector(revealController:didMoveToPosition:)] )
if ( [self->_delegate respondsToSelector:@selector(revealController:didMoveToPosition:)] ){
NSLog(@"expansion: %f", CACurrentMediaTime() - self->timeStamp);
[self->_delegate revealController:self didMoveToPosition:newPosition];
}
}
};
return completion;
@@ -308,7 +308,7 @@ BOOL isCustomResolution(CGSize res) {
}
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
[super viewDidAppear:NO];
[self updateResolutionTable];
//[self updateTheme];
NSLog(@"Resolution table updated");
@@ -334,7 +334,7 @@ BOOL isCustomResolution(CGSize res) {
- (void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
[super viewDidDisappear:NO];
[[NSNotificationCenter defaultCenter] postNotificationName:@"SettingsViewClosedNotification" object:self]; // notify other view that settings view just closed
}
@@ -415,6 +415,7 @@ BOOL isCustomResolution(CGSize res) {
}
- (void)layoutSections{
NSLog(@"preLoad Log test");
MenuSectionView *videoSection = [[MenuSectionView alloc] init];
videoSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Video"];
if (@available(iOS 13.0, *)) {
@@ -823,6 +824,9 @@ BOOL isCustomResolution(CGSize res) {
- (void)viewDidLoad {
//[self updateTheme];
[UIView performWithoutAnimation:^{
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"_UIConstraintBasedLayoutLogUnsatisfiable"];
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
@@ -870,17 +874,19 @@ BOOL isCustomResolution(CGSize res) {
currentSettingsMenuMode = currentSettings.settingsMenuMode.intValue;
[self loadFavoriteSettingStackIdentifiers];
if(currentSettings.settingsMenuMode.intValue == FavoriteSettings) [self switchToFavoriteSettings];
/*
switch (currentSettingsMenuMode) {
case FavoriteSettings:
[self switchToFavoriteSettings];
break;
case AllSettings:
[self switchToAllSettings];
//[self switchToAllSettings];
break;
default:
break;
}
*/
// Ensure we pick a bitrate that falls exactly onto a slider notch
@@ -1097,6 +1103,7 @@ BOOL isCustomResolution(CGSize res) {
[self.externalDisplayModeSelector setSelectedSegmentIndex:currentSettings.externalDisplayMode.integerValue];
[self.localMousePointerModeSelector setSelectedSegmentIndex:currentSettings.localMousePointerMode.integerValue];
}];
}
- (void)slideToSettingsScreenEdgeChanged{