MCPcopy Create free account
hub / github.com/cinit/TMoe / setIcon

Method setIcon

app/src/main/java/cc/ioctl/tmoe/ui/wrapper/component/Switch.java:286–295  ·  view source on GitHub ↗
(int icon)

Source from the content-addressed store, hash-verified

284 }
285
286 public void setIcon(int icon) {
287 if (icon != 0) {
288 iconDrawable = getResources().getDrawable(icon).mutate();
289 if (iconDrawable != null) {
290 iconDrawable.setColorFilter(new PorterDuffColorFilter(lastIconColor = Theme.getColor(isChecked ? trackCheckedColorKey : trackColorKey), PorterDuff.Mode.MULTIPLY));
291 }
292 } else {
293 iconDrawable = null;
294 }
295 }
296
297 public boolean hasIcon() {
298 return iconDrawable != null;

Callers

nothing calls this directly

Calls 3

getColorMethod · 0.95
getResourcesMethod · 0.80
setColorFilterMethod · 0.45

Tested by

no test coverage detected