updating commons, lets just make it compilable for now

This commit is contained in:
tibbi 2021-11-29 19:17:48 +01:00
parent b778ff989b
commit 53eafb30c6
31 changed files with 259 additions and 343 deletions

View file

@ -78,7 +78,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:b205a97a9f'
implementation 'com.github.SimpleMobileTools:Simple-Commons:2394310c39'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22'

View file

@ -188,8 +188,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
val adjustedPrimaryColor = getAdjustedPrimaryColor()
if (mStoredAdjustedPrimaryColor != adjustedPrimaryColor) {
getRecyclerAdapter()?.updatePrimaryColor(config.primaryColor)
directories_vertical_fastscroller.updatePrimaryColor(adjustedPrimaryColor)
directories_horizontal_fastscroller.updatePrimaryColor(adjustedPrimaryColor)
}
val styleString = "${config.folderStyle}${config.showFolderMediaCount}${config.limitFolderTitle}"
@ -197,8 +195,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
setupAdapter(mDirs, forceRecreate = true)
}
directories_horizontal_fastscroller.updateBubbleColors()
directories_vertical_fastscroller.updateBubbleColors()
directories_fastscroller.updateColors(adjustedPrimaryColor)
directories_refresh_layout.isEnabled = config.enablePullToRefresh
directories_empty_placeholder.setTextColor(config.textColor)
@ -682,8 +679,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
columnCount * thumbnailWidth
}
directories_horizontal_fastscroller.setContentWidth(fullWidth)
directories_horizontal_fastscroller.setScrollToX(directories_grid.computeHorizontalScrollOffset())
/*directories_horizontal_fastscroller.setContentWidth(fullWidth)
directories_horizontal_fastscroller.setScrollToX(directories_grid.computeHorizontalScrollOffset())*/
}
private fun calculateContentHeight(directories: ArrayList<Directory>) {
@ -702,8 +699,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
rowCount * thumbnailHeight
}
directories_vertical_fastscroller.setContentHeight(fullHeight)
directories_vertical_fastscroller.setScrollToY(directories_grid.computeVerticalScrollOffset())
/*directories_vertical_fastscroller.setContentHeight(fullHeight)
directories_vertical_fastscroller.setScrollToY(directories_grid.computeVerticalScrollOffset())*/
}
private fun initZoomListener() {
@ -921,8 +918,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
checkPlaceholderVisibility(dirs)
val allowHorizontalScroll = config.scrollHorizontally && config.viewTypeFolders == VIEW_TYPE_GRID
directories_vertical_fastscroller.beVisibleIf(directories_grid.isVisible() && !allowHorizontalScroll)
directories_horizontal_fastscroller.beVisibleIf(directories_grid.isVisible() && allowHorizontalScroll)
/*directories_vertical_fastscroller.beVisibleIf(directories_grid.isVisible() && !allowHorizontalScroll)
directories_horizontal_fastscroller.beVisibleIf(directories_grid.isVisible() && allowHorizontalScroll)*/
setupAdapter(dirs.clone() as ArrayList<Directory>)
}
@ -931,13 +928,19 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
mLastMediaFetcher = MediaFetcher(applicationContext)
val getImagesOnly = mIsPickImageIntent || mIsGetImageContentIntent
val getVideosOnly = mIsPickVideoIntent || mIsGetVideoContentIntent
val favoritePaths = getFavoritePaths()
/*if (isRPlus()) {
mLastMediaFetcher!!.getAndroid11FolderMedia(getImagesOnly, getVideosOnly, favoritePaths)
return
}*/
val hiddenString = getString(R.string.hidden)
val albumCovers = config.parseAlbumCovers()
val includedFolders = config.includedFolders
val noMediaFolders = getNoMediaFoldersSync()
val tempFolderPath = config.tempFolderPath
val getProperFileSize = config.directorySorting and SORT_BY_SIZE != 0
val favoritePaths = getFavoritePaths()
val dirPathsToRemove = ArrayList<String>()
val lastModifieds = mLastMediaFetcher!!.getLastModifieds()
val dateTakens = mLastMediaFetcher!!.getDateTakens()
@ -998,6 +1001,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
createDirectoryFromMedia(directory.path, curMedia, albumCovers, hiddenString, includedFolders, getProperFileSize, noMediaFolders)
}
//mydebug("end ${System.currentTimeMillis() - time} ${directory.name}")
// we are looping through the already displayed folders looking for changes, do not do anything if nothing changed
if (directory.copy(subfoldersCount = 0, subfoldersMediaCount = 0) == newDir) {
continue
@ -1224,15 +1228,13 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
if (currAdapter == null || forceRecreate) {
initZoomListener()
val fastscroller = if (config.scrollHorizontally) directories_horizontal_fastscroller else directories_vertical_fastscroller
DirectoryAdapter(
this,
dirsToShow,
this,
directories_grid,
isPickIntent(intent) || isGetAnyContentIntent(intent),
directories_refresh_layout,
fastscroller
directories_refresh_layout
) {
val clickedDir = it as Directory
val path = clickedDir.path
@ -1278,7 +1280,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
private fun setupScrollDirection() {
val allowHorizontalScroll = config.scrollHorizontally && config.viewTypeFolders == VIEW_TYPE_GRID
directories_vertical_fastscroller.isHorizontal = false
/*directories_vertical_fastscroller.isHorizontal = false
directories_vertical_fastscroller.beGoneIf(allowHorizontalScroll)
directories_horizontal_fastscroller.isHorizontal = true
@ -1292,7 +1294,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) {
directories_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it))
}
}
}*/
}
private fun checkInvalidDirectories(dirs: ArrayList<Directory>) {

View file

@ -153,8 +153,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
val adjustedPrimaryColor = getAdjustedPrimaryColor()
if (mStoredAdjustedPrimaryColor != adjustedPrimaryColor) {
getMediaAdapter()?.updatePrimaryColor(config.primaryColor)
media_horizontal_fastscroller.updatePrimaryColor(adjustedPrimaryColor)
media_vertical_fastscroller.updatePrimaryColor(adjustedPrimaryColor)
}
if (mStoredThumbnailSpacing != config.thumbnailSpacing) {
@ -167,8 +165,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
setupAdapter()
}
media_horizontal_fastscroller.updateBubbleColors()
media_vertical_fastscroller.updateBubbleColors()
media_fastscroller.updateColors(adjustedPrimaryColor)
media_refresh_layout.isEnabled = config.enablePullToRefresh
media_empty_text_placeholder.setTextColor(config.textColor)
media_empty_text_placeholder_2.setTextColor(getAdjustedPrimaryColor())
@ -410,10 +407,9 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
val currAdapter = media_grid.adapter
if (currAdapter == null) {
initZoomListener()
val fastscroller = if (config.scrollHorizontally) media_horizontal_fastscroller else media_vertical_fastscroller
MediaAdapter(
this, mMedia.clone() as ArrayList<ThumbnailItem>, this, mIsGetImageIntent || mIsGetVideoIntent || mIsGetAnyIntent,
mAllowPickingMultiple, mPath, media_grid, fastscroller
mAllowPickingMultiple, mPath, media_grid
) {
if (it is Medium && !isFinishing) {
itemClicked(it.path)
@ -445,7 +441,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
private fun setupScrollDirection() {
val viewType = config.getFolderViewType(if (mShowAll) SHOW_ALL else mPath)
val allowHorizontalScroll = config.scrollHorizontally && viewType == VIEW_TYPE_GRID
media_vertical_fastscroller.isHorizontal = false
/*media_vertical_fastscroller.isHorizontal = false
media_vertical_fastscroller.beGoneIf(allowHorizontalScroll)
media_horizontal_fastscroller.isHorizontal = true
@ -460,7 +456,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) {
media_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting))
}
}
}*/
}
private fun getBubbleTextItem(index: Int, sorting: Int): String {
@ -734,8 +730,8 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
val thumbnailWidth = layoutManager.getChildAt(0)?.width ?: 0
val spacing = config.thumbnailSpacing
val fullWidth = ((media.size - 1) / layoutManager.spanCount + 1) * (thumbnailWidth + spacing) - spacing
media_horizontal_fastscroller.setContentWidth(fullWidth)
media_horizontal_fastscroller.setScrollToX(media_grid.computeHorizontalScrollOffset())
/*media_horizontal_fastscroller.setContentWidth(fullWidth)
media_horizontal_fastscroller.setScrollToX(media_grid.computeHorizontalScrollOffset())*/
}
private fun calculateContentHeight(media: ArrayList<ThumbnailItem>) {
@ -762,8 +758,8 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
val spacing = config.thumbnailSpacing
fullHeight += ((curSectionItems - 1) / layoutManager.spanCount + 1) * (thumbnailHeight + spacing) - spacing
media_vertical_fastscroller.setContentHeight(fullHeight)
media_vertical_fastscroller.setScrollToY(media_grid.computeVerticalScrollOffset())
/*media_vertical_fastscroller.setContentHeight(fullHeight)
media_vertical_fastscroller.setScrollToY(media_grid.computeVerticalScrollOffset())*/
}
private fun handleGridSpacing(media: ArrayList<ThumbnailItem> = mMedia) {
@ -932,8 +928,8 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
val viewType = config.getFolderViewType(if (mShowAll) SHOW_ALL else mPath)
val allowHorizontalScroll = config.scrollHorizontally && viewType == VIEW_TYPE_GRID
media_vertical_fastscroller.beVisibleIf(media_grid.isVisible() && !allowHorizontalScroll)
media_horizontal_fastscroller.beVisibleIf(media_grid.isVisible() && allowHorizontalScroll)
/*media_vertical_fastscroller.beVisibleIf(media_grid.isVisible() && !allowHorizontalScroll)
media_horizontal_fastscroller.beVisibleIf(media_grid.isVisible() && allowHorizontalScroll)*/
setupAdapter()
}

View file

@ -30,8 +30,6 @@ import kotlinx.android.synthetic.main.activity_media.*
import kotlinx.android.synthetic.main.activity_search.*
import kotlinx.android.synthetic.main.activity_search.media_empty_text_placeholder
import kotlinx.android.synthetic.main.activity_search.media_grid
import kotlinx.android.synthetic.main.activity_search.media_horizontal_fastscroller
import kotlinx.android.synthetic.main.activity_search.media_vertical_fastscroller
import java.io.File
class SearchActivity : SimpleActivity(), MediaOperationsListener {
@ -136,8 +134,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener {
private fun setupAdapter() {
val currAdapter = media_grid.adapter
if (currAdapter == null) {
val fastscroller = if (config.scrollHorizontally) media_horizontal_fastscroller else media_vertical_fastscroller
MediaAdapter(this, ArrayList(), this, false, false, "", media_grid, fastscroller) {
MediaAdapter(this, ArrayList(), this, false, false, "", media_grid) {
if (it is Medium) {
itemClicked(it.path)
}
@ -233,7 +230,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener {
private fun setupScrollDirection() {
val viewType = config.getFolderViewType(SHOW_ALL)
val allowHorizontalScroll = config.scrollHorizontally && viewType == VIEW_TYPE_GRID
media_vertical_fastscroller.isHorizontal = false
/*media_vertical_fastscroller.isHorizontal = false
media_vertical_fastscroller.beGoneIf(allowHorizontalScroll)
media_horizontal_fastscroller.isHorizontal = true
@ -248,7 +245,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener {
media_vertical_fastscroller.setViews(media_grid) {
media_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting))
}
}
}*/
}
private fun getBubbleTextItem(index: Int, sorting: Int): String {
@ -274,8 +271,8 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener {
val layoutManager = media_grid.layoutManager as MyGridLayoutManager
val thumbnailWidth = layoutManager.getChildAt(0)?.width ?: 0
val fullWidth = ((media.size - 1) / layoutManager.spanCount + 1) * thumbnailWidth
media_horizontal_fastscroller.setContentWidth(fullWidth)
media_horizontal_fastscroller.setScrollToX(media_grid.computeHorizontalScrollOffset())
/*media_horizontal_fastscroller.setContentWidth(fullWidth)
media_horizontal_fastscroller.setScrollToX(media_grid.computeHorizontalScrollOffset())*/
}
private fun calculateContentHeight(media: ArrayList<ThumbnailItem>) {
@ -301,8 +298,8 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener {
}
fullHeight += ((curSectionItems - 1) / layoutManager.spanCount + 1) * thumbnailHeight
media_vertical_fastscroller.setContentHeight(fullHeight)
media_vertical_fastscroller.setScrollToY(media_grid.computeVerticalScrollOffset())
/*media_vertical_fastscroller.setContentHeight(fullHeight)
media_vertical_fastscroller.setScrollToY(media_grid.computeVerticalScrollOffset())*/
}
private fun getAllMedia() {

View file

@ -895,10 +895,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
return
}
val favoriteIcon = if (medium.isFavorite) R.drawable.ic_star_on_vector else R.drawable.ic_star_off_vector
val favoriteIcon = if (medium.isFavorite) R.drawable.ic_star_vector else R.drawable.ic_star_outline_vector
bottom_favorite.setImageResource(favoriteIcon)
val hideIcon = if (medium.isHidden()) R.drawable.ic_unhide_vector else R.drawable.ic_hide
val hideIcon = if (medium.isHidden()) R.drawable.ic_unhide_vector else R.drawable.ic_hide_vector
bottom_toggle_file_visibility.setImageResource(hideIcon)
bottom_rotate.beVisibleIf(config.visibleBottomActions and BOTTOM_ACTION_ROTATE != 0 && getCurrentMedium()?.isImage() == true)
@ -929,7 +929,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
printHelper.orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
try {
val resolution = path.getImageResolution()
val resolution = path.getImageResolution(this)
if (resolution == null) {
toast(R.string.unknown_error_occurred)
return
@ -987,7 +987,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
@TargetApi(Build.VERSION_CODES.N)
private fun resizeImage() {
val oldPath = getCurrentPath()
val originalSize = oldPath.getImageResolution() ?: return
val originalSize = oldPath.getImageResolution(this) ?: return
ResizeWithPathDialog(this, originalSize, oldPath) { newSize, newPath ->
ensureBackgroundThread {
try {

View file

@ -26,7 +26,6 @@ import com.simplemobiletools.commons.interfaces.ItemMoveCallback
import com.simplemobiletools.commons.interfaces.ItemTouchHelperContract
import com.simplemobiletools.commons.interfaces.StartReorderDragListener
import com.simplemobiletools.commons.models.FileDirItem
import com.simplemobiletools.commons.views.FastScroller
import com.simplemobiletools.commons.views.MyRecyclerView
import com.simplemobiletools.gallery.pro.R
import com.simplemobiletools.gallery.pro.activities.MediaActivity
@ -56,9 +55,9 @@ import kotlin.collections.HashMap
class DirectoryAdapter(
activity: BaseSimpleActivity, var dirs: ArrayList<Directory>, val listener: DirectoryOperationsListener?, recyclerView: MyRecyclerView,
val isPickIntent: Boolean, val swipeRefreshLayout: SwipeRefreshLayout? = null, fastScroller: FastScroller? = null, itemClick: (Any) -> Unit
val isPickIntent: Boolean, val swipeRefreshLayout: SwipeRefreshLayout? = null, itemClick: (Any) -> Unit
) :
MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick), ItemTouchHelperContract {
MyRecyclerViewAdapter(activity, recyclerView, itemClick), ItemTouchHelperContract {
private val config = activity.config
private val isListViewType = config.viewTypeFolders == VIEW_TYPE_LIST
@ -616,9 +615,9 @@ class DirectoryAdapter(
val selectedDirs = getSelectedItems()
selectedDirs.forEach {
val path = it.path
if (activity.needsStupidWritePermissions(path) && config.treeUri.isEmpty()) {
/*if (activity.needsStupidWritePermissions(path) && config.treeUri.isEmpty()) {
SAFPath = path
}
}*/
}
activity.handleSAFDialog(SAFPath) {

View file

@ -12,8 +12,10 @@ import com.simplemobiletools.gallery.pro.extensions.config
import kotlinx.android.synthetic.main.item_manage_folder.view.*
import java.util.*
class ManageFoldersAdapter(activity: BaseSimpleActivity, var folders: ArrayList<String>, val isShowingExcludedFolders: Boolean, val listener: RefreshRecyclerViewListener?,
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
class ManageFoldersAdapter(
activity: BaseSimpleActivity, var folders: ArrayList<String>, val isShowingExcludedFolders: Boolean, val listener: RefreshRecyclerViewListener?,
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit
) : MyRecyclerViewAdapter(activity, recyclerView, itemClick) {
private val config = activity.config

View file

@ -14,8 +14,10 @@ import com.simplemobiletools.gallery.pro.extensions.removeNoMedia
import kotlinx.android.synthetic.main.item_manage_folder.view.*
import java.util.*
class ManageHiddenFoldersAdapter(activity: BaseSimpleActivity, var folders: ArrayList<String>, val listener: RefreshRecyclerViewListener?,
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
class ManageHiddenFoldersAdapter(
activity: BaseSimpleActivity, var folders: ArrayList<String>, val listener: RefreshRecyclerViewListener?,
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit
) : MyRecyclerViewAdapter(activity, recyclerView, itemClick) {
private val config = activity.config

View file

@ -20,7 +20,6 @@ import com.simplemobiletools.commons.dialogs.RenameItemDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.commons.models.FileDirItem
import com.simplemobiletools.commons.views.FastScroller
import com.simplemobiletools.commons.views.MyRecyclerView
import com.simplemobiletools.gallery.pro.R
import com.simplemobiletools.gallery.pro.activities.ViewPagerActivity
@ -42,9 +41,9 @@ import java.util.*
class MediaAdapter(
activity: BaseSimpleActivity, var media: ArrayList<ThumbnailItem>, val listener: MediaOperationsListener?, val isAGetIntent: Boolean,
val allowMultiplePicks: Boolean, val path: String, recyclerView: MyRecyclerView, fastScroller: FastScroller? = null, itemClick: (Any) -> Unit
val allowMultiplePicks: Boolean, val path: String, recyclerView: MyRecyclerView, itemClick: (Any) -> Unit
) :
MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick) {
MyRecyclerViewAdapter(activity, recyclerView, itemClick) {
private val INSTANT_LOAD_DURATION = 2000L
private val IMAGE_LOAD_DELAY = 100L

View file

@ -14,8 +14,10 @@ import com.simplemobiletools.gallery.pro.extensions.*
import com.simplemobiletools.gallery.pro.models.Directory
import kotlinx.android.synthetic.main.dialog_directory_picker.view.*
class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: String, showOtherFolderButton: Boolean, val showFavoritesBin: Boolean,
val callback: (path: String) -> Unit) {
class PickDirectoryDialog(
val activity: BaseSimpleActivity, val sourcePath: String, showOtherFolderButton: Boolean, val showFavoritesBin: Boolean,
val callback: (path: String) -> Unit
) {
private var dialog: AlertDialog
private var shownDirectories = ArrayList<Directory>()
private var allDirectories = ArrayList<Directory>()
@ -90,7 +92,8 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri
allDirectories = newDirs.clone() as ArrayList<Directory>
}
val distinctDirs = newDirs.filter { showFavoritesBin || (!it.isRecycleBin() && !it.areFavorites()) }.distinctBy { it.path.getDistinctPath() }.toMutableList() as ArrayList<Directory>
val distinctDirs = newDirs.filter { showFavoritesBin || (!it.isRecycleBin() && !it.areFavorites()) }.distinctBy { it.path.getDistinctPath() }
.toMutableList() as ArrayList<Directory>
val sortedDirs = activity.getSortedDirectories(distinctDirs)
val dirs = activity.getDirsToShow(sortedDirs, allDirectories, currentPathPrefix).clone() as ArrayList<Directory>
if (dirs.hashCode() == shownDirectories.hashCode()) {
@ -127,7 +130,7 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri
view.apply {
directories_grid.adapter = adapter
directories_vertical_fastscroller.isHorizontal = false
/*directories_vertical_fastscroller.isHorizontal = false
directories_vertical_fastscroller.beGoneIf(scrollHorizontally)
directories_horizontal_fastscroller.isHorizontal = true
@ -141,7 +144,7 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri
directories_vertical_fastscroller.setViews(directories_grid) {
directories_vertical_fastscroller.updateBubbleText(dirs[it].getBubbleText(sorting, activity, dateFormat, timeFormat))
}
}
}*/
}
}

View file

@ -3,8 +3,6 @@ package com.simplemobiletools.gallery.pro.dialogs
import androidx.appcompat.app.AlertDialog
import androidx.recyclerview.widget.RecyclerView
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.extensions.beGoneIf
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.getTimeFormat
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.helpers.VIEW_TYPE_GRID
@ -66,7 +64,7 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c
return
shownMedia = media
val adapter = MediaAdapter(activity, shownMedia.clone() as ArrayList<ThumbnailItem>, null, true, false, path, view.media_grid, null) {
val adapter = MediaAdapter(activity, shownMedia.clone() as ArrayList<ThumbnailItem>, null, true, false, path, view.media_grid) {
if (it is Medium) {
callback(it.path)
dialog.dismiss()
@ -80,7 +78,7 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c
view.apply {
media_grid.adapter = adapter
media_vertical_fastscroller.isHorizontal = false
/*media_vertical_fastscroller.isHorizontal = false
media_vertical_fastscroller.beGoneIf(scrollHorizontally)
media_horizontal_fastscroller.isHorizontal = true
@ -96,7 +94,7 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c
val medium = (media[it] as? Medium)
media_vertical_fastscroller.updateBubbleText(medium?.getBubbleText(sorting, activity, dateFormat, timeFormat) ?: "")
}
}
}*/
}
}
}

View file

@ -47,6 +47,13 @@
android:textSize="@dimen/bigger_text_size"
android:visibility="gone" />
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
android:id="@+id/directories_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/directories_switch_searching"
app:supportSwipeToRefresh="true">
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/directories_grid"
android:layout_width="match_parent"
@ -57,30 +64,6 @@
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager"
app:spanCount="@integer/directory_columns_vertical_scroll" />
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/directories_vertical_fastscroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_below="@+id/directories_switch_searching"
android:layout_alignParentEnd="true"
android:paddingStart="@dimen/normal_margin"
android:visibility="gone">
<include layout="@layout/fastscroller_handle_vertical" />
</com.simplemobiletools.commons.views.FastScroller>
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/directories_horizontal_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:paddingTop="@dimen/normal_margin"
android:visibility="gone">
<include layout="@layout/fastscroller_handle_horizontal" />
</com.simplemobiletools.commons.views.FastScroller>
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
</RelativeLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View file

@ -36,6 +36,12 @@
android:textSize="@dimen/bigger_text_size"
android:visibility="gone" />
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
android:id="@+id/media_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:supportSwipeToRefresh="true">
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/media_grid"
android:layout_width="match_parent"
@ -45,29 +51,6 @@
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager"
app:spanCount="@integer/media_columns_vertical_scroll" />
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/media_vertical_fastscroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:paddingStart="@dimen/normal_margin"
android:visibility="gone">
<include layout="@layout/fastscroller_handle_vertical" />
</com.simplemobiletools.commons.views.FastScroller>
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/media_horizontal_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:paddingTop="@dimen/normal_margin"
android:visibility="gone">
<include layout="@layout/fastscroller_handle_horizontal" />
</com.simplemobiletools.commons.views.FastScroller>
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
</RelativeLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View file

@ -19,6 +19,11 @@
android:textStyle="italic"
android:visibility="gone" />
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
android:id="@+id/media_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/media_grid"
android:layout_width="match_parent"
@ -27,28 +32,5 @@
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager"
app:spanCount="@integer/media_columns_vertical_scroll" />
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/media_vertical_fastscroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:paddingStart="@dimen/normal_margin"
android:visibility="gone">
<include layout="@layout/fastscroller_handle_vertical" />
</com.simplemobiletools.commons.views.FastScroller>
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/media_horizontal_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:paddingTop="@dimen/normal_margin"
android:visibility="gone">
<include layout="@layout/fastscroller_handle_horizontal" />
</com.simplemobiletools.commons.views.FastScroller>
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
</RelativeLayout>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/bottom_actions_wrapper"
android:layout_width="match_parent"
@ -16,7 +15,7 @@
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/toggle_favorite"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_star_off_vector"
android:src="@drawable/ic_star_outline_vector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/bottom_edit"
app:layout_constraintHorizontal_bias="0.5"
@ -91,7 +90,7 @@
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/properties"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_properties_vector"
android:src="@drawable/ic_info_vector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/bottom_change_orientation"
app:layout_constraintHorizontal_bias="0.5"
@ -151,7 +150,7 @@
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/toggle_file_visibility"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_hide"
android:src="@drawable/ic_hide_vector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/bottom_rename"
app:layout_constraintHorizontal_bias="0.5"
@ -166,7 +165,7 @@
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/rename"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_rename_new"
android:src="@drawable/ic_rename_vector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/bottom_set_as"
app:layout_constraintHorizontal_bias="0.5"
@ -196,7 +195,7 @@
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/copy"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_copy"
android:src="@drawable/ic_copy_vector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/bottom_move"
app:layout_constraintHorizontal_bias="0.5"

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/directories_holder"
android:layout_width="match_parent"
@ -12,6 +11,11 @@
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_margin">
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
android:id="@+id/directories_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/directories_grid"
android:layout_width="match_parent"
@ -20,28 +24,7 @@
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager"
app:spanCount="@integer/directory_columns_vertical_scroll" />
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/directories_vertical_fastscroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:paddingStart="@dimen/normal_margin">
<include layout="@layout/fastscroller_handle_vertical"/>
</com.simplemobiletools.commons.views.FastScroller>
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/directories_horizontal_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:paddingTop="@dimen/normal_margin">
<include layout="@layout/fastscroller_handle_horizontal"/>
</com.simplemobiletools.commons.views.FastScroller>
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
</RelativeLayout>
<com.simplemobiletools.commons.views.MyFloatingActionButton

View file

@ -1,11 +1,15 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/media_grid_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_margin">
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
android:id="@+id/directories_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/media_grid"
android:layout_width="match_parent"
@ -14,26 +18,5 @@
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager"
app:spanCount="@integer/media_columns_vertical_scroll" />
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/media_vertical_fastscroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:paddingStart="@dimen/normal_margin">
<include layout="@layout/fastscroller_handle_vertical"/>
</com.simplemobiletools.commons.views.FastScroller>
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/media_horizontal_fastscroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:paddingTop="@dimen/normal_margin">
<include layout="@layout/fastscroller_handle_horizontal"/>
</com.simplemobiletools.commons.views.FastScroller>
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
</RelativeLayout>

View file

@ -18,7 +18,7 @@
app:showAsAction="ifRoom" />
<item
android:id="@+id/cab_properties"
android:icon="@drawable/ic_info"
android:icon="@drawable/ic_info_vector"
android:title="@string/properties"
app:showAsAction="ifRoom" />
<item
@ -38,12 +38,12 @@
app:showAsAction="ifRoom" />
<item
android:id="@+id/cab_rename"
android:icon="@drawable/ic_rename_new"
android:icon="@drawable/ic_rename_vector"
android:title="@string/rename"
app:showAsAction="ifRoom" />
<item
android:id="@+id/cab_hide"
android:icon="@drawable/ic_hide"
android:icon="@drawable/ic_hide_vector"
android:title="@string/hide_folder"
app:showAsAction="ifRoom" />
<item

View file

@ -35,17 +35,17 @@
</item>
<item
android:id="@+id/cab_properties"
android:icon="@drawable/ic_info"
android:icon="@drawable/ic_info_vector"
android:title="@string/properties"
app:showAsAction="ifRoom" />
<item
android:id="@+id/cab_rename"
android:icon="@drawable/ic_rename_new"
android:icon="@drawable/ic_rename_vector"
android:title="@string/rename"
app:showAsAction="ifRoom" />
<item
android:id="@+id/cab_hide"
android:icon="@drawable/ic_hide"
android:icon="@drawable/ic_hide_vector"
android:title="@string/hide"
app:showAsAction="ifRoom" />
<item
@ -80,12 +80,12 @@
app:showAsAction="ifRoom" />
<item
android:id="@+id/cab_add_to_favorites"
android:icon="@drawable/ic_star_off_vector"
android:icon="@drawable/ic_star_outline_vector"
android:title="@string/add_to_favorites"
app:showAsAction="ifRoom" />
<item
android:id="@+id/cab_remove_from_favorites"
android:icon="@drawable/ic_star_on_vector"
android:icon="@drawable/ic_star_vector"
android:title="@string/remove_from_favorites"
app:showAsAction="ifRoom" />
<item

View file

@ -64,10 +64,12 @@
app:showAsAction="never" />
<item
android:id="@+id/settings"
android:icon="@drawable/ic_settings_cog_vector"
android:title="@string/settings"
app:showAsAction="never" />
app:showAsAction="ifRoom" />
<item
android:id="@+id/about"
android:icon="@drawable/ic_info_vector"
android:title="@string/about"
app:showAsAction="never" />
app:showAsAction="ifRoom" />
</menu>

View file

@ -85,10 +85,12 @@
app:showAsAction="never" />
<item
android:id="@+id/settings"
android:icon="@drawable/ic_settings_cog_vector"
android:title="@string/settings"
app:showAsAction="never" />
app:showAsAction="ifRoom" />
<item
android:id="@+id/about"
android:icon="@drawable/ic_info_vector"
android:title="@string/about"
app:showAsAction="never" />
app:showAsAction="ifRoom" />
</menu>

View file

@ -36,17 +36,17 @@
</item>
<item
android:id="@+id/menu_properties"
android:icon="@drawable/ic_info"
android:icon="@drawable/ic_info_vector"
android:title="@string/properties"
app:showAsAction="ifRoom" />
<item
android:id="@+id/menu_rename"
android:icon="@drawable/ic_rename_new"
android:icon="@drawable/ic_rename_vector"
android:title="@string/rename"
app:showAsAction="ifRoom" />
<item
android:id="@+id/menu_hide"
android:icon="@drawable/ic_hide"
android:icon="@drawable/ic_hide_vector"
android:title="@string/hide"
app:showAsAction="ifRoom" />
<item
@ -82,12 +82,12 @@
app:showAsAction="ifRoom" />
<item
android:id="@+id/menu_add_to_favorites"
android:icon="@drawable/ic_star_off_vector"
android:icon="@drawable/ic_star_outline_vector"
android:title="@string/add_to_favorites"
app:showAsAction="ifRoom" />
<item
android:id="@+id/menu_remove_from_favorites"
android:icon="@drawable/ic_star_on_vector"
android:icon="@drawable/ic_star_vector"
android:title="@string/remove_from_favorites"
app:showAsAction="ifRoom" />
<item
@ -130,6 +130,7 @@
app:showAsAction="ifRoom" />
<item
android:id="@+id/menu_settings"
android:icon="@drawable/ic_settings_cog_vector"
android:title="@string/settings"
app:showAsAction="never"/>
app:showAsAction="ifRoom" />
</menu>

View file

@ -8,7 +8,7 @@
app:showAsAction="ifRoom" />
<item
android:id="@+id/menu_properties"
android:icon="@drawable/ic_info"
android:icon="@drawable/ic_info_vector"
android:title="@string/properties"
app:showAsAction="ifRoom" />
<item