@@ -7,7 +7,6 @@ import android.os.Bundle
7
7
import android.os.Handler
8
8
import android.os.Looper
9
9
import android.util.Log
10
- import android.view.Gravity
11
10
import android.view.LayoutInflater
12
11
import android.view.View
13
12
import android.view.ViewGroup
@@ -25,7 +24,6 @@ import androidx.preference.PreferenceManager
25
24
import androidx.recyclerview.widget.LinearLayoutManager
26
25
import androidx.recyclerview.widget.RecyclerView
27
26
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener
28
- import androidx.transition.Slide
29
27
import com.bumptech.glide.Glide
30
28
import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader
31
29
import com.bumptech.glide.load.model.GlideUrl
@@ -312,30 +310,32 @@ class FilesFragment : Fragment() {
312
310
filesAdapter.selected.clear()
313
311
Log .i(" File[refreshLayout]" , " 3 - getFiles: ON REFRESH" )
314
312
getFiles(perPage, true )
315
- binding.refreshLayout.isRefreshing = false
316
- binding.refreshLayout.isEnabled = false
317
- Log .d(" File[refreshLayout]" , " DONE" )
318
- // Fade In
319
- binding.refreshBanner.post {
320
- binding.refreshBanner.translationY = - binding.refreshBanner.height.toFloat()
321
- binding.refreshBanner.visibility = View .VISIBLE
322
- binding.refreshBanner.animate()
323
- .alpha(1f )
324
- .translationY(0f )
325
- .setDuration(400 )
326
- .start()
313
+ _binding ?.let {
314
+ it.refreshLayout.isRefreshing = false
315
+ it.refreshLayout.isEnabled = false
316
+ Log .d(" File[refreshLayout]" , " DONE" )
317
+ // Fade In
318
+ it.refreshBanner.post {
319
+ it.refreshBanner.translationY = - it.refreshBanner.height.toFloat()
320
+ it.refreshBanner.visibility = View .VISIBLE
321
+ it.refreshBanner.animate()
322
+ .alpha(1f )
323
+ .translationY(0f )
324
+ .setDuration(400 )
325
+ .start()
326
+ }
327
+ Handler (Looper .getMainLooper()).postDelayed({
328
+ // Fade Out
329
+ it.refreshBanner.animate()
330
+ .alpha(0f )
331
+ .translationY(- it.refreshBanner.height.toFloat())
332
+ .setDuration(400 )
333
+ .withEndAction {
334
+ it.refreshBanner.visibility = View .GONE
335
+ }
336
+ .start()
337
+ }, 1600 )
327
338
}
328
- Handler (Looper .getMainLooper()).postDelayed({
329
- // Fade Out
330
- binding.refreshBanner.animate()
331
- .alpha(0f )
332
- .translationY(- binding.refreshBanner.height.toFloat())
333
- .setDuration(400 )
334
- .withEndAction {
335
- binding.refreshBanner.visibility = View .GONE
336
- }
337
- .start()
338
- }, 1600 )
339
339
}
340
340
}
341
341
})
0 commit comments