Closed
Bug 1329145
Opened 7 years ago
Closed 7 years ago
Custom tabs: support custom enter and exit animation
Categories
(Firefox for Android Graveyard :: General, defect)
Firefox for Android Graveyard
General
Tracking
(firefox54 fixed)
VERIFIED
FIXED
Firefox 54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: jcheng, Assigned: walkingice)
References
Details
Attachments
(3 files)
as a 3rd party app developer, I want to be able to customize the enter and exit animation when I make use of custom tabs
Reporter | ||
Updated•7 years ago
|
Blocks: customtabs
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → walkingice0204
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8831030 -
Flags: review?(s.kaspari)
Attachment #8831031 -
Flags: review?(s.kaspari)
Attachment #8831032 -
Flags: review?(s.kaspari)
Comment 4•7 years ago
|
||
mozreview-review |
Comment on attachment 8831030 [details] Bug 1329145 - Part 1: re-indent code style https://reviewboard.mozilla.org/r/107682/#review109232
Attachment #8831030 -
Flags: review?(s.kaspari) → review+
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8831031 [details] Bug 1329145 - Part 2: To apply custom animation if any https://reviewboard.mozilla.org/r/107684/#review109234 Some concerns but overall still r+. ::: mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java:48 (Diff revision 1) > private boolean useDomainTitle = true; > > private int toolbarColor; > private String toolbarTitle; > > + private Bundle animationBundle; Do we need to referene this from the activity? Can't we get it from the Intent when needed? ::: mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java:111 (Diff revision 1) > @Override > + public String getPackageName() { > + if (isFinishing() && BundleUtil.hasExitAnimation(animationBundle)) { > + // The caller specify its own customized animation > + // Use its package name to retrieve animation resource > + return BundleUtil.getPackageName(animationBundle); > + } else { > + return super.getPackageName(); > + } > + } Why do we need to override this (can you add a comment)? I'm a bit afraid that this will lead to problems down the road (e.g. we pass this context to another class or helper method and it wants to read the name of the package it's in). Is there a way to avoid this? ::: mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java:224 (Diff revision 1) > window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); > window.setStatusBarColor(ColorUtil.darken(toolbarColor, 0.25)); > } > } > + > + private static class BundleUtil { Let's move this into a separate class in the same package. We are starting to build a completely new activity here. Let's not make the same mistakes we did with BrowserApp and let it grow into a beast. :) Also: If you think we should adapt some better architecture in Fennec then this new activity is a good place to start and show better approaches. :)
Attachment #8831031 -
Flags: review?(s.kaspari) → review+
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8831032 [details] Bug 1329145 - Part3: add test cases https://reviewboard.mozilla.org/r/107686/#review109236 Awesome! <3 tests
Attachment #8831032 -
Flags: review?(s.kaspari) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 9•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8831031 [details] Bug 1329145 - Part 2: To apply custom animation if any https://reviewboard.mozilla.org/r/107684/#review109234 > Do we need to referene this from the activity? Can't we get it from the Intent when needed? Done, use `getIntent` to make less references. > Why do we need to override this (can you add a comment)? > > I'm a bit afraid that this will lead to problems down the road (e.g. we pass this context to another class or helper method and it wants to read the name of the package it's in). Is there a way to avoid this? after peeping AOSP source code, method `overridePendingTransition` will call getPackageName directly, to get animation resource from specific package. We should change package name to get 3rd-party-app custom animation resource. I did some modification to here, added a boolean flag in `finish` to make sure only return 3rd party package name if conditions satisfied. https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/Activity.java#4952 > Let's move this into a separate class in the same package. We are starting to build a completely new activity here. Let's not make the same mistakes we did with BrowserApp and let it grow into a beast. :) > > Also: If you think we should adapt some better architecture in Fennec then this new activity is a good place to start and show better approaches. :) Done, I moved it into a standalone class and also rename it to IntentUtil. Because I want to add more code to it, as well as unit-test.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Comment 14•7 years ago
|
||
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/98a7d9384109 Part 1: re-indent code style r=sebastian https://hg.mozilla.org/integration/autoland/rev/e627854c8ae5 Part 2: To apply custom animation if any r=sebastian https://hg.mozilla.org/integration/autoland/rev/f10e4c476899 Part3: add test cases r=sebastian
Keywords: checkin-needed
Comment 15•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/98a7d9384109 https://hg.mozilla.org/mozilla-central/rev/e627854c8ae5 https://hg.mozilla.org/mozilla-central/rev/f10e4c476899
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
Comment 16•7 years ago
|
||
Verified as fixed in build 55.0a1 (2017-05-17). Devices: Nexus 9 (Android 7.1.1) and HTC Desire 820 (Android 6.0.1).
Status: RESOLVED → VERIFIED
Updated•3 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
•