diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index dc44ff967..6aa7d5fcd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -13,6 +13,7 @@ import android.view.Menu import android.view.MenuItem import android.view.ViewGroup import android.widget.FrameLayout +import android.widget.RelativeLayout import androidx.appcompat.widget.SearchView import androidx.core.view.MenuItemCompat import androidx.recyclerview.widget.GridLayoutManager @@ -680,6 +681,11 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun setupGridLayoutManager() { val layoutManager = media_grid.layoutManager as MyGridLayoutManager + (media_grid.layoutParams as RelativeLayout.LayoutParams).apply { + topMargin = 0 + bottomMargin = 0 + } + if (config.scrollHorizontally) { layoutManager.orientation = RecyclerView.HORIZONTAL media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) @@ -775,6 +781,13 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { layoutManager.spanCount = 1 layoutManager.orientation = RecyclerView.VERTICAL media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) + + val smallMargin = resources.getDimension(R.dimen.small_margin).toInt() + (media_grid.layoutParams as RelativeLayout.LayoutParams).apply { + topMargin = smallMargin + bottomMargin = smallMargin + } + mZoomListener = null } diff --git a/app/src/main/res/layout/photo_video_item_list.xml b/app/src/main/res/layout/photo_video_item_list.xml index d2e8e7def..bda74102d 100644 --- a/app/src/main/res/layout/photo_video_item_list.xml +++ b/app/src/main/res/layout/photo_video_item_list.xml @@ -5,10 +5,12 @@ android:id="@+id/media_item_holder" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="?attr/selectableItemBackground" android:clickable="true" android:focusable="true" - android:paddingStart="@dimen/small_margin" - android:paddingTop="@dimen/small_margin"> + android:paddingStart="@dimen/medium_margin" + android:paddingTop="@dimen/small_margin" + android:paddingBottom="@dimen/small_margin"> @@ -38,7 +41,7 @@ android:ellipsize="end" android:gravity="center_vertical" android:maxLines="3" - android:paddingStart="6dp" + android:paddingStart="@dimen/medium_margin" android:paddingEnd="@dimen/normal_margin" android:textColor="@android:color/white" android:textSize="@dimen/bigger_text_size" @@ -62,7 +65,7 @@ android:layout_alignParentEnd="true" android:layout_alignParentBottom="true" android:layout_marginEnd="@dimen/small_margin" - android:paddingBottom="6dp" + android:paddingBottom="@dimen/medium_margin" android:paddingEnd="@dimen/small_margin" android:fontFamily="sans-serif-medium" android:shadowColor="@color/default_background_color" @@ -77,7 +80,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" - android:layout_marginBottom="6dp" + android:layout_marginBottom="@dimen/medium_margin" android:layout_toStartOf="@+id/play_outline" android:paddingLeft="@dimen/small_margin" android:paddingRight="@dimen/small_margin" @@ -86,13 +89,4 @@ android:textSize="@dimen/normal_text_size" tools:text="00:05"/> - -