Loading...
Searching...
No Matches
ZoomControlsConfig.java
Go to the documentation of this file.
1package com.navigine.view.widgets;
2
3import android.graphics.drawable.Drawable;
4
19public class ZoomControlsConfig {
20
21 private Drawable zoomInIcon;
22 private Drawable zoomOutIcon;
23 private Integer buttonBackgroundColor;
24 private Integer textColor;
25 private float buttonWidth;
26 private float zoomControlsHeight;
27 private int marginRight;
28 private int marginVertical;
29
30 private ZoomControlsConfig() {}
31
32 public static Builder builder() {
33 return new Builder();
34 }
35
36 public static ZoomControlsConfig defaultConfig() {
37 return builder().build();
38 }
39
40 public static class Builder {
41 private final ZoomControlsConfig config = new ZoomControlsConfig();
42
43 public Builder zoomInIcon(Drawable icon) {
44 config.zoomInIcon = icon;
45 return this;
46 }
47
48 public Builder zoomOutIcon(Drawable icon) {
49 config.zoomOutIcon = icon;
50 return this;
51 }
52
53 public Builder buttonBackgroundColor(int color) {
54 config.buttonBackgroundColor = color;
55 return this;
56 }
57
58 public Builder textColor(int color) {
59 config.textColor = color;
60 return this;
61 }
62
63 public Builder buttonWidth(float dp) {
64 config.buttonWidth = dp;
65 return this;
66 }
67
68 public Builder zoomControlsHeight(float dp) {
69 config.zoomControlsHeight = dp;
70 return this;
71 }
72
73 public Builder marginRight(int dp) {
74 config.marginRight = dp;
75 return this;
76 }
77
78 public Builder marginVertical(int dp) {
79 config.marginVertical = dp;
80 return this;
81 }
82
83 public ZoomControlsConfig build() {
84 return config;
85 }
86 }
87
88 public Drawable getZoomInIcon() { return zoomInIcon; }
89 public Drawable getZoomOutIcon() { return zoomOutIcon; }
90 public Integer getButtonBackgroundColor() { return buttonBackgroundColor; }
91 public Integer getTextColor() { return textColor; }
92 public float getButtonWidth() { return buttonWidth; }
93 public float getZoomControlsHeight() { return zoomControlsHeight; }
94 public int getMarginRight() { return marginRight; }
95 public int getMarginVertical() { return marginVertical; }
96}