add animations to listviews

This commit is contained in:
tibbi 2021-03-07 22:59:57 +01:00
parent fa41371209
commit 463c0ed719
4 changed files with 12 additions and 0 deletions

View file

@ -1206,6 +1206,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
runOnUiThread { runOnUiThread {
directories_grid.adapter = this directories_grid.adapter = this
setupScrollDirection() setupScrollDirection()
if (config.viewTypeFolders == VIEW_TYPE_LIST) {
directories_grid.scheduleLayoutAnimation()
}
} }
} }
measureRecyclerViewContent(dirsToShow) measureRecyclerViewContent(dirsToShow)

View file

@ -420,6 +420,12 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
setupZoomListener(mZoomListener) setupZoomListener(mZoomListener)
media_grid.adapter = this media_grid.adapter = this
} }
val viewType = config.getFolderViewType(if (mShowAll) SHOW_ALL else mPath)
if (viewType == VIEW_TYPE_LIST) {
media_grid.scheduleLayoutAnimation()
}
setupLayoutManager() setupLayoutManager()
handleGridSpacing() handleGridSpacing()
measureRecyclerViewContent(mMedia) measureRecyclerViewContent(mMedia)

View file

@ -52,6 +52,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@+id/directories_switch_searching" android:layout_below="@+id/directories_switch_searching"
android:layoutAnimation="@anim/layout_animation"
android:scrollbars="none" android:scrollbars="none"
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager" app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager"
app:spanCount="@integer/directory_columns_vertical_scroll" /> app:spanCount="@integer/directory_columns_vertical_scroll" />

View file

@ -40,6 +40,7 @@
android:id="@+id/media_grid" android:id="@+id/media_grid"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layoutAnimation="@anim/layout_animation"
android:scrollbars="none" android:scrollbars="none"
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager" app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager"
app:spanCount="@integer/media_columns_vertical_scroll" /> app:spanCount="@integer/media_columns_vertical_scroll" />