Opened 3 years ago
Closed 3 years ago
#5242 closed change (fixed)
Adjust setIcon() methods in UrlInputOpenerPreference
Reported by: | jwangenheim | Assignee: | diegocarloslima |
---|---|---|---|
Priority: | P5 | Milestone: | Adblock-Plus-for-Samsung-Browser-1.1.1 |
Module: | Adblock-Plus-for-Samsung-Browser | Keywords: | |
Cc: | fhd, diegocarloslima | Blocked By: | |
Blocking: | Platform: | Samsung Browser | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by diegocarloslima)
Background
Probably for historical reasons there is a setIcon() method in UrlInputOpenerPreference, that checks if the OS version is at least Honeycomb (API Level 11). As Adblock Plus for Samsung Browser is currently only available for devices with at least Android 5 (API Level 21), this code is obsolete.
What to change
Refactor code and delete setIcon(Drawable icon) method.
Also, ContextCompat.getDrawable() can be replaced by Context.getDrawable()
Change History (6)
comment:1 Changed 3 years ago by diegocarloslima
comment:2 Changed 3 years ago by diegocarloslima
- Description modified (diff)
- Priority changed from Unknown to P5
- Summary changed from Remove obsolete setIcon() method in UrlInputOpenerPreference to Adjust setIcon() methods in UrlInputOpenerPreference
comment:3 Changed 3 years ago by diegocarloslima
- Milestone set to Adblock-Plus-for-Samsung-Browser-next
- Owner set to diegocarloslima
comment:4 Changed 3 years ago by diegocarloslima
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:5 Changed 3 years ago by abpbot
A commit referencing this issue has landed:
Issue 5242 - Adjust setIcon() methods in UrlInputOpenerPreference
comment:6 Changed 3 years ago by diegocarloslima
- Resolution set to fixed
- Status changed from reviewing to closed
Note: See
TracTickets for help on using
tickets.
Yeah, this was mainly because I'm using the same component in ABB and ABP for Samsung Internet. We can also change ContextCompat.getDrawable(getContext(), iconResId); to just use final Drawable drawable = getContext().getDrawable(iconResId);