Skip to content

Commit

Permalink
shake
Browse files Browse the repository at this point in the history
  • Loading branch information
everettjf committed Sep 12, 2018
1 parent a27880f commit bc40795
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions DictionaryPullDownToClose/DictionaryPullDownToClose.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "CaptainHook/CaptainHook.h"
#import <AudioToolbox/AudioToolbox.h>

// Objective-C runtime hooking using CaptainHook:
// 1. declare class using CHDeclareClass()
Expand All @@ -40,7 +41,6 @@ - (void)doneButtonPressed:(id)arg1;
CGFloat sEndYOffset = 0;
UILabel *sLabelInfo = nil;
UIView *sContainerView = nil;
bool sTipPositionFirstPage = true;
bool sEnable = false;

void scrollViewDidScroll(UIScrollView * scrollView){
Expand All @@ -54,14 +54,12 @@ void scrollViewDidScroll(UIScrollView * scrollView){
CGSize screenSize = [UIScreen mainScreen].bounds.size;
sLabelInfo = [[UILabel alloc]init];
sLabelInfo.bounds = CGRectMake(0, 0, 130, 20);
if(sTipPositionFirstPage){
sLabelInfo.center = CGPointMake(screenSize.width / 2, -10);
}else{
sLabelInfo.center = CGPointMake(screenSize.width / 2, 100);
}
sLabelInfo.center = CGPointMake(screenSize.width / 2, -10);
sLabelInfo.text = @"release to close";
sLabelInfo.textColor = [UIColor grayColor];
[sContainerView addSubview:sLabelInfo];

AudioServicesPlaySystemSound(1519);
}
}else{
if(sLabelInfo){
Expand Down Expand Up @@ -113,7 +111,6 @@ @interface DDParsecTableViewController : UITableViewController
{
// NSLog(@"qiweidict : first page viewDidAppear %@ , navi = %@",self,self.navigationController);
a.sContainerView = self.view;
a.sTipPositionFirstPage = true;
sController = (DDParsecServiceCollectionViewController *)self.navigationController;

CHSuper(1, DDParsecTableViewController, viewDidAppear, value1);
Expand Down Expand Up @@ -157,7 +154,6 @@ @interface DUEntryViewController (dictionarypulldowntoclose)
@implementation DUEntryViewController (dictionarypulldowntoclose)
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
// NSLog(@"qiweidict: did scroll : %@",@(scrollView.contentOffset.y));
b.sTipPositionFirstPage = false;
b.scrollViewDidScroll(scrollView);
}
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{
Expand All @@ -178,13 +174,12 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoi
{
// NSLog(@"qiweidict : detail viewDidLoad %p %@",self,self);
CHSuper(0, DUEntryViewController, viewDidLoad);

b.sContainerView = self.view;

UIView *view = self.view;
if(view.subviews.count > 0){
UIWebView *webView = view.subviews[0];
webView.scrollView.delegate = self;
b.sContainerView = webView.scrollView;
}
}

Expand Down
2 changes: 1 addition & 1 deletion DictionaryPullDownToClose/Package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.everettjf.DictionaryPullDownToClose
Name: DictionaryPullDownToClose
Version: 0.3-1
Version: 0.4-1
Description: Add "Pull down release to close/dismiss" feature to system dictionary
Section: Tweaks
Depends: firmware (>= 5.0), mobilesubstrate
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit bc40795

Please sign in to comment.