Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #631 Scroll issues. #670

Merged
merged 6 commits into from Jan 18, 2019
Merged

Fixed #631 Scroll issues. #670

merged 6 commits into from Jan 18, 2019

Conversation

@danishjafri88
Copy link
Contributor

danishjafri88 commented Jan 2, 2019

What is fixed:
->Youtube header problem
->Redundant Pan Gesture creation
->Mis-aligned constraints relations in BrowserViewController
->Refactored Show/Hide Tab Animation properly
-> Enable Zoom by ignoring viewport scale limit.
-> Removed a part of animation code(Hotfix for older logic) which became source of a jump issue during scroll.

Pull Request Checklist

  • My patch has gone through review and I have addressed review comments

  • My patch has a standard commit message that looks like Fix #123: This fixes the shattered coffee cup!

  • I have updated the Unit Tests to cover new or changed functionality

  • I have updated the UI Tests to cover new or changed functionality

  • I have marked the bug with [needsuplift]

  • I have made sure that localizable strings use NSLocalizableString()

Screenshots

If your patch includes user interface changes that you would like to suggest or that you would like UX to look at, please include them here.

Notes for testing this patch

If useful, please leave notes for QA, explaining what this patch changes and how it can be best tested and verified.

…eaderTopOffset` is already clamped by `-topScrollHeight` in scrollWithDelta, where topScrollHeight contains both urlView and tabsBarView.
@danishjafri88 danishjafri88 requested a review from jhreis Jan 2, 2019
}

didSet {
self.scrollView?.addGestureRecognizer(panGesture)
self.scrollView?.panGestureRecognizer.addTarget(self, action: #selector(handlePan))
self.scrollView?.panGestureRecognizer.maximumNumberOfTouches = 1

This comment has been minimized.

Copy link
@kylehickinson

kylehickinson Jan 2, 2019

Contributor

Should we be modifying the scroll view's pan gesture? This may have side-effects

This comment has been minimized.

Copy link
@danishjafri88

danishjafri88 Jan 2, 2019

Author Contributor

Agreed. I copied what was done for the PanGesture created. Looking at it now there is no need to update this value.

@@ -667,8 +667,8 @@ class BrowserViewController: UIViewController {
webViewContainerTopOffset = make.top.equalTo(readerModeBar?.snp.bottom ?? self.header.snp.bottom).constraint

let findInPageHeight = (findInPageBar == nil) ? 0 : UIConstants.ToolbarHeight
if let toolbar = self.toolbar {
make.bottom.equalTo(toolbar.snp.top).offset(-findInPageHeight)
if let footerView = self.footer {

This comment has been minimized.

Copy link
@kylehickinson

kylehickinson Jan 2, 2019

Contributor

Why does this work? footer will never be nil whereas toolbar will be when in landscape

This comment has been minimized.

Copy link
@danishjafri88

danishjafri88 Jan 2, 2019

Author Contributor

It's declared as optional.

This comment has been minimized.

Copy link
@kylehickinson

kylehickinson Jan 2, 2019

Contributor

Sorry I didn't mean why do you need the if-let, I meant this will execute every time now and never hit the else below. footer is set and never un-set.

This comment has been minimized.

Copy link
@danishjafri88

danishjafri88 Jan 2, 2019

Author Contributor

Oh, so footer is constrained to bottom of view and when there is no toolbar its height becomes 0. Hence its constrained to bottom of screen. If footer will never be nil then perhaps we can remove the else case and also make it non-optional. What do you suggest?

This comment has been minimized.

Copy link
@kylehickinson

kylehickinson Jan 7, 2019

Contributor

I'd suggest taking a closer look at why it used toolbar and if it really doesn't matter (like you said, its height becomes 0 anyways), then we can just remove the else clause here. In fact, we can also change the declaration of footer so its not implicitly unwrapped:

let footer = UIView()

rather than its current declaration: var footer: UIView! and being init'd later

This comment has been minimized.

Copy link
@danishjafri88

danishjafri88 Jan 9, 2019

Author Contributor

Kept it as unwrapped optional as it is initialised in viewdidload, but used without ? as it is never set to nil.

@kylehickinson
Copy link
Contributor

kylehickinson commented Jan 9, 2019

Not sure if you still want @jhreis to take a look, so delaying merge for now

@kylehickinson kylehickinson force-pushed the bugfix/fix.bug.631 branch from 8fc0af8 to 1ec2c4e Jan 18, 2019
@jhreis
jhreis approved these changes Jan 18, 2019
@jhreis jhreis merged commit cec93e9 into development Jan 18, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jhreis jhreis deleted the bugfix/fix.bug.631 branch Jan 18, 2019
kylehickinson added a commit that referenced this pull request Jan 23, 2019
jhreis added a commit that referenced this pull request Jan 23, 2019
@danishjafri88 danishjafri88 restored the bugfix/fix.bug.631 branch Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.