From 748d4280ad6aba89a8463e5991333471ffe8b821 Mon Sep 17 00:00:00 2001 From: lint <47455468+lint@users.noreply.github.com> Date: Fri, 20 Sep 2019 19:30:14 -0400 Subject: [PATCH] Update Tweak.xm --- Tweak.xm | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Tweak.xm b/Tweak.xm index 95ec4a8..06b4c3d 100644 --- a/Tweak.xm +++ b/Tweak.xm @@ -1,14 +1,14 @@ @interface PUCollectionView : UICollectionView -@property(assign,nonatomic) id delegate; +@property(assign,nonatomic) id delegate; @property(assign,nonatomic) NSArray* visibleCells; @property(assign,nonatomic) NSArray* indexPathsForVisibleItems; @property(assign,nonatomic) id reorderDelegate; @property(assign,nonatomic) id selectionDelegate; -(id) idexPathForItemAtPoint:(id) arg1; --(id) cellForItemAtIndexPath:(id) arg1; +-(id) cellForItemAtIndexPath:(id) arg1; -(id) indexPathForCell:(id) arg1; --(void) _updateVisibleCellsNow:(BOOL) arg1; +-(void) _updateVisibleCellsNow:(BOOL) arg1; @end @@ -32,8 +32,8 @@ -(void)updateCtrlButton; -@end - +@end + @interface PUPhotosGridCell : UIView @property(assign, nonatomic) id photoContentView; -(void) prepareForReuse; @@ -154,17 +154,17 @@ } else { - //PUPhotosGridCell* firstSelectedCell = [self cellForItemAtIndexPath:[gvController ctrlFirstIndexPath]]; + PUPhotosGridCell* firstSelectedCell = [self cellForItemAtIndexPath:[gvController ctrlFirstIndexPath]]; - //[firstSelectedCell.ctrlSelectOverlayView removeFromSuperview]; - //firstSelectedCell.ctrlSelectOverlayView = nil; + [firstSelectedCell.ctrlSelectOverlayView removeFromSuperview]; + firstSelectedCell.ctrlSelectOverlayView = nil; NSRange indexRange; NSInteger firstRow = [gvController ctrlFirstIndexPath].row; NSInteger firstSection = [gvController ctrlFirstIndexPath].section; NSInteger nextRow = nextIndexPath.row; NSInteger nextSection = nextIndexPath.section; - + NSInteger lowRow = 0; NSInteger highRow = 0; NSInteger lowSection = 0; @@ -230,13 +230,13 @@ [gvController updateCtrlButton]; } -} +} - --(id) dequeueReusableCellWithReuseIdentifier: (id) arg1 forIndexPath:(id) arg2{ + +-(id) dequeueReusableCellWithReuseIdentifier: (id) arg1 forIndexPath:(id) arg2{ id orig = %orig; - if ([self selectionDelegate] && ![self reorderDelegate] && [orig isKindOfClass:[%c(PUPhotosGridCell) class]]) { + if ([self selectionDelegate] && ![self reorderDelegate] && [orig isKindOfClass:[%c(PUPhotosGridCell) class]]) { id gvController = [self delegate]; @@ -249,7 +249,8 @@ NSIndexPath* firstIndexPath = [gvController ctrlFirstIndexPath]; NSIndexPath* thisIndexPath = arg2; - HBLogDebug(@"firstIndexPath: %ld-%ld thisIndexPath: %ld-%ld", (long)firstIndexPath.section, (long)firstIndexPath.row, (long)thisIndexPath.section, (long)thisIndexPath.row); + HBLogDebug(@"firstIndexPath: %ld-%ld thisIndexPath: %ld-%ld", (long)firstIndexPath.section, (long)firstIndexPath.row, (long)thisIndexPath.section, (long)thisIndexPath.row); + if ( firstIndexPath.section == thisIndexPath.section && firstIndexPath.row == thisIndexPath.row){ [orig ctrlSelectOverlayView].image = [UIImage imageWithContentsOfFile:@"/var/mobile/Library/Application Support/PhotoCtrl/check.png"]; @@ -259,8 +260,8 @@ } } - return orig; -} + return orig; +} %end