mirror of
				https://github.com/SimpleMobileTools/Simple-Gallery.git
				synced 2025-06-05 21:59:19 +02:00 
			
		
		
		
	setup listLayoutManager too
This commit is contained in:
		| @@ -648,10 +648,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     private fun setupListLayoutManager() { |     private fun setupListLayoutManager() { | ||||||
|         /*val layoutManager = directories_grid.layoutManager as MyGridLayoutManager |         val layoutManager = directories_grid.layoutManager as MyGridLayoutManager | ||||||
|         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 = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) | ||||||
|  |  | ||||||
|         val smallMargin = resources.getDimension(R.dimen.small_margin).toInt() |         val smallMargin = resources.getDimension(R.dimen.small_margin).toInt() | ||||||
|         (directories_grid.layoutParams as RelativeLayout.LayoutParams).apply { |         (directories_grid.layoutParams as RelativeLayout.LayoutParams).apply { | ||||||
| @@ -659,7 +659,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { | |||||||
|             bottomMargin = smallMargin |             bottomMargin = smallMargin | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         mZoomListener = null*/ |         mZoomListener = null | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private fun measureRecyclerViewContent(directories: ArrayList<Directory>) { |     private fun measureRecyclerViewContent(directories: ArrayList<Directory>) { | ||||||
|   | |||||||
| @@ -690,6 +690,21 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     private fun setupListLayoutManager() { | ||||||
|  |         val layoutManager = media_grid.layoutManager as MyGridLayoutManager | ||||||
|  |         layoutManager.spanCount = 1 | ||||||
|  |         layoutManager.orientation = RecyclerView.VERTICAL | ||||||
|  |         media_refresh_layout.layoutParams = RelativeLayout.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 | ||||||
|  |     } | ||||||
|  |  | ||||||
|     private fun measureRecyclerViewContent(media: ArrayList<ThumbnailItem>) { |     private fun measureRecyclerViewContent(media: ArrayList<ThumbnailItem>) { | ||||||
|         media_grid.onGlobalLayout { |         media_grid.onGlobalLayout { | ||||||
|             if (config.scrollHorizontally) { |             if (config.scrollHorizontally) { | ||||||
| @@ -784,21 +799,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private fun setupListLayoutManager() { |  | ||||||
|         /*val layoutManager = media_grid.layoutManager as MyGridLayoutManager |  | ||||||
|         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*/ |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     private fun increaseColumnCount() { |     private fun increaseColumnCount() { | ||||||
|         config.mediaColumnCnt = ++(media_grid.layoutManager as MyGridLayoutManager).spanCount |         config.mediaColumnCnt = ++(media_grid.layoutManager as MyGridLayoutManager).spanCount | ||||||
|         columnCountChanged() |         columnCountChanged() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user