-
Notifications
You must be signed in to change notification settings - Fork 6
Migration Guide
Due to change in structure of the project, the following tips would help anyone using pre v4.0 library to be able to migrate to the latest version.
There are some changes for version 5 of the library, as we migrate to newer versions of gradle, android gradle plugin and use maven publish.
This guide is still being updated and is subject to modification as the APIs are being finalized.
Please make sure the following items are taken into account when migrating to this version of the library.
- Use the gradle build system / Android Studio Project Format
- Use AndroidX libraries instead of the support libraries
Previously all the java components were available under the package com.ae.apps.common
.
Starting from version 4.0, these would be available under com.ae.apps.lib
.
The major factor for the change is it was confusing at times to differentiate from application specific code and library code.
All the functionality provided by the library are separated into different modules. The dependencies between the modules is defined in the Architecture page.
Presently the following modules are present as part of the library.
- aeapps (new in v5, includes all other modules)
- core
- common models
- custom views
- sms-api
- contacts-api
- multi-contact
- database-helpers
- runtime-permissions
- billing-client
- mocks
- utilities
Either all the modules could be referenced by a project or just the modules that are required.
Note: mocks
module contains mock implementations and utils that are mainly used for Unit Tests. It is used as a test dependency whenever possible.
The models have been renamed from VO to Models, Follow the below table for
Value Object Name | Model Name |
---|---|
com.ae.apps.common.vo.ContactVo | com.ae.apps.lib.common.models.ContactInfo |
com.ae.apps.common.vo.MessageVo | com.ae.apps.lib.common.models.MessageInfo |
com.ae.apps.common.vo.PhoneNumberVo | com.ae.apps.lib.common.models.PhoneNumberInfo |
com.ae.apps.common.vo.ContactMessageVo | None |
Include the core library and change the implementation as documented below.
implementation 'com.github.midhunhk.lib-aeapps:sms-api:<version>'
Old Component | New Component |
---|---|
com.ae.apps.common.managers.SMSManager | com.ae.apps.lib.api.sms.SmsApiGateway |
The old implementation used the name as
SMSManager
, which is the same name as a core Android class. As well as since it is not "managing any SMS", it was decided to change the naming toApiGateway
and re-architect the implementation.
Include the contacts-api library and change the implementation as documented below.
implementation 'com.github.midhunhk.lib-aeapps:contacts-api:<version>'
Old Component | New Component |
---|---|
com.ae.apps.common.managers.ContactManager | com.ae.apps.lib.api.contacts.ContactApiGateway |
Since the old implementation didn't actually "manage any contacts", it has been re-architected as an
ApiGateway
since it provides an abstraction over the Contacts API of Android.
Call one of the initialize methods to have the library read and cache all contacts locally and then perform other operation on the API.
Custom Views have also changed their package.
Old Name | New Name |
---|---|
com.ae.apps.common.views.EmptyRecyclerView | com.ae.apps.lib.custom.views.EmptyRecyclerView |
The following animation resources were renamed to be consistent.
Old name | New name |
---|---|
fade_in.xml | anim_fade_in.xml |
slide_in_top.xml | anim_slide_in_top.xml |
The dimension values that were supplied from the library were inconsistent and same values were being used for both margin and padding. Refer to the below tables to see a comparison of the old and new values.
|
|
These dimensions are set for mobile screen densities, and could easily be overridden in the values-xxx for larger screens like tablets.
Colors that were named inconsistently have been removed and standardized as below.
color name |
---|
color_white |
color_black |
color_red |
color_silver |
color_bright_orange |
color_grey_dark |
color_grey_light |
color_almost_white |
color_slate_blue_dark |
color_lime_green |
color_blue_dark |
Additional Colors that are added.
color name | hex value |
---|---|
color_lavender | #E82D9E |
color_bright_red | #E1000A |
color_blue_grey | #ff21272b |