Closed Bug 763049 Opened 13 years ago Closed 13 years ago

Phones should slide the browser, "not shrink" on opening and closing the tab-menu

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox15 verified, firefox16 verified)

VERIFIED FIXED
Firefox 16
Tracking Status
firefox15 --- verified
firefox16 --- verified

People

(Reporter: aaronmt, Assigned: sriram)

References

Details

Attachments

(1 file, 1 obsolete file)

As per Sriram's suggestion
(In reply to Aaron Train [:aaronmt] from comment #0) > As per Sriram's suggestion As per Ian's suggestion ;)
Blocks: 763553
Attached patch PatchSplinter Review
This patch adds a sliding animation for phones and a sliding+shrinking animation for tablets. In case of tablets, the browser_toolbar needs to shrink and the content portion should slide and then shrink. Since the PropertyAnimator can be easily extended, I have moved the constructor to an "attach()" method, to attach as many views as needed. This gets iterated over in run() and invalidate() happens for each view. "from" is calculated during the start(), to keep the calling side simple. ViewGroup.MarginLayoutParams is used to make things generic. onPropertyAnimationStart() and onPropertyAnimationEnd() are used to be used for knowing the start and end of animations. Note: They are called from background thread, hence mMainHandler's post() method should be used. Always posting to GeckoApp.mMainHandler directly from PropertyAnimator will make it lose its generic nature.
Attachment #632161 - Flags: review?(mark.finkle)
Comment on attachment 632161 [details] [diff] [review] Patch Looks OK. I like the use of the PropertyAnimationListener to handle "view specific" cleanup. Needing to handle two views in different ways on tablet does make life more complicated. >diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java >+ // Set the gecko layout for sliding. >+ if (!mTabsPanel.isShown()) { >+ ((LinearLayout.LayoutParams) mGeckoLayout.getLayoutParams()).setMargins(0, 0, 0, 0); >+ mGeckoLayout.scrollTo(mTabsPanel.getWidth() * -1, 0); >+ mGeckoLayout.requestLayout(); >+ } Is it possible to move this the the onPropertyAnimationStart callback? That makes it more symmetric with the onPropertyAnimationEnd code. r+, but see if we can move the code to the onPropertyAnimationStart method
Attachment #632161 - Flags: review?(mark.finkle) → review+
I thought of moving it there. But here are the problems: 1. The onPropertyAnimationStart() is called after "from" value is taken and everything is scheduled to happen. But this should happen before that. 2. Even if I change the logic of start to do these before scheduling animation, this needs to happen in an UI thread. Hence there will be a race between posting a runnable here in onPropertyAnimationStart(), that refreshing the view, and that being taken as from value in start(). That's why I had to have here.
Is using ScrollBy better for us than using a straight up TranslateAnimation somehow? http://developer.android.com/reference/android/view/animation/TranslateAnimation.html On phones, it seems like that should deliver a smoother result.
ScrollBy looks better to me. They way Android calculates things and the way I'm calculating things are bit different. I remember seeing whole content flashing with Android's animation. Also, browser toolbar needs to be shrunk. If that uses my logic and content portion uses Android's logic, then everything wouldn't sync up easily.
Yeah, translate would only work (well) on phones (where browserToolbar doesn't need to shrink). I've seen flickering before, but most of it was cleared up by explicitly setting fillAfter and fillBefore. I'll wait and see how this looks.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 16
Depends on: 765156
Comment on attachment 632161 [details] [diff] [review] Patch [Approval Request Comment] Bug caused by (feature/regressing bug #): - User impact if declined: The intended animation for tabs UI will be clunky. Testing completed (on m-c, etc.): 06/13 Risk to taking this patch (and alternatives if risky): Low. This makes the animation handler robust. This has been in central for a week now. String or UUID changes made by this patch: None.
Attachment #632161 - Flags: approval-mozilla-aurora?
Comment on attachment 632161 [details] [diff] [review] Patch [Triage Comment] In support of the new tabs UI. Approving for Aurora 15.
Attachment #632161 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Attached patch Patch for Aurora (obsolete) — Splinter Review
It so happened that wesj's patches for refactoring GeckoApp landed right before I landed this in central. Hence some of the code in GeckoApp had to go into BrowserApp. But aurora doesn't have BrowserApp, hence moving that piece of code from BrowserApp to GeckoApp.
Attachment #635032 - Flags: review?(mark.finkle)
Comment on attachment 635032 [details] [diff] [review] Patch for Aurora The older patch posted is for central -- which is same as new patch. Killing the new one.
Attachment #635032 - Attachment is obsolete: true
Attachment #635032 - Flags: review?(mark.finkle)
No longer depends on: 765156
Verified fixed on: Htc Desire Z (2.3.3) Using: Nightly Fennec 16.0a1 (2012-07-09) Aurora Fennec 15.0a2 (2012-07-09) When tab-menu is opened the browser slides.
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: