diff --git a/app/build.gradle b/app/build.gradle index 137421da5..248b861e1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -77,7 +77,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.31.18' + implementation 'com.simplemobiletools:commons:5.31.19' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index d15485d13..42ef17836 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -660,22 +660,16 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun calculateContentWidth(directories: ArrayList) { val layoutManager = directories_grid.layoutManager as MyGridLayoutManager - val thumbnailWidth = (layoutManager.getChildAt(0)?.width ?: 0) + resources.getDimension(R.dimen.medium_margin).toInt() * 2 - val columnCount = (directories.size - 1) / layoutManager.spanCount + 1 - val fullWidth = columnCount * thumbnailWidth + val thumbnailWidth = layoutManager.getChildAt(0)?.width ?: 0 + val fullWidth = ((directories.size - 1) / layoutManager.spanCount + 1) * thumbnailWidth directories_horizontal_fastscroller.setContentWidth(fullWidth) directories_horizontal_fastscroller.setScrollToX(directories_grid.computeHorizontalScrollOffset()) } private fun calculateContentHeight(directories: ArrayList) { val layoutManager = directories_grid.layoutManager as MyGridLayoutManager - var thumbnailHeight = (layoutManager.getChildAt(0)?.height ?: 0) - if (config.viewTypeFolders == VIEW_TYPE_GRID) { - thumbnailHeight += resources.getDimension(R.dimen.medium_margin).toInt() * 2 - } - - val rowCount = (directories.size - 1) / layoutManager.spanCount + 1 - val fullHeight = rowCount * thumbnailHeight + val thumbnailHeight = layoutManager.getChildAt(0)?.height ?: 0 + val fullHeight = ((directories.size - 1) / layoutManager.spanCount + 1) * thumbnailHeight directories_vertical_fastscroller.setContentHeight(fullHeight) directories_vertical_fastscroller.setScrollToY(directories_grid.computeVerticalScrollOffset()) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt index 5fadd61c9..c85b0927c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt @@ -9,7 +9,6 @@ import android.graphics.drawable.Icon import android.view.Menu import android.view.View import android.view.ViewGroup -import android.widget.RelativeLayout import com.bumptech.glide.Glide import com.google.gson.Gson import com.simplemobiletools.commons.activities.BaseSimpleActivity @@ -662,6 +661,9 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList 1) "${directory.name} (${directory.subfoldersCount})" else directory.name + dir_path?.text = "${directory.path.substringBeforeLast("/")}/" + photo_cnt.text = directory.subfoldersMediaCount.toString() val thumbnailType = when { directory.tmb.isVideoFast() -> TYPE_VIDEOS directory.tmb.isGif() -> TYPE_GIFS @@ -675,18 +677,13 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList 1) { - "${directory.name} [${directory.subfoldersCount}]" - } else { - directory.name - } - } else { - dir_name.text = if (groupDirectSubfolders && directory.subfoldersCount > 1) { - "${directory.name} [${directory.subfoldersCount}]" - } else if (showMediaCount) { - "${directory.name} (${directory.subfoldersMediaCount})" - } else { - directory.name - } } } } diff --git a/app/src/main/res/layout/directory_item_grid.xml b/app/src/main/res/layout/directory_item_grid.xml index 7c1c998b2..d2a2c5d2e 100644 --- a/app/src/main/res/layout/directory_item_grid.xml +++ b/app/src/main/res/layout/directory_item_grid.xml @@ -3,10 +3,9 @@ android:id="@+id/dir_holder" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_margin="@dimen/medium_margin" android:clickable="true" android:focusable="true" - android:paddingTop="@dimen/medium_margin"> + android:padding="1px"> - + + + android:gravity="bottom" + android:orientation="vertical" + android:paddingLeft="@dimen/medium_margin" + android:paddingTop="@dimen/small_margin" + android:paddingRight="@dimen/medium_margin" + android:paddingBottom="@dimen/small_margin"> + + + + + + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index ff78d6597..78b30b24b 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -23,6 +23,4 @@ 110dp 40dp 30dp - 4dp - 10dp