Skip to content

Commit

Permalink
Merge branch 'release/v1.3.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
fanyuecheng committed Jan 9, 2023
2 parents e06cd8a + 2a17ddc commit 577c7f7
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 43 deletions.
4 changes: 2 additions & 2 deletions Pica.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 1.3.3;
MARKETING_VERSION = 1.3.4;
PRODUCT_BUNDLE_IDENTIFIER = com.yuecheng.pica;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -1541,7 +1541,7 @@
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 1.3.3;
MARKETING_VERSION = 1.3.4;
PRODUCT_BUNDLE_IDENTIFIER = com.yuecheng.pica;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
7 changes: 4 additions & 3 deletions Pica/Category/Controller/PCComicPictureController.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ - (void)setupToolbarItems {
[super setupToolbarItems];

UIBarButtonItem *flexibleItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:NULL];

UIBarButtonItem *item1 = [QMUIToolbarButton barButtonItemWithType:QMUIToolbarButtonTypeNormal title:@"上一话" target:self action:@selector(lastEpisode:)];
UIBarButtonItem *item2 = [QMUIToolbarButton barButtonItemWithType:QMUIToolbarButtonTypeNormal title:@"下一话" target:self action:@selector(nextEpisode:)];
UIBarButtonItem *item1 = [QMUIToolbarButton barButtonItemWithImage:[UIImage systemImageNamed:@"arrow.left"] target:self action:@selector(lastEpisode:)];
UIBarButtonItem *item2 = [QMUIToolbarButton barButtonItemWithImage:[UIImage systemImageNamed:@"arrow.right"] target:self action:@selector(nextEpisode:)];
item1.tintColor = UIColorBlack;
item2.tintColor = UIColorBlack;
self.toolbarItems = @[item1, flexibleItem, item2];
}

