diff --git a/app/build.gradle b/app/build.gradle index 9a0f7e8b..27a04fd9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.0.3' + implementation 'com.simplemobiletools:commons:3.0.5' implementation files('../libs/RootTools.jar') diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/FavoritesActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/FavoritesActivity.kt index d99aba72..49cfe071 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/FavoritesActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/FavoritesActivity.kt @@ -24,9 +24,12 @@ class FavoritesActivity : SimpleActivity(), RefreshRecyclerViewListener { manage_favorites_placeholder.beVisibleIf(favorites.isEmpty()) manage_favorites_placeholder.setTextColor(config.textColor) - val adapter = ManageFavoritesAdapter(this, favorites, this, manage_favorites_list) {} - adapter.setupDragListener(true) - manage_favorites_list.adapter = adapter + ManageFavoritesAdapter(this, favorites, this, manage_favorites_list) { + + }.apply { + setupDragListener(true) + manage_favorites_list.adapter = this + } } override fun onCreateOptionsMenu(menu: Menu?): Boolean { diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt index 6afaf96d..ed590c20 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt @@ -87,8 +87,8 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList + setupView(itemView, fileDirItem) } bindViewHolder(holder, position, view) } diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ManageFavoritesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ManageFavoritesAdapter.kt index 277c62fe..4f62c0e9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ManageFavoritesAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ManageFavoritesAdapter.kt @@ -42,8 +42,8 @@ class ManageFavoritesAdapter(activity: BaseSimpleActivity, var favorites: ArrayL override fun onBindViewHolder(holder: ViewHolder, position: Int) { val favorite = favorites[position] - val view = holder.bindView(favorite) { - setupView(it, favorite) + val view = holder.bindView(favorite) { itemView, layoutPosition -> + setupView(itemView, favorite) } bindViewHolder(holder, position, view) } diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt index b9cb1180..657d53e5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt @@ -3,7 +3,6 @@ package com.simplemobiletools.filemanager.fragments import android.os.Bundle import android.os.Parcelable import android.support.v4.app.Fragment -import android.support.v7.widget.DividerItemDecoration import android.support.v7.widget.LinearLayoutManager import android.view.LayoutInflater import android.view.View @@ -134,16 +133,13 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum storedItems = items val currAdapter = items_list.adapter if (currAdapter == null) { - val adapter = ItemsAdapter(activity as SimpleActivity, storedItems, this@ItemsFragment, items_list, isPickMultipleIntent) { + ItemsAdapter(activity as SimpleActivity, storedItems, this@ItemsFragment, items_list, isPickMultipleIntent) { itemClicked(it as FileDirItem) + }.apply { + setupDragListener(true) + addVerticalDividers(true) + items_list.adapter = this } - adapter.setupDragListener(true) - - DividerItemDecoration(context, DividerItemDecoration.VERTICAL).apply { - setDrawable(context.resources.getDrawable(com.simplemobiletools.commons.R.drawable.divider)) - items_list.addItemDecoration(this) - } - items_list.adapter = adapter items_fastscroller.setViews(items_list, items_swipe_refresh) } else { (currAdapter as ItemsAdapter).updateItems(storedItems) diff --git a/app/src/main/res/layout/items_fragment.xml b/app/src/main/res/layout/items_fragment.xml index bb76f8ef..318b64c5 100644 --- a/app/src/main/res/layout/items_fragment.xml +++ b/app/src/main/res/layout/items_fragment.xml @@ -28,7 +28,6 @@ android:layout_height="wrap_content" android:layout_below="@+id/breadcrumbs" android:clipToPadding="false" - android:paddingLeft="@dimen/activity_margin" android:scrollbars="none" app:layoutManager="android.support.v7.widget.LinearLayoutManager"/>