File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
app/src/main/java/com/wang/avi/sample
library/src/main/java/com/wang/avi Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,12 @@ It's very simple use just like .
58
58
``` java
59
59
void startAnim(){
60
60
avi. show();
61
+ // or avi.smoothToShow();
61
62
}
62
63
63
64
void stopAnim(){
64
65
avi. hide();
66
+ // or avi.smoothToHide();
65
67
}
66
68
67
69
```
Original file line number Diff line number Diff line change @@ -27,9 +27,11 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
27
27
28
28
public void hideClick (View view ) {
29
29
avi .hide ();
30
+ // or avi.smoothToHide();
30
31
}
31
32
32
33
public void showClick (View view ) {
33
34
avi .show ();
35
+ // or avi.smoothToShow();
34
36
}
35
37
}
Original file line number Diff line number Diff line change 13
13
import android .util .AttributeSet ;
14
14
import android .util .Log ;
15
15
import android .view .View ;
16
+ import android .view .animation .AnimationUtils ;
16
17
17
18
public class AVLoadingIndicatorView extends View {
18
19
@@ -159,6 +160,16 @@ public void setIndicator(String indicatorName){
159
160
}
160
161
}
161
162
163
+ public void smoothToShow (){
164
+ startAnimation (AnimationUtils .loadAnimation (getContext (),android .R .anim .fade_in ));
165
+ setVisibility (VISIBLE );
166
+ }
167
+
168
+ public void smoothToHide (){
169
+ startAnimation (AnimationUtils .loadAnimation (getContext (),android .R .anim .fade_out ));
170
+ setVisibility (GONE );
171
+ }
172
+
162
173
public void hide () {
163
174
mDismissed = true ;
164
175
removeCallbacks (mDelayedShow );
You can’t perform that action at this time.
0 commit comments