2626import android .Manifest ;
2727import android .animation .Animator ;
2828import android .animation .AnimatorListenerAdapter ;
29+ import android .animation .AnimatorSet ;
30+ import android .animation .ObjectAnimator ;
31+ import android .animation .PropertyValuesHolder ;
2932import android .animation .ValueAnimator ;
3033import android .annotation .SuppressLint ;
3134import android .app .Activity ;
3841import android .graphics .Bitmap ;
3942import android .graphics .Color ;
4043import android .graphics .Rect ;
44+ import android .graphics .RenderEffect ;
45+ import android .graphics .Shader ;
4146import android .graphics .drawable .ColorDrawable ;
4247import android .net .Uri ;
4348import android .os .Build ;
7176import com .aurelhubert .ahbottomnavigation .AHBottomNavigation ;
7277import com .aurelhubert .ahbottomnavigation .AHBottomNavigationItem ;
7378
79+ import com .google .android .material .animation .AnimatorSetCompat ;
7480import com .google .android .material .appbar .AppBarLayout ;
7581import com .google .android .material .bottomsheet .BottomSheetBehavior ;
7682
@@ -1213,7 +1219,7 @@ public void onChanged(List<AlbumModel> albumModels) {
12131219 mAlbumListIsShowing = true ;
12141220 int duration = animate ? 100 : 0 ;
12151221 FrameLayout albumPlaceHolderRoot = findViewById (R .id .fileBrowser_activity_main_albumPlaceHolderRoot );
1216-
1222+ albumPlaceHolderRoot . setAlpha ( 0 );
12171223 mAlbumPlaceHolder .post (() -> {
12181224 AppCompatTextView spnSelectAlbum = findViewById (R .id .fileBrowser_activity_main_spnSelectAlbum );
12191225 int [] location = new int [2 ];
@@ -1223,6 +1229,18 @@ public void onChanged(List<AlbumModel> albumModels) {
12231229 mAlbumPlaceHolder .setX (x );
12241230 mAlbumPlaceHolder .setY (y );
12251231 mAlbumPlaceHolder .animate ().setDuration (duration ).scaleY (1 ).scaleX (1 ).alpha (1 )
1232+ .setUpdateListener (new ValueAnimator .AnimatorUpdateListener () {
1233+ @ Override
1234+ public void onAnimationUpdate (@ NonNull ValueAnimator animation ) {
1235+ float alpha = 0 ;
1236+ if (mAlbumListIsShowing ){
1237+ alpha = animation .getAnimatedFraction ();
1238+ }else {
1239+ alpha = 1 - animation .getAnimatedFraction ();
1240+ }
1241+ albumPlaceHolderRoot .setAlpha (alpha );
1242+ }
1243+ })
12261244 .withStartAction (() -> {
12271245 mAlbumPlaceHolder .setAlpha (0 );
12281246 mAlbumPlaceHolder .setScaleY (0 );
@@ -1237,6 +1255,9 @@ public void onChanged(List<AlbumModel> albumModels) {
12371255 @ SuppressLint ("ClickableViewAccessibility" )
12381256 @ Override
12391257 public boolean onTouch (View v , MotionEvent event ) {
1258+ if (!mAlbumListIsShowing ){
1259+ return false ;
1260+ }
12401261 hideAlbumList (true );
12411262 return true ;
12421263 }
0 commit comments