refreshing the directories list view UI, remove dividers
This commit is contained in:
parent
fd52c7c225
commit
8dac3880d6
2 changed files with 25 additions and 17 deletions
|
@ -13,6 +13,7 @@ import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
|
import android.widget.RelativeLayout
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.appcompat.widget.SearchView
|
import androidx.appcompat.widget.SearchView
|
||||||
import androidx.core.view.MenuItemCompat
|
import androidx.core.view.MenuItemCompat
|
||||||
|
@ -605,6 +606,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
|
|
||||||
private fun setupGridLayoutManager() {
|
private fun setupGridLayoutManager() {
|
||||||
val layoutManager = directories_grid.layoutManager as MyGridLayoutManager
|
val layoutManager = directories_grid.layoutManager as MyGridLayoutManager
|
||||||
|
(directories_grid.layoutParams as RelativeLayout.LayoutParams).apply {
|
||||||
|
topMargin = 0
|
||||||
|
bottomMargin = 0
|
||||||
|
}
|
||||||
|
|
||||||
if (config.scrollHorizontally) {
|
if (config.scrollHorizontally) {
|
||||||
layoutManager.orientation = RecyclerView.HORIZONTAL
|
layoutManager.orientation = RecyclerView.HORIZONTAL
|
||||||
directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT)
|
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.spanCount = 1
|
||||||
layoutManager.orientation = RecyclerView.VERTICAL
|
layoutManager.orientation = RecyclerView.VERTICAL
|
||||||
directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
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
|
mZoomListener = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,12 @@
|
||||||
android:id="@+id/dir_holder"
|
android:id="@+id/dir_holder"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:paddingStart="@dimen/small_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:paddingTop="@dimen/small_margin">
|
android:paddingTop="@dimen/small_margin"
|
||||||
|
android:paddingBottom="@dimen/small_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.gallery.pro.views.MySquareImageView
|
<com.simplemobiletools.gallery.pro.views.MySquareImageView
|
||||||
android:id="@+id/dir_thumbnail"
|
android:id="@+id/dir_thumbnail"
|
||||||
|
@ -35,7 +37,8 @@
|
||||||
android:layout_height="@dimen/selection_check_size"
|
android:layout_height="@dimen/selection_check_size"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_margin="@dimen/small_margin"
|
android:layout_marginTop="@dimen/small_margin"
|
||||||
|
android:layout_marginEnd="@dimen/medium_margin"
|
||||||
android:background="@drawable/circle_background"
|
android:background="@drawable/circle_background"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
android:padding="@dimen/tiny_margin"
|
android:padding="@dimen/tiny_margin"
|
||||||
|
@ -49,8 +52,8 @@
|
||||||
android:layout_toEndOf="@+id/dir_thumbnail"
|
android:layout_toEndOf="@+id/dir_thumbnail"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingLeft="6dp"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:paddingRight="6dp"
|
android:paddingEnd="@dimen/medium_margin"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="@dimen/bigger_text_size"/>
|
android:textSize="@dimen/bigger_text_size"/>
|
||||||
|
|
||||||
|
@ -64,7 +67,8 @@
|
||||||
android:alpha="0.4"
|
android:alpha="0.4"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingStart="6dp"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
|
android:paddingEnd="@dimen/medium_margin"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="@dimen/smaller_text_size"/>
|
android:textSize="@dimen/smaller_text_size"/>
|
||||||
|
|
||||||
|
@ -84,7 +88,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginEnd="@dimen/small_margin"
|
android:layout_marginEnd="@dimen/medium_margin"
|
||||||
android:gravity="end"
|
android:gravity="end"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingBottom="@dimen/tiny_margin">
|
android:paddingBottom="@dimen/tiny_margin">
|
||||||
|
@ -106,15 +110,6 @@
|
||||||
android:paddingBottom="@dimen/small_margin"
|
android:paddingBottom="@dimen/small_margin"
|
||||||
android:src="@drawable/ic_pin"
|
android:src="@drawable/ic_pin"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/dir_list_divider"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_alignBottom="@+id/dir_thumbnail"
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:layout_toEndOf="@+id/dir_thumbnail"
|
|
||||||
android:background="@drawable/divider"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
Loading…
Reference in a new issue