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 d38331114..ad9dce178 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 @@ -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 android.widget.Toast import androidx.appcompat.widget.SearchView import androidx.core.view.MenuItemCompat @@ -605,6 +606,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun setupGridLayoutManager() { val layoutManager = directories_grid.layoutManager as MyGridLayoutManager + (directories_grid.layoutParams as RelativeLayout.LayoutParams).apply { + topMargin = 0 + bottomMargin = 0 + } + if (config.scrollHorizontally) { layoutManager.orientation = RecyclerView.HORIZONTAL directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) @@ -670,6 +676,13 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { layoutManager.spanCount = 1 layoutManager.orientation = RecyclerView.VERTICAL directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) + + val smallMargin = resources.getDimension(R.dimen.small_margin).toInt() + (directories_grid.layoutParams as RelativeLayout.LayoutParams).apply { + topMargin = smallMargin + bottomMargin = smallMargin + } + mZoomListener = null } diff --git a/app/src/main/res/layout/directory_item_list.xml b/app/src/main/res/layout/directory_item_list.xml index 97937ee4e..20be472f9 100644 --- a/app/src/main/res/layout/directory_item_list.xml +++ b/app/src/main/res/layout/directory_item_list.xml @@ -4,10 +4,12 @@ android:id="@+id/dir_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"> @@ -64,7 +67,8 @@ android:alpha="0.4" android:ellipsize="end" android:maxLines="1" - android:paddingStart="6dp" + android:paddingStart="@dimen/medium_margin" + android:paddingEnd="@dimen/medium_margin" android:textColor="@android:color/white" android:textSize="@dimen/smaller_text_size"/> @@ -84,7 +88,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_alignParentBottom="true" - android:layout_marginEnd="@dimen/small_margin" + android:layout_marginEnd="@dimen/medium_margin" android:gravity="end" android:orientation="horizontal" android:paddingBottom="@dimen/tiny_margin"> @@ -106,15 +110,6 @@ android:paddingBottom="@dimen/small_margin" android:src="@drawable/ic_pin" android:visibility="gone"/> + - - -