Skip to content

Improve and shrink resources #1603

@TobiGr

Description

@TobiGr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionThis needs to be discussed before anything is donefeature requestIssue is related to a feature in the app

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions