feat: 修正各种小问题,补充多语言

This commit is contained in:
eggmanQQQ
2024-10-14 15:26:57 +08:00
parent 3f6fae9c07
commit 0b14b6bf5f
18 changed files with 213 additions and 132 deletions

View File

@@ -358,65 +358,9 @@ XPCandyTreeInsufficientBalanceViewDelegate>
// [b addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside];
//#endif
}
- (void)test {
// UITextView
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(20, 100, 300, 100)];
textView.editable = NO;
textView.backgroundColor = [UIColor clearColor]; //
// NSMutableAttributedString
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init];
// NSTextAttachment
NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
attachment.image = [UIImage imageNamed:@"room_boom_progress_avatar"]; //
// bounds
CGFloat imageOffsetY = -5.0; //
attachment.bounds = CGRectMake(0, imageOffsetY, 40, 40); //
// attributed string
NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:attachment];
// attributed string
[attributedString appendAttributedString:imageString];
//
NSString *text1 = @" 恭喜!";
NSString *text2 = @" 八六八八八本";
NSString *text3 = @" 触发超级大奖BOOM所有在房用户将获得奖励";
//
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.alignment = NSTextAlignmentLeft; //
paragraphStyle.lineSpacing = 5.0; //
paragraphStyle.paragraphSpacing = 10.0; //
// attributed string
NSDictionary *attributes1 = @{NSFontAttributeName: [UIFont systemFontOfSize:17],
NSParagraphStyleAttributeName: paragraphStyle};
NSAttributedString *attributedText1 = [[NSAttributedString alloc] initWithString:text1 attributes:attributes1];
[attributedString appendAttributedString:attributedText1];
//
NSDictionary *attributes2 = @{NSFontAttributeName: [UIFont boldSystemFontOfSize:17],
NSForegroundColorAttributeName: [UIColor redColor],
NSParagraphStyleAttributeName: paragraphStyle};
NSAttributedString *attributedText2 = [[NSAttributedString alloc] initWithString:text2 attributes:attributes2];
[attributedString appendAttributedString:attributedText2];
//
NSAttributedString *attributedText3 = [[NSAttributedString alloc] initWithString:text3 attributes:attributes1];
[attributedString appendAttributedString:attributedText3];
// attributedString UITextView
textView.attributedText = attributedString;
// UITextView
[self.view addSubview:textView];
}
//- (void)test {
//
//}
- (void)setupForBoom {
@kWeakify(self);
@@ -446,6 +390,11 @@ XPCandyTreeInsufficientBalanceViewDelegate>
} target:self];
}
- (void)requestBoomData {
[self.presenter getBoomRocketAnimationInfo:self.roomUid];
[self.presenter getBoomDetail:self.roomUid];
}
- (void)loadRoomDataAndUsers {
[XNDJTDDLoadingTool showAnchorLoading:self.navigationController.view];
[self.presenter initEnterRoom:self.roomUid user:[AccountInfoStorage instance].getUid];
@@ -1409,8 +1358,7 @@ XPCandyTreeInsufficientBalanceViewDelegate>
self.roomInfo = roomInfo;
self.userInfo = userInfo;
[self.presenter getBoomRocketAnimationInfo:@(roomInfo.uid).stringValue];
[self.presenter getBoomDetail:@(roomInfo.uid).stringValue];
[self requestBoomData];
@kWeakify(self);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{