-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: reduce app size by removing mapbox #1516
chore: reduce app size by removing mapbox #1516
Conversation
Details: - Reduce image size - Android Lint to improve some Koitline code, remove unused imports - enable shrinkResource - Set resConfig to "en" as other translation is not fully supported now
Proguard is working. Without proguard - 18.8 MB After removing mapbox and jackson-kotlin-module with proguard - 4.7 MB |
val MAP_LOCATION = "${event.latitude},${event.longitude}" | ||
val MAP_SETTINGS = "&zoom=15&size=320x200&sensor=false" | ||
val MAP_KEY = "&key = $GOOGLE_MAP_KEY" | ||
return MAP_BASE_URL + MAP_LOCATION + MAP_SETTINGS + MAP_KEY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could remain as MapBox is better for free projects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have returned it back to Mapbox
@@ -56,11 +55,37 @@ class SearchLocationFragment : Fragment() { | |||
redirectToMain() | |||
}) | |||
|
|||
setupPlaceAutoCompleteFrag(savedInstanceState) | |||
rootView.locationSearchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What'll happen here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In short, I reverted it back to old SearchLocationFragment where there is only a searchview for user to type in the name of the the place, there isn't location suggestion anymore (I will improve this fragment with retaining old search and hopefully a better autosuggestion solution if this PR is accepted). Here is the view:
@@ -1,28 +1,18 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<androidx.constraintlayout.widget.ConstraintLayout | |||
<RelativeLayout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reverted it
Details: Completely remove mapbox and replace current autosuggestion location search view with old search view
app/build.gradle
Outdated
@@ -22,6 +22,7 @@ android { | |||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | |||
vectorDrawables.useSupportLibrary = true | |||
multiDexEnabled true | |||
resConfigs "en" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
Fixes #1515
Changes:
Currently, the APK size is 7.8MB and the download size is 7.2 MB. One more thing I find is that Proguard is not customized for the project and it still keeps everything so it doesn't help to reduce the app size - if I comment the Proguard line in the app Gradle file, it doesn't change the app size (hope that I understand this correctly). I'll take a closer look at this more on tomorrow