-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
I took a look at the resources and I think that there is potential to minimize NewPipe's size further.
1. Remove duplicate resource strings
In main/res/values/strings.xml you will find several identical strings/values with different names:
- Play:
play_btn_text
,view
- Video preview thumbnail:
list_thumbnail_view_description
,detail_thumbnail_view_description
- Popup:
controls_popup_title
,settings_category_popup_title
- Error:
general_error
,msg_error
- Downloads:
downloads
,downloads_title
- Audio:
play_audio
,audio
- History:
title_activity_history
,action_history
- NewPipe:
app_name
,preferred_open_action_share_menu_title
- Download:
download
,download_dialog_title
,settings_category_downloads_title
- Settings:
settings
,action_settings
- About:
action_about
,tab_about
By removing at least one duplicate occurrence, we'd not only reduce the effort it needs to translate all parts of the app but also the APK size. In some cases it makes sense to not remove the whole string and its value, but replace the value with a reference to another string:
<string name="downloads_title">Downloads</string>
=>
<string name="downloads_title" translatable="false">@string/downloads</string>
2. Remove unused strings
There are several unused strings which we should consider to remove. Unfortunately, Android Studio didn't do a good job while searching for unused resources and removed various required strings. For this reason, I wrote a small programme which is more reliable in finding unused strings. Nevertheless we should discuss what to do with strings which are likely to be used in the future. (e.g everything about TOR).
3. Optimize drawables
Our images need quite much memory. We should use vector graphics instead of PNGs (see #1199 for more info). There were some attempts to do this, but they got rejected. Until this is done, we can minimize the images manually or via ImgBot.
But before I dig a bit deeper in the optimization, I'd like to hear the common opinion on this. @theScrabi @wb9688 @mauriciocolli @karyogamy