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

Class CombinedDrawable

app/src/main/java/cc/ioctl/tmoe/ui/util/CombinedDrawable.java:17–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15import androidx.annotation.NonNull;
16
17public class CombinedDrawable extends Drawable implements Drawable.Callback {
18
19 private Drawable background;
20 private Drawable icon;
21 private int left;
22 private int top;
23 private int iconWidth;
24 private int iconHeight;
25 private int backWidth;
26 private int backHeight;
27 private int offsetX;
28 private int offsetY;
29 private boolean fullSize;
30
31 public CombinedDrawable(Drawable backgroundDrawable, Drawable iconDrawable, int leftOffset, int topOffset) {
32 background = backgroundDrawable;
33 icon = iconDrawable;
34 left = leftOffset;
35 top = topOffset;
36 if (iconDrawable != null) {
37 iconDrawable.setCallback(this);
38 }
39 }
40
41 public void setIconSize(int width, int height) {
42 iconWidth = width;
43 iconHeight = height;
44 }
45
46 public CombinedDrawable(Drawable backgroundDrawable, Drawable iconDrawable) {
47 background = backgroundDrawable;
48 icon = iconDrawable;
49 if (iconDrawable != null) {
50 iconDrawable.setCallback(this);
51 }
52 }
53
54 public void setCustomSize(int width, int height) {
55 backWidth = width;
56 backHeight = height;
57 }
58
59 public void setIconOffset(int x, int y) {
60 offsetX = x;
61 offsetY = y;
62 }
63
64 public Drawable getIcon() {
65 return icon;
66 }
67
68 public Drawable getBackground() {
69 return background;
70 }
71
72 public void setFullsize(boolean value) {
73 fullSize = value;
74 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected