@@ -38,6 +38,11 @@ public ScannerManager setBorderColor(int borderColor) {
3838 return this ;
3939 }
4040
41+ public ScannerManager setBorderSize (int borderSize ) {
42+ scanOption .borderSize = borderSize ;
43+ return this ;
44+ }
45+
4146 public ScannerManager setScanMode (int scanMode ) {
4247 scanOption .scanMode = scanMode ;
4348 return this ;
@@ -58,6 +63,16 @@ public ScannerManager continuousScan() {
5863 return this ;
5964 }
6065
66+ public ScannerManager setFlashLightOnDrawable (int flashLightOnDrawable ) {
67+ scanOption .flashLightOnDrawable = flashLightOnDrawable ;
68+ return this ;
69+ }
70+
71+ public ScannerManager setFlashLightOffDrawable (int flashLightOffDrawable ) {
72+ scanOption .flashLightOffDrawable = flashLightOffDrawable ;
73+ return this ;
74+ }
75+
6176 public ScannerManager setFlashLightOnText (String lightOnText ) {
6277 scanOption .flashLightOnText = lightOnText ;
6378 return this ;
@@ -73,12 +88,17 @@ public ScannerManager setScanNoticeText(String scanNoticeText) {
7388 return this ;
7489 }
7590
91+ public ScannerManager setFlashLightInvisible () {
92+ scanOption .dropFlashLight = true ;
93+ return this ;
94+ }
95+
7696 public ScannerManager setScanLineColors (List <Integer > scanLineColors ) {
7797 scanOption .scanLineColors = scanLineColors ;
7898 return this ;
7999 }
80100
81- public ScannerManager setBarcodeFormat (BarcodeFormat ... barcodeFormats ){
101+ public ScannerManager setBarcodeFormat (BarcodeFormat ... barcodeFormats ) {
82102 scanOption .barcodeFormats = Arrays .asList (barcodeFormats );
83103 return this ;
84104 }
@@ -103,13 +123,17 @@ public static class ScanOption implements Parcelable {
103123
104124 private int cornerColor ;
105125 private int borderColor ;
126+ private int borderSize ;
106127 private int scanMode ;
107128 private String title ;
108129 private boolean showAlbum = true ;
109130 private boolean continuousScan ;
110131
132+ private int flashLightOnDrawable ;
133+ private int flashLightOffDrawable ;
111134 private String flashLightOnText ;
112135 private String flashLightOffText ;
136+ private boolean dropFlashLight ;
113137 private String scanNoticeText ;
114138
115139 private List <BarcodeFormat > barcodeFormats ;
@@ -123,6 +147,10 @@ public int getBorderColor() {
123147 return borderColor ;
124148 }
125149
150+ public int getBorderSize () {
151+ return borderSize ;
152+ }
153+
126154 public int getScanMode () {
127155 return scanMode ;
128156 }
@@ -139,6 +167,14 @@ public boolean isContinuousScan() {
139167 return continuousScan ;
140168 }
141169
170+ public int getFlashLightOnDrawable () {
171+ return flashLightOnDrawable ;
172+ }
173+
174+ public int getFlashLightOffDrawable () {
175+ return flashLightOffDrawable ;
176+ }
177+
142178 public String getFlashLightOnText () {
143179 return flashLightOnText ;
144180 }
@@ -147,6 +183,10 @@ public String getFlashLightOffText() {
147183 return flashLightOffText ;
148184 }
149185
186+ public boolean isDropFlashLight () {
187+ return dropFlashLight ;
188+ }
189+
150190 public String getScanNoticeText () {
151191 return scanNoticeText ;
152192 }
@@ -168,12 +208,16 @@ public int describeContents() {
168208 public void writeToParcel (Parcel dest , int flags ) {
169209 dest .writeInt (this .cornerColor );
170210 dest .writeInt (this .borderColor );
211+ dest .writeInt (this .borderSize );
171212 dest .writeInt (this .scanMode );
172213 dest .writeString (this .title );
173214 dest .writeByte (this .showAlbum ? (byte ) 1 : (byte ) 0 );
174215 dest .writeByte (this .continuousScan ? (byte ) 1 : (byte ) 0 );
216+ dest .writeInt (this .flashLightOnDrawable );
217+ dest .writeInt (this .flashLightOffDrawable );
175218 dest .writeString (this .flashLightOnText );
176219 dest .writeString (this .flashLightOffText );
220+ dest .writeByte (this .dropFlashLight ? (byte ) 1 : (byte ) 0 );
177221 dest .writeString (this .scanNoticeText );
178222 dest .writeList (this .barcodeFormats );
179223 dest .writeList (this .scanLineColors );
@@ -185,12 +229,16 @@ public ScanOption() {
185229 protected ScanOption (Parcel in ) {
186230 this .cornerColor = in .readInt ();
187231 this .borderColor = in .readInt ();
232+ this .borderSize = in .readInt ();
188233 this .scanMode = in .readInt ();
189234 this .title = in .readString ();
190235 this .showAlbum = in .readByte () != 0 ;
191236 this .continuousScan = in .readByte () != 0 ;
237+ this .flashLightOnDrawable = in .readInt ();
238+ this .flashLightOffDrawable = in .readInt ();
192239 this .flashLightOnText = in .readString ();
193240 this .flashLightOffText = in .readString ();
241+ this .dropFlashLight = in .readByte () != 0 ;
194242 this .scanNoticeText = in .readString ();
195243 this .barcodeFormats = new ArrayList <>();
196244 in .readList (this .barcodeFormats , BarcodeFormat .class .getClassLoader ());
@@ -209,5 +257,6 @@ public ScanOption[] newArray(int size) {
209257 return new ScanOption [size ];
210258 }
211259 };
260+
212261 }
213262}
0 commit comments