Skip to content

Commit 7e15fa9

Browse files
committed
Added javaDoc
1 parent a29b6f5 commit 7e15fa9

3 files changed

Lines changed: 118 additions & 0 deletions

File tree

support/src/main/java/com/github/nikartm/support/AnimatedStripedDrawable.java

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,110 +190,186 @@ protected boolean isRunning() {
190190
return animator != null && animator.isStarted();
191191
}
192192

193+
/**
194+
* Get striped width
195+
*/
193196
public float getStripeWidth() {
194197
return stripeWidth;
195198
}
196199

200+
/**
201+
* Set striped width
202+
* @param stripeWidth drawable striped width
203+
*/
197204
public AnimatedStripedDrawable setStripeWidth(float stripeWidth) {
198205
this.stripeWidth = stripeWidth;
199206
invalidateSelf();
200207
return this;
201208
}
202209

210+
/**
211+
* Get drawable background color
212+
*/
203213
public int getColorBack() {
204214
return colorBack;
205215
}
206216

217+
/**
218+
* Set drawable background color
219+
* @param colorBack background color
220+
*/
207221
public AnimatedStripedDrawable setColorBack(int colorBack) {
208222
this.colorBack = colorBack;
209223
invalidateSelf();
210224
return this;
211225
}
212226

227+
/**
228+
* Get color the main stripe
229+
*/
213230
public int getColorMain() {
214231
return colorMain;
215232
}
216233

234+
/**
235+
* Set color the main stripe
236+
* @param colorMain color of main stripe
237+
*/
217238
public AnimatedStripedDrawable setColorMain(int colorMain) {
218239
this.colorMain = colorMain;
219240
invalidateSelf();
220241
return this;
221242
}
222243

244+
/**
245+
* Get color the sub stripe
246+
*/
223247
public int getColorSub() {
224248
return colorSub;
225249
}
226250

251+
/**
252+
* Set color the sub stripe
253+
* @param colorSub color of sub stripe
254+
*/
227255
public AnimatedStripedDrawable setColorSub(int colorSub) {
228256
this.colorSub = colorSub;
229257
invalidateSelf();
230258
return this;
231259
}
232260

261+
/**
262+
* Get alpha stripes
263+
*/
233264
public float getStripeAlpha() {
234265
return alpha;
235266
}
236267

268+
/**
269+
* Set alpha drawable stripes
270+
* @param alpha stripes
271+
*/
237272
public AnimatedStripedDrawable setStripeAlpha(float alpha) {
238273
this.alpha = alpha;
239274
invalidateSelf();
240275
return this;
241276
}
242277

278+
/**
279+
* Get drawable corner radius
280+
*/
243281
public float getCornerRadius() {
244282
return cornerRadius;
245283
}
246284

285+
/**
286+
* Set drawable corner radius
287+
* @param cornerRadius radius
288+
*/
247289
public AnimatedStripedDrawable setCornerRadius(float cornerRadius) {
248290
this.cornerRadius = cornerRadius;
249291
invalidateSelf();
250292
return this;
251293
}
252294

295+
/**
296+
* Get duration of stripes animation
297+
*/
253298
public int getStripeDuration() {
254299
return stripeDuration;
255300
}
256301

302+
/**
303+
* Set duration of stripes animation
304+
*/
257305
public AnimatedStripedDrawable setStripeDuration(int stripeDuration) {
258306
this.stripeDuration = stripeDuration;
259307
invalidateSelf();
260308
return this;
261309
}
262310

311+
/**
312+
* Get tilt of stripes
313+
*/
263314
public float getTilt() {
264315
return tilt;
265316
}
266317

318+
/**
319+
* Set tilt of stripes
320+
* @param tilt of stripes
321+
*/
267322
public AnimatedStripedDrawable setTilt(float tilt) {
268323
this.tilt = tilt;
269324
invalidateSelf();
270325
return this;
271326
}
272327

328+
/**
329+
* Get state of tilt stripes. If true - tilt to left, false - tilt to right.
330+
*/
273331
public boolean isStripeRevert() {
274332
return stripeRevert;
275333
}
276334

