Skip to content
This repository has been archived by the owner on Dec 17, 2022. It is now read-only.

Commit

Permalink
[v1.4.1] >> fix some bugs about fav
Browse files Browse the repository at this point in the history
  • Loading branch information
kayanouriko committed May 6, 2019
1 parent 4856001 commit f5702a9
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 21 deletions.
2 changes: 1 addition & 1 deletion EHenTaiViewer/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
vc.preferredDisplayMode = UISplitViewControllerDisplayModeAllVisible;
self.window.rootViewController = vc;
}
*/
*/
return YES;
}

Expand Down
7 changes: 2 additions & 5 deletions EHenTaiViewer/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@
<!--Now View Controller-->
<scene sceneID="op1-Iu-aXS">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="Qkm-ah-aMR" userLabel="First Responder" sceneMemberID="firstResponder"/>
<viewController id="hPB-nM-AcR" customClass="QJNowViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Xes-4D-9Wq"/>
Expand All @@ -360,6 +359,7 @@
</view>
<navigationItem key="navigationItem" id="rHq-ai-N7E"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Qkm-ah-aMR" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2872" y="4212"/>
</scene>
Expand All @@ -369,7 +369,7 @@
<splitViewController storyboardIdentifier="ipad" presentsWithGesture="NO" id="qgj-PC-26a" customClass="QJMainSplitViewController" sceneMemberID="viewController">
<connections>
<segue destination="9BU-PP-mOq" kind="relationship" relationship="masterViewController" id="dxh-Nq-Rx8"/>
<segue destination="Og5-9f-LCL" kind="relationship" relationship="detailViewController" id="al5-LF-X1a"/>
<segue destination="Nxy-ud-sR4" kind="relationship" relationship="detailViewController" id="YCn-dd-ueP"/>
</connections>
</splitViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="5fy-Pu-xYd" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -469,7 +469,4 @@
<image name="ic_settings" width="24" height="24"/>
<image name="ic_whatshot" width="24" height="24"/>
</resources>
<inferredMetricsTieBreakers>
<segue reference="al5-LF-X1a"/>
</inferredMetricsTieBreakers>
</document>
2 changes: 2 additions & 0 deletions EHenTaiViewer/QJContentSplitViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN

@interface QJContentSplitViewController : UISplitViewController

@property(nonatomic, assign) CGFloat maximumPrimaryColumnWidth NS_AVAILABLE_IOS(8_0);

@end

NS_ASSUME_NONNULL_END
5 changes: 4 additions & 1 deletion EHenTaiViewer/QJContentSplitViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ @interface QJContentSplitViewController ()

@implementation QJContentSplitViewController

@dynamic maximumPrimaryColumnWidth;

- (void)viewDidLoad {
[super viewDidLoad];
self.preferredDisplayMode = UISplitViewControllerDisplayModeAllVisible;
self.preferredPrimaryColumnWidthFraction = 0.4f;
self.preferredPrimaryColumnWidthFraction = 1.f;
self.maximumPrimaryColumnWidth = self.view.bounds.size.width;
}

@end
5 changes: 3 additions & 2 deletions EHenTaiViewer/QJFavoritesSelectController.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ - (void)viewDidLoad {

- (void)setContent {
[self.view addSubview:self.tableView];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[_tableView]-0-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_tableView)]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[_tableView]-0-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_tableView)]];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
}

- (void)readFavInfo {
Expand Down
25 changes: 14 additions & 11 deletions EHenTaiViewer/QJHenTaiParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -487,18 +487,21 @@ - (void)requestListInfo:(NSString *)url searchRule:(NSString *)searchRule comple
#pragma mark -收藏夹名字的爬取
- (void)parserFavoritesInfoWithHpple:(TFHpple *)xpathParser {
NSMutableArray *favorites = [NSMutableArray new];
NSArray *facats = [xpathParser searchWithXPathQuery:@"//div[@class='ido']//div[@class='nosel']//div[@class='fp']"];
NSArray *facats = [xpathParser searchWithXPathQuery:@"//div[@class='ido']//div[@class='nosel']/div"];
NSInteger total = 0;
for (TFHppleElement *facatElement in facats) {
NSArray<TFHppleElement *> *divs = [facatElement searchWithXPathQuery:@"//div"];
if (divs.count >= 3) {
//收藏夹名字,收藏数
NSMutableArray *subArr = [NSMutableArray new];
[subArr addObject:divs.lastObject.text];
NSString *count = divs[1].text;
[subArr addObject:count];
total += [count integerValue];
[favorites addObject:subArr];
for (NSInteger i = 0; i < 11; i++) {
if (i < facats.count) {
TFHppleElement *facatElement = facats[i];
NSArray<TFHppleElement *> *divs = [facatElement searchWithXPathQuery:@"//div"];
if (divs.count >= 3) {
//收藏夹名字,收藏数
NSMutableArray *subArr = [NSMutableArray new];
[subArr addObject:divs.lastObject.text];
NSString *count = divs[1].text;
[subArr addObject:count];
total += [count integerValue];
[favorites addObject:subArr];
}
}
}
//最后加入全部收藏夹的信息
Expand Down
11 changes: 11 additions & 0 deletions EHenTaiViewer/QJHotAndLikeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ - (void)updateLikeResource {
[self.likeTableview reloadData];
}
else if (status == QJHenTaiParserStatusParseNoMore) {
//收藏夹按钮设置
if (nil == self.navigationItem.rightBarButtonItem) {
self.navigationItem.rightBarButtonItem = self.bookmarksItem;
}
//多功能操作按钮实现
if (listArray.count && nil == self.navigationItem.leftBarButtonItem) {
self.navigationItem.leftBarButtonItem = self.editItem;
}
else if (listArray.count == 0 && nil != self.navigationItem.leftBarButtonItem) {
self.navigationItem.leftBarButtonItem = nil;
}
[self.likeTableview reloadData];
}
self.status = listArray.count ? QJFreshStatusNone : QJFreshStatusNotMore;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

一个 e-hentai/exhentai 的iOS端阅读器 / a client for e-hentai/exhentai

![platform](https://img.shields.io/badge/platform-ios-lightgrey.svg) [![release](https://img.shields.io/badge/release-v1.3.2-brightgreen.svg)](https://github.com/kayanouriko/E-HentaiViewer/releases) ![support](https://img.shields.io/badge/support-11.0-blue.svg)
![platform](https://img.shields.io/badge/platform-ios-lightgrey.svg) [![release](https://img.shields.io/badge/release-v1.4.1-brightgreen.svg)](https://github.com/kayanouriko/E-HentaiViewer/releases) ![support](https://img.shields.io/badge/support-11.0-blue.svg)

# 说明
主要是自用应用,而且还是新手,更新周期可能会比较长,有刚性需求的同学可以用DaidoujiChen的成熟应用\
Expand Down

0 comments on commit f5702a9

Please sign in to comment.