Opened on 05/12/2017 at 02:32:10 PM
Closed on 06/01/2017 at 09:34:31 PM
#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()
Attachments (0)
Change History (6)
comment:1 Changed on 05/23/2017 at 03:19:02 PM by diegocarloslima
comment:2 Changed on 05/23/2017 at 03:21:25 PM 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 on 05/26/2017 at 09:38:37 PM by diegocarloslima
- Milestone set to Adblock-Plus-for-Samsung-Browser-next
- Owner set to diegocarloslima
comment:4 Changed on 05/26/2017 at 09:38:54 PM by diegocarloslima
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:5 Changed on 06/01/2017 at 09:33:58 PM by abpbot
A commit referencing this issue has landed:
Issue 5242 - Adjust setIcon() methods in UrlInputOpenerPreference
comment:6 Changed on 06/01/2017 at 09:34:31 PM 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);