@@ -7,13 +7,13 @@ import android.content.Intent
77import android.content.pm.PackageManager
88import android.os.*
99import android.os.Environment.MEDIA_MOUNTED
10- import android.support.v4 .app.ActivityCompat
11- import android.support.v4 .content.ContextCompat
12- import android.support.v4.util .ArrayMap
13- import android.support.v4 .widget.SwipeRefreshLayout
14- import android.support.v7 .app.AppCompatActivity
15- import android.support.v7 .widget.LinearLayoutManager
16- import android.support.v7 .widget.RecyclerView
10+ import androidx.core .app.ActivityCompat
11+ import androidx.core .content.ContextCompat
12+ import androidx.collection .ArrayMap
13+ import androidx.swiperefreshlayout .widget.SwipeRefreshLayout
14+ import androidx.appcompat .app.AppCompatActivity
15+ import androidx.recyclerview .widget.LinearLayoutManager
16+ import androidx.recyclerview .widget.RecyclerView
1717import android.view.LayoutInflater
1818import android.view.View
1919import android.view.animation.AnimationUtils
@@ -38,8 +38,8 @@ import java.util.concurrent.*
3838class FilePickerActivity : AppCompatActivity (), View.OnClickListener, RecyclerViewListener.OnItemClickListener{
3939
4040 private var rvList: RecyclerViewFilePicker ? = null
41- private var rvNav: RecyclerView ? = null
42- private var srl: SwipeRefreshLayout ? = null
41+ private var rvNav: androidx.recyclerview.widget. RecyclerView ? = null
42+ private var srl: androidx.swiperefreshlayout.widget. SwipeRefreshLayout ? = null
4343 private var tvToolbarTitle: TextView ? = null
4444 private var btnConfirm: Button ? = null
4545 private var btnSelectedAll: Button ? = null
@@ -250,7 +250,7 @@ class FilePickerActivity : AppCompatActivity(), View.OnClickListener, RecyclerVi
250250 } else {
251251 View .VISIBLE
252252 }
253- srl = findViewById<SwipeRefreshLayout >(R .id.swipe_refresh_layout)
253+ srl = findViewById< androidx.swiperefreshlayout.widget. SwipeRefreshLayout > (R .id.swipe_refresh_layout)
254254 srl?.apply {
255255 setOnRefreshListener {
256256 resetViewState()
@@ -277,9 +277,13 @@ class FilePickerActivity : AppCompatActivity(), View.OnClickListener, RecyclerVi
277277 )
278278 }
279279
280- rvNav = findViewById<RecyclerView >(R .id.rv_nav_file_picker).apply {
280+ rvNav = findViewById< androidx.recyclerview.widget. RecyclerView > (R .id.rv_nav_file_picker).apply {
281281 layoutManager =
282- LinearLayoutManager (this @FilePickerActivity, LinearLayoutManager .HORIZONTAL , false )
282+ androidx.recyclerview.widget.LinearLayoutManager (
283+ this @FilePickerActivity,
284+ androidx.recyclerview.widget.LinearLayoutManager .HORIZONTAL ,
285+ false
286+ )
283287 adapter = navAdapter
284288 }
285289 rvList = findViewById<RecyclerViewFilePicker >(R .id.rv_list_file_picker).apply {
@@ -338,18 +342,18 @@ class FilePickerActivity : AppCompatActivity(), View.OnClickListener, RecyclerVi
338342 /* *
339343 * 获取两个列表的监听器
340344 */
341- private fun getListener (recyclerView : RecyclerView ? ): RecyclerViewListener ? {
345+ private fun getListener (recyclerView : androidx.recyclerview.widget. RecyclerView ? ): RecyclerViewListener ? {
342346 if (recyclerView == null ) {
343347 return null
344348 }
345349 return RecyclerViewListener (recyclerView, this @FilePickerActivity)
346350 }
347351
348- private val currPosMap: ArrayMap <String , Int > by lazy {
349- ArrayMap (4 )
352+ private val currPosMap: androidx.collection. ArrayMap <String , Int > by lazy {
353+ androidx.collection. ArrayMap (4 )
350354 }
351- private val currOffsetMap: ArrayMap <String , Int > by lazy {
352- ArrayMap (4 )
355+ private val currOffsetMap: androidx.collection. ArrayMap <String , Int > by lazy {
356+ androidx.collection. ArrayMap (4 )
353357 }
354358
355359 /* *
@@ -358,7 +362,7 @@ class FilePickerActivity : AppCompatActivity(), View.OnClickListener, RecyclerVi
358362 private fun saveCurrPos (item : FileNavBeanImpl ? , position : Int ) {
359363 item?.run {
360364 currPosMap[filePath] = position
361- (rvList?.layoutManager as ? LinearLayoutManager )?.let {
365+ (rvList?.layoutManager as ? androidx.recyclerview.widget. LinearLayoutManager )?.let {
362366 currOffsetMap.put(filePath, it.findViewByPosition(position)?.top ? : 0 )
363367 }
364368 }
@@ -370,7 +374,7 @@ class FilePickerActivity : AppCompatActivity(), View.OnClickListener, RecyclerVi
370374 * 传递 item 点击事件给调用者
371375 */
372376 override fun onItemClick (
373- adapter : RecyclerView .Adapter <RecyclerView .ViewHolder >,
377+ adapter : androidx.recyclerview.widget. RecyclerView .Adapter <androidx.recyclerview.widget. RecyclerView .ViewHolder >,
374378 view : View ,
375379 position : Int
376380 ) {
@@ -421,7 +425,7 @@ class FilePickerActivity : AppCompatActivity(), View.OnClickListener, RecyclerVi
421425 * 子控件被点击
422426 */
423427 override fun onItemChildClick (
424- adapter : RecyclerView .Adapter <RecyclerView .ViewHolder >,
428+ adapter : androidx.recyclerview.widget. RecyclerView .Adapter <androidx.recyclerview.widget. RecyclerView .ViewHolder >,
425429 view : View ,
426430 position : Int
427431 ) {
@@ -467,7 +471,7 @@ class FilePickerActivity : AppCompatActivity(), View.OnClickListener, RecyclerVi
467471 * 条目被长按
468472 */
469473 override fun onItemLongClick (
470- adapter : RecyclerView .Adapter <RecyclerView .ViewHolder >,
474+ adapter : androidx.recyclerview.widget. RecyclerView .Adapter <androidx.recyclerview.widget. RecyclerView .ViewHolder >,
471475 view : View ,
472476 position : Int
473477 ) {
0 commit comments