Skip to content

Commit 19d9f20

Browse files
committed
update commons to 5.0.16
1 parent 2cceb6b commit 19d9f20

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ android {
4242
}
4343

4444
dependencies {
45-
implementation 'com.simplemobiletools:commons:5.0.2'
45+
implementation 'com.simplemobiletools:commons:5.0.16'
4646

4747
implementation files('../libs/RootTools.jar')
4848
}

app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList<FileD
9999

100100
override fun getIsItemSelectable(position: Int) = true
101101

102-
override fun getItemSelectionKey(position: Int) = fileDirItems[position].path
102+
override fun getItemSelectionKey(position: Int) = fileDirItems.getOrNull(position)?.path
103103

104104
override fun getItemKeyPosition(key: String) = fileDirItems.indexOfFirst { it.path == key }
105105

@@ -108,7 +108,7 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList<FileD
108108
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
109109
val fileDirItem = fileDirItems[position]
110110
holder.bindView(fileDirItem, true, true) { itemView, layoutPosition ->
111-
setupView(itemView, fileDirItem, isKeySelected(fileDirItem.path))
111+
setupView(itemView, fileDirItem)
112112
}
113113
bindViewHolder(holder)
114114
}
@@ -149,7 +149,7 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList<FileD
149149
}
150150

151151
private fun displayRenameDialog() {
152-
val oldPath = getSelectedFileDirItems()[0].path
152+
val oldPath = getFirstSelectedItemPath()
153153
RenameItemDialog(activity, oldPath) {
154154
activity.config.moveFavorite(oldPath, it)
155155
activity.runOnUiThread {
@@ -544,7 +544,8 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList<FileD
544544
}
545545
}
546546

547-
private fun setupView(view: View, fileDirItem: FileDirItem, isSelected: Boolean) {
547+
private fun setupView(view: View, fileDirItem: FileDirItem) {
548+
val isSelected = isKeySelected(fileDirItem.path)
548549
view.apply {
549550
item_frame.isSelected = isSelected
550551
val fileName = fileDirItem.name

app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ManageFavoritesAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ManageFavoritesAdapter(activity: BaseSimpleActivity, var favorites: ArrayL
3333

3434
override fun getIsItemSelectable(position: Int) = true
3535

36-
override fun getItemSelectionKey(position: Int) = favorites[position]
36+
override fun getItemSelectionKey(position: Int) = favorites.getOrNull(position)
3737

3838
override fun getItemKeyPosition(key: String) = favorites.indexOfFirst { it == key }
3939

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ buildscript {
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:3.2.0'
12+
classpath 'com.android.tools.build:gradle:3.2.1'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414

1515
// NOTE: Do not place your application dependencies here; they belong

0 commit comments

Comments
 (0)