This commit is contained in:
2025-11-11 20:24:13 +08:00
parent 3440cc4773
commit 1d064c1f31
4 changed files with 91 additions and 15 deletions

View File

@@ -16,6 +16,7 @@
#import "KBFullAccessManager.h"
#import "KBSkinManager.h"
#import "KBURLOpenBridge.h" // openURL:
#import "KBStreamTextView.h" //
static NSString * const kKBFunctionTagCellId = @"KBFunctionTagCellId";
@@ -30,6 +31,10 @@ static NSString * const kKBFunctionTagCellId = @"KBFunctionTagCellId";
@property (nonatomic, strong) UIButton *clearButtonInternal;
@property (nonatomic, strong) UIButton *sendButtonInternal;
//
@property (nonatomic, strong, nullable) KBStreamTextView *streamTextView;
@property (nonatomic, strong, nullable) UIButton *streamDeleteButton;
// Data
@property (nonatomic, strong) NSArray<NSString *> *itemsInternal;
@@ -182,12 +187,68 @@ static NSString * const kKBFunctionTagCellId = @"KBFunctionTagCellId";
return 12.0;
}
// UL App Scheme访
- (void)kb_showStreamTextViewIfNeededWithTitle:(NSString *)title {
//
if (self.streamTextView.superview) { return; }
// 使
self.collectionViewInternal.hidden = YES;
KBStreamTextView *sv = [[KBStreamTextView alloc] init];
sv.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.92];
sv.layer.cornerRadius = 12.0; sv.layer.masksToBounds = YES;
//
if (title.length > 0) {
[sv appendStreamText:[NSString stringWithFormat:@"%@\t", title]]; //
}
[self addSubview:sv];
[sv mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.mas_left).offset(12);
make.right.equalTo(self).offset(-12);
make.top.equalTo(self.pasteViewInternal.mas_bottom).offset(10);
make.bottom.equalTo(self.mas_bottom).offset(-10);
}];
self.streamTextView = sv;
//
UIButton *del = [UIButton buttonWithType:UIButtonTypeSystem];
del.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.35];
del.layer.cornerRadius = 14; del.layer.masksToBounds = YES;
del.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold];
[del setTitle:@"删除" forState:UIControlStateNormal];
[del setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[del addTarget:self action:@selector(kb_onTapStreamDelete) forControlEvents:UIControlEventTouchUpInside];
[sv addSubview:del];
[del mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(sv.mas_top).offset(8);
make.right.equalTo(sv.mas_right).offset(-8);
make.height.mas_equalTo(28);
make.width.mas_greaterThanOrEqualTo(56);
}];
self.streamDeleteButton = del;
}
- (void)kb_onTapStreamDelete {
//
[self.streamDeleteButton removeFromSuperview];
self.streamDeleteButton = nil;
[self.streamTextView removeFromSuperview];
self.streamTextView = nil;
self.collectionViewInternal.hidden = NO;
}
// UL App Scheme访
// 访 KBStreamTextView
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
// + 访访
if ([[KBFullAccessManager shared] hasFullAccess]) {
NSString *title = (indexPath.item < self.itemsInternal.count) ? self.itemsInternal[indexPath.item] : @"";
[self kb_showStreamTextViewIfNeededWithTitle:title];
return;
}
[KBHUD showInfo:@"处理中…"];
// return;
UIInputViewController *ivc = KBFindInputViewController(self);
if (!ivc) return;