Closed Bug 1189306 Opened 9 years ago Closed 9 years ago

Integration of Android Design Support library

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(firefox44 fixed)

RESOLVED FIXED
Firefox 44
Tracking Status
firefox44 --- fixed

People

(Reporter: sebastian, Assigned: sebastian)

References

Details

Attachments

(1 file)

The Android team recently released a design support library. Theoretically we could replace some of our custom components (for example TabMenuStripLayout) with tested and standardized components (TabLayout, Snackbar, TextInputLayout, ..). The library will also be helpful in continuing to 'materialize' Fennec (-> Material design). But the library will come at a price and we do not want to grow the APK size unbounded. This bug is just about exploring how we could integrate the library and how expensive this will actually be. Resources: * http://developer.android.com/tools/support-library/features.html#design * http://android-developers.blogspot.de/2015/05/android-design-support-library.html
Thanks for filing this Sebastian, I know we've talked about this for a while. I'm all for it, especially since I see this having more and more benefits for us as we move forward.
Just adding the library to the gradle based build let's the APK grow by 102596 bytes (~ 100 KB) > -rw-r--r-- 1 sebastian staff 34359294 Aug 5 17:52 after-lib.apk > -rw-r--r-- 1 sebastian staff 34256698 Aug 5 17:46 before-lib.apk Actually I was expecting more growth. I wonder how much we get back by getting rid of our implementations of TabMenuStripLayout etc.
Keep in mind the library in its current form may be getting ProGuarded out - as we start to use it, the size of the APK could increase.
(In reply to Michael Comella (:mcomella) from comment #3) > Keep in mind the library in its current form may be getting ProGuarded out - > as we start to use it, the size of the APK could increase. Yeah, definitely. This was just a first basic test. Mostly because this just requires a one line change. ;) Will definitely do some more investigation and try to add it to the mach build too. Also maybe trying to replace a simple component with one of the library and see how this changes overall size.
For the record, this ticket will get *MUCH* easier post Bug 1108782 (so much so that I'm calling that a pre-requisite). I fully support using these standardized libraries to ease our lives.
Depends on: 1108782
I'm going to look into this to see whether we can use snackbars soon (bug 1157526).
Assignee: nobody → s.kaspari
Depends on: 1214630
Try build without android design support library: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6440390fe2f0 Try build with library added and dummy usage of snackbar: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5123e22c33b9
Status: NEW → ASSIGNED
(In reply to Sebastian Kaspari (:sebastian) from comment #7) > Try build with library added and dummy usage of snackbar: > https://treeherder.mozilla.org/#/jobs?repo=try&revision=5123e22c33b9 This did not include my patch from bug 1214630. New push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3ad86c428a63
Summary: Investigate: Integration of Android Design Support library → Integration of Android Design Support library
Size comparison: Android 2.3 API9 opt: Without: 40606188 bytes With: 40848354 bytes +242166 bytes (~ 236 KB) Android 4.0 API11+ opt: Without: 42543954 bytes With: 42814779 bytes +270825 bytes (~ 264 KB)
The AAR itself is 238 KB (v23.0.1).
That's the patch for the build changes.
Attachment #8674179 - Flags: review?(nalexander)
(In reply to Sebastian Kaspari (:sebastian) from comment #10) > The AAR itself is 238 KB (v23.0.1). The uncompressed AAR is 339057 bytes (~ 331 KB)
Comment on attachment 8674179 [details] [diff] [review] 1189306-android-design-support-library.patch Review of attachment 8674179 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Can you post before and after APK sizes, so we really know what to expect? (It's reported in TH.)
Attachment #8674179 - Flags: review?(nalexander) → review+
Ah, you already posted APK sizes. Thanks. fabrice, reuben: it is possible that this is, or will be, a dependency of GV and not just Fennec. Just letting you know that it may be needed in b2gdroid, although I expect it won't be on day one. Like the appcompat-v7 library.
Flags: needinfo?(reuben.bmo)
Flags: needinfo?(fabrice)
ok, thanks for the heads up.
Flags: needinfo?(fabrice)
https://hg.mozilla.org/integration/fx-team/rev/5b8473ca678da4daa637109a0a96aee9281e5532 Bug 1189306 - Add Android Design Support library to gradle and mach builds. r=nalexander
Thanks for the ping.
Flags: needinfo?(reuben.bmo)
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
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: