Skip to content

Use vector drawables instead of PNGs for material icons#3271

Merged
TobiGr merged 16 commits intoTeamNewPipe:devfrom
Stypox:icons
May 21, 2020
Merged

Use vector drawables instead of PNGs for material icons#3271
TobiGr merged 16 commits intoTeamNewPipe:devfrom
Stypox:icons

Conversation

@Stypox
Copy link
Member

@Stypox Stypox commented Mar 25, 2020

What is it?

  • Bug fix
  • Feature
  • Enhancement under the hood

Long description of the changes in your PR

For all manually-created images PNG have been kept. Debug apk size decreased by 232,030 bytes.

  • Rename all icon attrs to have a ic_ prefix
  • Always use _24dp icons, because there is no real difference, since they are vector drawables
  • Always use the original name found on material.io for icon drawables, as to not create confusion and possibly duplicates. Icon names can still be different from real drawable names, though I have made some of them compliant to this or maybe more meaningul.
  • Use standard icons for expand_more and expand_less instead of triangles
  • Use play_button_outline instead of custom PNG as play button in VideoDetailFragment (questionable, as there is no shadow anymore)
  • Replace the search-insert-icon (on the button that is right to every search suggestion, and when pressed replaces what is in the search field with the value of that suggestion), that was an arrow pointing up-left and didn't have a meaning, with a custom hand-made icon (ic_search_add)
  • Keep ic_close and ic_replay as PNGs: needed for notifications in RemoteViews

Other changes:

  • Remove duplicate getIconByAttr() in ThemeHelper (use resolveResourceIdFromAttr() instead)
  • Improve the VideoDetailFragment layout by a little by forcing the "expand description" icon to always stay in the same place even after expanding. I tested the new layout on various screens and it always looked ok.
  • Update AndroidX to 1.1.0 to fix icon crashes in preferences on API 19: use androidx.preference:preference instead of androidx.legacy:legacy-preference-v14
  • Remove legacy libraries (androidx.legacy:legacy-support-v4): this made no effect, and allowed me not to use androidx.appcompat.widget.* everywhere, tested on various Android versions
  • Fix SelectChannelFragment and SelectKioskFragment (those used to set main screen tabs): in API 19 they had a duplicate title always empty.
  • Fix pause icon used instead of play when seeking in a paused popup player

Fixes the following issue(s)

Testing apk

Tested thoroughly on API 19 (Galaxy Nexus (small screen) and Pixel 3 XL (big screen) emulators on Android 4.4), on API 24 (native on Huawei P9 Lite with Android 7.0), on API 29 (Pixel 3 XL emulator on Android 10). Though I'm not entirely sure I have explored every single piece of the app, so I'd like @domiuns and @Anotherlife to test it, too, on Android 4.4 ;-)
Debug apk: app-debug_2.zip

Agreement

@Stypox Stypox added feature request Issue is related to a feature in the app GUI Issue is related to the graphical user interface labels Mar 26, 2020
@Stypox Stypox force-pushed the icons branch 4 times, most recently from 07efdea to 7b91ba1 Compare April 1, 2020 20:34
@Stypox Stypox marked this pull request as ready for review April 1, 2020 20:47
@VGkav
Copy link

VGkav commented Apr 1, 2020

Oh, no, it crashed when I tried to fast forward with double-tapping. While in fullscreen.

https://pastebin.com/QmfEPdsf

@Stypox
Copy link
Member Author

Stypox commented Apr 2, 2020

@Anotherlife fixed with the latest commit, could you test this new apk? app-debug_1.zip

@VGkav
Copy link

VGkav commented Apr 2, 2020

Seems good now :D

@VGkav
Copy link

VGkav commented Apr 2, 2020

Wait, there is no icon to maximise a popup window! The control is there and it works but there is no icon visible.

@Stypox
Copy link
Member Author

Stypox commented Apr 2, 2020

I fixed it in the last commit, but didn't upload a new apk due to connection problems 😅

@Stypox
Copy link
Member Author

Stypox commented Apr 2, 2020

Here it is: app-debug_2.zip

@Stypox Stypox force-pushed the icons branch 2 times, most recently from 4bd8822 to 1c03741 Compare April 10, 2020 20:38
@Stypox
Copy link
Member Author

Stypox commented Apr 15, 2020

@TobiGr @wb9688 can I add this to the 0.19.3 milestone? It should be reviewed&merged soon imo, because there are many changed files causing conflicts and at the end of the day it is not really a breaking change.

@wb9688
Copy link
Contributor

wb9688 commented Apr 15, 2020

@Stypox: We don't want to add anything new to the v0.19.3 milestone. I think you should add it to the v0.20.0 milestone.

@Stypox Stypox modified the milestones: 0.20.0, 0.19.4 Apr 15, 2020
@Stypox
Copy link
Member Author

Stypox commented May 6, 2020

I just rebased

@Stypox Stypox force-pushed the icons branch 2 times, most recently from 1aef2f7 to 9d338d0 Compare May 9, 2020 14:19
@Stypox
Copy link
Member Author

Stypox commented May 20, 2020

@Anotherlife @domiuns @mqus @jojoxl01 @ask6155 @skil3z could you test this apk on your Android 4.4 devices? In particular you sould verify if all icons are visible. Thank you in advance :-)
app-debug.zip

@VGkav
Copy link

VGkav commented May 20, 2020

Looks good to me, I didn't see any icons missing. Unless I didn't see them because they were missing ... badum tisshhh

@TobiGr
Copy link
Contributor

TobiGr commented May 20, 2020

Ah. just saw one thing: Please undo the icon change in the navigation drawer. According to material.io a:small_red_triangle_down: should be used and not a v.

@Stypox
Copy link
Member Author

Stypox commented May 21, 2020

Oh sorry, didn't notice that. I replaced the expand icon with a drop one in the latest commit:
app-debug_1.zip

Stypox added 16 commits May 21, 2020 15:39
For all manually-created images PNG have been kept.
- rename all icon attrs to have a `ic_` prefix
- always use `_24dp` icons, because there is no real difference, since they are vector drawables
- always use the original name found on material.io for icon drawables, as to not create confusion and possibly duplicates. Icon names can still be different from real drawable names, though I have made some of them compliant to this or maybe more meaningul.
- remove duplicate `getIconByAttr()` in ThemeHelper (use `resolveResourceIdFromAttr()`
- use standard icons for `expand_more` and `expand_less` instead of triangles
- use `play_button_outline` instead of custom PNG as play button in VideoDetailFragment (questionable, as there is no shadow anymore)
The other icons used in notifications are taken from exoplayer's ones: `@drawable/exo_controls_*`
Also remove legacy libraries
Use `androidx.preference:preference` instead of `androidx.legacy:legacy-preference-v14` and remove `androidx.legacy:legacy-support-v4
Also use `setBackgroundResource` to automatically obtain PNG drawables (from exoplayer)
Also replace all tabs with 4 spaces
Copy link
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TobiGr TobiGr merged commit 176d57b into TeamNewPipe:dev May 21, 2020
@jojoxl01
Copy link

jojoxl01 commented May 22, 2020 via email

This was referenced May 29, 2020
@Stypox Stypox deleted the icons branch August 4, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request Issue is related to a feature in the app GUI Issue is related to the graphical user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New drawables and icons

6 participants