diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 5dbeff81f..53af38f20 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -64,7 +64,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mIsThirdPartyIntent = mIsPickImageIntent || mIsPickVideoIntent || mIsGetImageContentIntent || mIsGetVideoContentIntent || mIsGetAnyContentIntent || mIsSetWallpaperIntent - directories_holder.setOnRefreshListener({ getDirectories() }) + directories_refresh_layout.setOnRefreshListener({ getDirectories() }) mDirs = ArrayList() mStoredAnimateGifs = config.animateGifs storeStoragePaths() @@ -107,7 +107,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { super.onPause() mCurrAsyncTask?.shouldStop = true storeDirectories() - directories_holder.isRefreshing = false + directories_refresh_layout.isRefreshing = false mIsGettingDirs = false mStoredAnimateGifs = config.animateGifs } @@ -152,7 +152,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { val token = object : TypeToken>() {}.type val dirs = Gson().fromJson>(config.directories, token) ?: ArrayList(1) if (dirs.size == 0) { - directories_holder.isRefreshing = true + directories_refresh_layout.isRefreshing = true } else { gotDirectories(dirs) } @@ -324,7 +324,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } fun gotDirectories(dirs: ArrayList) { - directories_holder.isRefreshing = false + directories_refresh_layout.isRefreshing = false mIsGettingDirs = false if (dirs.hashCode() == mDirs.hashCode()) @@ -347,6 +347,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } directories_grid.adapter = adapter + directories_fastscroller.setViews(directories_grid, directories_refresh_layout) } override fun refreshItems() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/FastScroller.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/FastScroller.kt index 0bc825499..6df099b1f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/FastScroller.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/FastScroller.kt @@ -54,7 +54,7 @@ class FastScroller : LinearLayout { } private fun updateHandlePosition() { - if (handle.isSelected) + if (handle.isSelected || recyclerView == null) return val verticalScrollOffset = recyclerView!!.computeVerticalScrollOffset() diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 35d03f92c..c19f7a444 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -2,16 +2,31 @@ + android:layout_height="wrap_content"> - + android:layout_height="wrap_content"> + + + + + diff --git a/app/src/main/res/layout/activity_media.xml b/app/src/main/res/layout/activity_media.xml index c5e3eb3b7..adb5c7f14 100644 --- a/app/src/main/res/layout/activity_media.xml +++ b/app/src/main/res/layout/activity_media.xml @@ -25,7 +25,8 @@ android:layout_height="match_parent" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" - android:paddingLeft="@dimen/normal_margin"/> + android:paddingLeft="@dimen/normal_margin" + android:paddingStart="@dimen/normal_margin"/> diff --git a/app/src/main/res/layout/fastscroller.xml b/app/src/main/res/layout/fastscroller.xml index 48c83bd80..b1481bb5a 100644 --- a/app/src/main/res/layout/fastscroller.xml +++ b/app/src/main/res/layout/fastscroller.xml @@ -8,6 +8,7 @@ android:id="@+id/fastscroller_handle" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:alpha="0" android:background="@drawable/fastscroller_handle"/>