Closed
Bug 918015
Opened 11 years ago
Closed 11 years ago
Regression: Tablet throbber animation does not move smoothly horizontal when navigating forward
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox26 affected, firefox27 affected, firefox28 affected, firefox29 unaffected, fennec+)
RESOLVED
WORKSFORME
Tracking | Status | |
---|---|---|
firefox26 | --- | affected |
firefox27 | --- | affected |
firefox28 | --- | affected |
firefox29 | --- | unaffected |
fennec | + | --- |
People
(Reporter: liuche, Assigned: liuche)
References
Details
(Keywords: reproducible)
Attachments
(3 files)
51.60 KB,
image/png
|
Details | |
9.21 KB,
patch
|
lucasr
:
review-
liuche
:
feedback+
|
Details | Diff | Splinter Review |
14.69 KB,
patch
|
lucasr
:
feedback+
|
Details | Diff | Splinter Review |
On tablet, when navigating forward to a page, the loading throbber dips while the forward button is being hidden.
It's pretty adorable, but should probably be fixed.
Assignee | ||
Updated•11 years ago
|
Blocks: new-about-home
Updated•11 years ago
|
tracking-fennec: --- → ?
Updated•11 years ago
|
Keywords: reproducible
Comment 1•11 years ago
|
||
What release is this happening in? Fx26 or Fx25?
Assignee: nobody → sriram
tracking-fennec: ? → +
Comment 2•11 years ago
|
||
(In reply to Mark Finkle (:mfinkle) from comment #1)
> What release is this happening in? Fx26 or Fx25?
This was introduced in bug 853844 which landed in Fx26.
Comment 3•11 years ago
|
||
Dupe of Bug 936857?
Assignee | ||
Comment 4•11 years ago
|
||
Assignee | ||
Comment 6•11 years ago
|
||
Duping here because there's more discussion here, and linking over the clip rnewman took: https://www.youtube.com/watch?v=BVJh4vvJJAs
Comment 7•11 years ago
|
||
Using <animated-rotate/> instead of rotating the view. I still haven't figured out how Android accomplishes it with just one drawable. But they use "ProgressBar" which does a lot of work. May be, if we copy and create our own version, we could do better.
Attachment #8335572 -
Flags: review?(liuche)
Comment 8•11 years ago
|
||
Here's another option I'm trying:
<rotate/> can rotate a drawable from start to end degrees based on a "level". So, if we increment the level from 0 to 10000 at 1000 increments for every 100ms, we would get a nice animations. Do we want to take that approach? Or the default one above is enough?
Comment 9•11 years ago
|
||
This is another option. The Drawable can be a rotate drawable, and the level can be changed from 0 to 10000, and the drawable rotates smoooooooooothly. (If its called every 16ms).
Attachment #8335676 -
Flags: feedback?(liuche)
Assignee | ||
Comment 10•11 years ago
|
||
Comment on attachment 8335572 [details] [diff] [review]
Patch
Review of attachment 8335572 [details] [diff] [review]:
-----------------------------------------------------------------
I'll need to test this on a tablet tomorrow before giving r+. I'm also not sure I'm clear on why using Animatable fixes this problem, while using AnimationDrawable causes the problem? Not sure I know Android Animations well enough.
::: mobile/android/base/toolbar/BrowserToolbar.java
@@ +42,5 @@
> import android.content.res.Resources;
> import android.graphics.Bitmap;
> import android.graphics.Color;
> import android.graphics.Rect;
> +import android.graphics.drawable.Animatable;
How does using an Animatable fix this problem? We still use the same .start() call, but just cast to Animatable.
@@ -972,2 @@
> setPageActionVisibility(true);
> - mFavicon.setAnimation(mProgressSpinner);
Do we need Favicons to implement setAnimation anymore, or is that dead code now?
@@ +972,5 @@
> if (selectedTab != null)
> setFavicon(selectedTab.getFavicon());
>
> if (mSpinnerVisible) {
> setPageActionVisibility(false);
Is the throbber still running at this point? If not, why didn't you need to stop it?
Attachment #8335572 -
Flags: review?(lucasr.at.mozilla)
Attachment #8335572 -
Flags: review?(liuche)
Attachment #8335572 -
Flags: feedback+
Comment 11•11 years ago
|
||
Comment on attachment 8335572 [details] [diff] [review]
Patch
Review of attachment 8335572 [details] [diff] [review]:
-----------------------------------------------------------------
Using AnimationDrawables has the (big) drawback of crappy framerates (I tested your patch locally to confirm). I'd prefer something more like a custom progress bar. But independently of the specific solution here, we should keep a smooth framerate on the throbber.
::: mobile/android/base/toolbar/BrowserToolbar.java
@@ +963,3 @@
> //To stop the glitch caused by mutiple start() calls.
> if (!mSpinnerVisible) {
> + ((Animatable) mFavicon.getDrawable()).start();
I'd prefer something like:
mFavicon.getDrawable().setVisible(true, true);
Attachment #8335572 -
Flags: review?(lucasr.at.mozilla) → review-
Assignee | ||
Comment 12•11 years ago
|
||
Yeah, I also tested this build on both phones and tablets, and the animation looks really janky again...
Comment 13•11 years ago
|
||
(In reply to Lucas Rocha (:lucasr) from comment #11)
> Comment on attachment 8335572 [details] [diff] [review]
> Patch
>
> Review of attachment 8335572 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Using AnimationDrawables has the (big) drawback of crappy framerates (I
> tested your patch locally to confirm). I'd prefer something more like a
> custom progress bar. But independently of the specific solution here, we
> should keep a smooth framerate on the throbber.
>
> ::: mobile/android/base/toolbar/BrowserToolbar.java
> @@ +963,3 @@
> > //To stop the glitch caused by mutiple start() calls.
> > if (!mSpinnerVisible) {
> > + ((Animatable) mFavicon.getDrawable()).start();
>
> I'd prefer something like:
> mFavicon.getDrawable().setVisible(true, true);
<animated-rotate/> is non-standard (non-public) API. There is no way to specify the number of frames or duration. That's the reason why it feels so.
Updated•11 years ago
|
Attachment #8335676 -
Flags: feedback?(lucasr.at.mozilla)
Comment 14•11 years ago
|
||
Comment on attachment 8335676 [details] [diff] [review]
WIP: Animation inside View
Review of attachment 8335676 [details] [diff] [review]:
-----------------------------------------------------------------
Have an apk to share? Just curious about the framerate with this patch. This will be constantly invalidating the drawable (and the holding view consequently) which is slightly less efficient than doing animations with a hw layers.
::: mobile/android/base/toolbar/BrowserToolbar.java
@@ +967,5 @@
> Log.i(LOGTAG, "zerdatime " + SystemClock.uptimeMillis() + " - Throbber start");
> } else {
> Tab selectedTab = Tabs.getInstance().getSelectedTab();
> if (selectedTab != null)
> setFavicon(selectedTab.getFavicon());
Strictly speaking, you should probably make things like setImageBitmap() and setImageDrawable() calls stop the animation runnable internally.
::: mobile/android/base/toolbar/FaviconButton.java
@@ +28,5 @@
> + @Override
> + public void run() {
> + final int level = mDrawable.getLevel();
> + mDrawable.setLevel(level + 100 >= 10000 ? 0 : level + 100);
> + postDelayed(this, 16);
Replace this with ViewCompat.postOnAnimation(FaviconButton.this, this).
Attachment #8335676 -
Flags: feedback?(lucasr.at.mozilla) → feedback+
Comment 15•11 years ago
|
||
Comment on attachment 8335676 [details] [diff] [review]
WIP: Animation inside View
Review of attachment 8335676 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/toolbar/BrowserToolbar.java
@@ +967,5 @@
> Log.i(LOGTAG, "zerdatime " + SystemClock.uptimeMillis() + " - Throbber start");
> } else {
> Tab selectedTab = Tabs.getInstance().getSelectedTab();
> if (selectedTab != null)
> setFavicon(selectedTab.getFavicon());
Drive-by, 'cos I'm touching this code right now and finding issues -- bear in mind that Bug 941844 and Bug 924712 still apply, so I wouldn't be surprised if this code were invoked multiple times... perhaps as much as six times on a page load. That might mess with your framerate, or even make a difference in which solution is best.
Assignee | ||
Comment 16•11 years ago
|
||
Comment on attachment 8335676 [details] [diff] [review]
WIP: Animation inside View
Clearing review flag because I'm going on PTO.
Attachment #8335676 -
Flags: feedback?(liuche)
Comment 17•11 years ago
|
||
Chenxia, can you determine whether this is fixed after bug 917896 lands?
Depends on: 917896
Flags: needinfo?(liuche)
Comment 19•11 years ago
|
||
I'm surprised such a glaring visual glitch is only tracking +.
Assignee: sriram.mozilla → nobody
Updated•11 years ago
|
status-firefox26:
--- → affected
status-firefox27:
--- → affected
status-firefox28:
--- → affected
status-firefox29:
--- → affected
Assignee | ||
Comment 20•11 years ago
|
||
Will do.
Updated•11 years ago
|
Assignee: nobody → liuche
Status: NEW → ASSIGNED
Hardware: ARM → All
Assignee | ||
Comment 21•11 years ago
|
||
I can't repro the rolling favicon with the the current APK from bug 917896, but the forward button behavior doesn't really seem to work anymore.
Flags: needinfo?(liuche)
Comment 22•11 years ago
|
||
Throbber replaced on trunk with a progress-bar; marking as such. Other channels still affected.
Assignee | ||
Updated•11 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•