Expand Down
9 changes: 2 additions & 7 deletions Pica/Category/Model/PCUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,8 @@ + (NSArray *)characterImageArray {
//https://www.picacomic.com or https://pica-pica.wikawika.xyz
if (!PCCharacterImageArray) {
PCCharacterImageArray = [[NSMutableArray alloc] init];
[PCCharacterImageArray addObjectsFromArray:@[ @"https://pica-pica.wikawika.xyz/characters/frame_knight_9.png", @"https://pica-pica.wikawika.xyz/characters/frame_knight_100_249.png", @"https://pica-pica.wikawika.xyz/characters/frame_knight_1000.png", @"https://pica-pica.wikawika.xyz/characters/frame_knight_500_999.png", @"https://pica-pica.wikawika.xyz/characters/verified.png", @"https://pica-pica.wikawika.xyz/images/monster.jpg", @"https://pica-pica.wikawika.xyz/images/halloween_bot.png", @"https://pica-pica.wikawika.xyz/images/halloween_f.png", @"https://pica-pica.wikawika.xyz/images/halloween_m.png",
@"https://pica-pica.wikawika.xyz/special/frame-dirty.png"]];
for (NSInteger i = 1; i < 10; i++) {
[PCCharacterImageArray addObject:[NSString stringWithFormat:@"https://pica-pica.wikawika.xyz/special/hat-%@.png", @(i)]];
}
for (NSInteger i = 1; i < 491; i++) {
[PCCharacterImageArray addObject:[NSString stringWithFormat:@"https://pica-pica.wikawika.xyz/special/frame-%@.png", @(i)]];
for (NSInteger i = 1; i < 636; i++) {
[PCCharacterImageArray addObject:[NSString stringWithFormat:@"https://bidobido.xyz/special/frame-%@.png", @(i)]];
}
}
return [PCCharacterImageArray copy];
Expand Down
102 changes: 71 additions & 31 deletions Pica/Category/View/PCComicInfoView.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
#import "PCUserInfoView.h"
#import "PCCommonUI.h"

@interface PCComicInfoView ()
@interface PCComicInfoView () <QMUIImagePreviewViewDelegate>

@property (nonatomic, strong) UIImageView *coverView;
@property (nonatomic, strong) QMUILabel *titleLabel;
@property (nonatomic, strong) QMUIButton *authorButton;
@property (nonatomic, strong) QMUIButton *sinicizationButton;
@property (nonatomic, strong) QMUILabel *authorLabel;
@property (nonatomic, strong) QMUILabel *sinicizationLabel;
@property (nonatomic, strong) QMUILabel *viewLabel;
@property (nonatomic, strong) QMUILabel *categoryLabel;
@property (nonatomic, strong) QMUILabel *descLabel;
Expand All @@ -35,6 +35,8 @@ @interface PCComicInfoView ()
@property (nonatomic, strong) QMUILabel *nameLabel;
@property (nonatomic, strong) QMUILabel *timeLabel;

@property (nonatomic, strong) QMUIImagePreviewViewController *previewViewController;

@end

@implementation PCComicInfoView
Expand All @@ -56,8 +58,8 @@ - (instancetype)initWithFrame:(CGRect)frame {
- (void)didInitialize {
[self addSubview:self.coverView];
[self addSubview:self.titleLabel];
[self addSubview:self.authorButton];
[self addSubview:self.sinicizationButton];
[self addSubview:self.authorLabel];
[self addSubview:self.sinicizationLabel];
[self addSubview:self.viewLabel];
[self addSubview:self.categoryLabel];
[self addSubview:self.descLabel];
Expand All @@ -79,11 +81,11 @@ - (void)layoutSubviews {

self.coverView.frame = CGRectMake(15, 10, 90, 130);
self.titleLabel.frame = CGRectMake(115, 10, self.qmui_width - 120, QMUIViewSelfSizingHeight);
[self.authorButton sizeToFit];
self.authorButton.frame = CGRectSetXY(self.authorButton.frame, 115, self.titleLabel.qmui_bottom + 5);
[self.sinicizationButton sizeToFit];
self.sinicizationButton.frame = CGRectSetXY(self.sinicizationButton.frame, 115, self. authorButton.qmui_bottom + 5);
self.viewLabel.frame = CGRectMake(115, self.sinicizationButton.qmui_bottom + 5, self.qmui_width - 120, QMUIViewSelfSizingHeight);
[self.authorLabel sizeToFit];
self.authorLabel.frame = CGRectSetXY(self.authorLabel.frame, 115, self.titleLabel.qmui_bottom + 5);
[self.sinicizationLabel sizeToFit];
self.sinicizationLabel.frame = CGRectSetXY(self.sinicizationLabel.frame, 115, self. authorLabel.qmui_bottom + 5);
self.viewLabel.frame = CGRectMake(115, self.sinicizationLabel.qmui_bottom + 5, self.qmui_width - 120, QMUIViewSelfSizingHeight);
self.categoryLabel.frame = CGRectMake(115, self.viewLabel.qmui_bottom + 5, self.qmui_width - 120, QMUIViewSelfSizingHeight);
self.tagView.frame = CGRectMake(15, self.coverView.qmui_bottom + 10, self.qmui_width - 30, QMUIViewSelfSizingHeight);
self.descLabel.frame = CGRectMake(15, self.comic.tags.count ? self.tagView.qmui_bottom + 10 : self.tagView.qmui_bottom, self.qmui_width - 30, QMUIViewSelfSizingHeight);
Expand Down Expand Up @@ -132,20 +134,20 @@ - (void)tagAction:(QMUIButton *)sender {
[[QMUIHelper visibleViewController].navigationController pushViewController:list animated:YES];
}

- (void)authorAction:(QMUIButton *)sender {
- (void)authorAction:(UITapGestureRecognizer *)sender {
PCComicListController *list = [[PCComicListController alloc] initWithType:PCComicListTypeAuthor];
list.keyword = sender.currentTitle;
list.keyword = self.authorLabel.text;
[[QMUIHelper visibleViewController].navigationController pushViewController:list animated:YES];
}

- (void)sinicizationAction:(QMUIButton *)sender {
- (void)sinicizationAction:(UITapGestureRecognizer *)sender {
PCComicListController *list = [[PCComicListController alloc] initWithType:PCComicListTypeTranslate];
list.keyword = sender.currentTitle;
list.keyword = self.sinicizationLabel.text;
[[QMUIHelper visibleViewController].navigationController pushViewController:list animated:YES];
}

- (void)avatarAction:(UIGestureRecognizer *)sender {
if (self.comic.chineseTeam.length && ![self.comic.chineseTeam isEqualToString:@""] && [self.comic.chineseTeam isEqualToString:@"不明"]) {
if (self.comic.chineseTeam.length && ![self.comic.chineseTeam isEqualToString:@""] && ![self.comic.chineseTeam isEqualToString:@"不明"]) {
QMUIModalPresentationViewController *controller = [[QMUIModalPresentationViewController alloc] init];
PCUserInfoView *infoView = [[PCUserInfoView alloc] init];
infoView.user = self.comic.creator;
Expand All @@ -154,6 +156,19 @@ - (void)avatarAction:(UIGestureRecognizer *)sender {
}
}

- (void)coverAction:(UIGestureRecognizer *)sender {
if (!self.previewViewController) {
self.previewViewController = [[QMUIImagePreviewViewController alloc] init];
self.previewViewController.presentingStyle = QMUIImagePreviewViewControllerTransitioningStyleZoom;
self.previewViewController.imagePreviewView.delegate = self;
}
self.previewViewController.sourceImageView = ^UIView *{
return sender.view;
};

[[QMUIHelper visibleViewController] presentViewController:self.previewViewController animated:YES completion:nil];
}

- (void)commentAction {
PCCommentController *comment = [[PCCommentController alloc] initWithComicId:self.comic.comicId];
comment.commentType = PCCommentTypeComic;
Expand All @@ -180,6 +195,30 @@ - (void)favouriteAction {
}];
}

#pragma mark - QMUIImagePreviewViewDelegate
- (NSUInteger)numberOfImagesInImagePreviewView:(QMUIImagePreviewView *)imagePreviewView {
return 1;
}

- (void)imagePreviewView:(QMUIImagePreviewView *)imagePreviewView renderZoomImageView:(QMUIZoomImageView *)zoomImageView atIndex:(NSUInteger)index {
[[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.comic.thumb.imageURL]
options:kNilOptions
progress:nil
completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
if (image) {
zoomImageView.image = image;
}
}];
}

- (QMUIImagePreviewMediaType)imagePreviewView:(QMUIImagePreviewView *)imagePreviewView assetTypeAtIndex:(NSUInteger)index {
return QMUIImagePreviewMediaTypeImage;
}

- (void)singleTouchInZoomingImageView:(QMUIZoomImageView *)zoomImageView location:(CGPoint)location {
[self.previewViewController dismissViewControllerAnimated:YES completion:nil];
}

#pragma mark - Get
- (UIImageView *)coverView {
if (!_coverView) {
Expand All @@ -188,6 +227,8 @@ - (UIImageView *)coverView {
_coverView.clipsToBounds = YES;
_coverView.layer.cornerRadius = 4;
_coverView.layer.masksToBounds = YES;
_coverView.userInteractionEnabled = YES;
[_coverView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(coverAction:)]];
}
return _coverView;
}
Expand All @@ -196,28 +237,27 @@ - (QMUILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[QMUILabel alloc] init];
_titleLabel.numberOfLines = 2;
_titleLabel.canPerformCopyAction = YES;
}
return _titleLabel;
}

- (QMUIButton *)authorButton {
if (!_authorButton) {
_authorButton = [[QMUIButton alloc] init];
_authorButton.titleLabel.font = UIFontMake(13);
[_authorButton setTitleColor:PCColorHotPink forState:UIControlStateNormal];
[_authorButton addTarget:self action:@selector(authorAction:) forControlEvents:UIControlEventTouchUpInside];
- (QMUILabel *)authorLabel {
if (!_authorLabel) {
_authorLabel = [[QMUILabel alloc] qmui_initWithFont:UIFontMake(13) textColor:PCColorHotPink];
_authorLabel.canPerformCopyAction = YES;
[_authorLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(authorAction:)]];
}
return _authorButton;
return _authorLabel;
}

- (QMUIButton *)sinicizationButton {
if (!_sinicizationButton) {
_sinicizationButton = [[QMUIButton alloc] init];
_sinicizationButton.titleLabel.font = UIFontMake(13);
[_sinicizationButton setTitleColor:UIColorGrayLighten forState:UIControlStateNormal];
[_sinicizationButton addTarget:self action:@selector(sinicizationAction:) forControlEvents:UIControlEventTouchUpInside];
- (QMUILabel *)sinicizationLabel {
if (!_sinicizationLabel) {
_sinicizationLabel = [[QMUILabel alloc] qmui_initWithFont:UIFontMake(13) textColor:UIColorGrayLighten];
_sinicizationLabel.canPerformCopyAction = YES;
[_sinicizationLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(sinicizationAction:)]];
}
return _sinicizationButton;
return _sinicizationLabel;
}

- (QMUILabel *)categoryLabel {
Expand Down Expand Up @@ -320,8 +360,8 @@ - (void)setComic:(PCComic *)comic {

[self.coverView pc_setImageWithURL:comic.thumb.imageURL];
self.titleLabel.text = comic.title;
[self.authorButton setTitle:comic.author forState:UIControlStateNormal];
[self.sinicizationButton setTitle:comic.chineseTeam forState:UIControlStateNormal];
self.authorLabel.text = comic.author;
self.sinicizationLabel.text = comic.chineseTeam;
self.viewLabel.text = [NSString stringWithFormat:@"绅士指名次数:%@ %@", @(comic.viewsCount), comic.finished ? @"(已完结)" : @""];
NSMutableString *category = [NSMutableString stringWithString:@"分类 "];
[comic.categories enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
Expand Down

0 comments on commit 577c7f7

Please sign in to comment.