335+
/**
336+
* Get state of tilt stripes.
337+
* @param stripeRevert If true - tilt to left, false - tilt to right.
338+
*/
277339
public AnimatedStripedDrawable setStripeRevert(boolean stripeRevert) {
278340
this.stripeRevert = stripeRevert;
279341
invalidateSelf();
280342
return this;
281343
}
282344

345+
/**
346+
* Get states of showing stripes
347+
*/
283348
public boolean isShowStripes() {
284349
return showStripes;
285350
}
286351

352+
/**
353+
* Set states of showing stripes
354+
* @param showStripes If true - stripes showing, false - stripes gone.
355+
*/
287356
public AnimatedStripedDrawable setShowStripes(boolean showStripes) {
288357
this.showStripes = showStripes;
289358
invalidateSelf();
290359
return this;
291360
}
292361

362+
/**
363+
* Get states of stripes appearance
364+
*/
293365
public boolean isStripeGradient() {
294366
return stripeGradient;
295367
}
296368

369+
/**
370+
* Set the state of striped appearance of drawable
371+
* @param stripeGradient if true stripes has gradient style, false - flat strips
372+
*/
297373
public AnimatedStripedDrawable setStripeGradient(boolean stripeGradient) {
298374
this.stripeGradient = stripeGradient;
299375
invalidateSelf();

support/src/main/java/com/github/nikartm/support/AttributeController.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,18 @@ private void initAttrs(Context context, AttributeSet attrs) {
5353
}
5454
}
5555

56+
/**
57+
* Get striped drawable when init attrs
58+
* @return initialized with attrs the animated drawable
59+
*/
5660
public AnimatedStripedDrawable getStripedDrawable() {
5761
return drawable;
5862
}
5963

64+
/**
65+
* Get initialized the loading text
66+
* @return loading text
67+
*/
6068
public String getLoadingText() {
6169
return loadingText;
6270
}

support/src/main/java/com/github/nikartm/support/StripedProcessButton.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,44 +127,78 @@ private void setCurrentText(boolean start) {
127127
setText(currentText);
128128
}
129129

130+
/**
131+
* Adjust the striped drawable with animation
132+
* @return striped drawable
133+
*/
130134
public AnimatedStripedDrawable adjustButton() {
131135
return stripedDrawable;
132136
}
133137

138+
/**
139+
* Get current start animation duration
140+
* @return start duration in ms
141+
*/
134142
public long getStartAnimDuration() {
135143
return startAnimDuration;
136144
}
137145

146+
/**
147+
* Set start animation duration in ms
148+
*/
138149
public StripedProcessButton setStartAnimDuration(long startAnimDuration) {
139150
this.startAnimDuration = startAnimDuration;
140151
invalidate();
141152
return this;
142153
}
143154

155+
/**
156+
* Get current stop animation duration
157+
* @return stop duration in ms
158+
*/
144159
public long getStopAnimDuration() {
145160
return stopAnimDuration;
146161
}
147162

163+
/**
164+
* Set stop animation duration in ms
165+
*/
148166
public StripedProcessButton setStopAnimDuration(long stopAnimDuration) {
149167
this.stopAnimDuration = stopAnimDuration;
150168
invalidate();
151169
return this;
152170
}
153171

172+
/**
173+
* Get text when button has loading state
174+
* @return loading text
175+
*/
154176
public String getLoadingText() {
155177
return loadingText;
156178
}
157179

180+
/**
181+
* Set text when button has loading state
182+
* @param loadingText text when loading started
183+
*/
158184
public StripedProcessButton setLoadingText(String loadingText) {
159185
this.loadingText = loadingText;
160186
invalidate();
161187
return this;
162188
}
163189

190+
/**
191+
* Get button stripe animation state
192+
* @return true if button can be animated
193+
*/
164194
public boolean isButtonAnimation() {
165195
return buttonAnimation;
166196
}
167197

198+
/**
199+
* Set button stripe animation state
200+
* @param buttonAnimation if tru button can be animated
201+
*/
168202
public StripedProcessButton setButtonAnimation(boolean buttonAnimation) {
169203
this.buttonAnimation = buttonAnimation;
170204
invalidate();

0 commit comments

Comments
 (0)