diff --git a/README.md b/README.md index fc8c67db5..15274b177 100644 --- a/README.md +++ b/README.md @@ -104,8 +104,8 @@ https://www.reddit.com/r/SimpleMobileTools Don't forget that if you uninstall any paid app within 2 hours, you will automatically be refunded. If you want a refund anytime later, just contact us at hello@simplemobiletools.com and you will get it. That makes it easy to try it out :) -Get it on Google Play -Get it on F-Droid +Get it on Google Play +Get it on F-Droid
App image diff --git a/app/build.gradle b/app/build.gradle index ec5cc10bb..0a7c3db83 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -78,11 +78,11 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:b205a97a9f' + implementation 'com.github.SimpleMobileTools:Simple-Commons:a7344ae945' 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' - implementation 'androidx.constraintlayout:constraintlayout:2.1.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.2' implementation 'com.google.android.exoplayer:exoplayer-core:2.9.6' implementation 'com.google.vr:sdk-panowidget:1.180.0' implementation 'com.google.vr:sdk-videowidget:1.180.0' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index e2cc713c1..19f89a985 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -14,7 +14,6 @@ import android.provider.MediaStore.Video import android.view.Menu import android.view.MenuItem import android.view.ViewGroup -import android.widget.FrameLayout import android.widget.RelativeLayout import android.widget.Toast import androidx.appcompat.widget.SearchView @@ -188,8 +187,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,9 +194,12 @@ 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 + getRecyclerAdapter()?.apply { + dateFormat = config.dateFormat + timeFormat = getTimeFormat() + } directories_empty_placeholder.setTextColor(config.textColor) directories_empty_placeholder_2.setTextColor(adjustedPrimaryColor) @@ -494,6 +494,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { gotDirectories(getCurrentlyDisplayedDirs()) } } + + getRecyclerAdapter()?.directorySorting = config.directorySorting } } @@ -625,21 +627,18 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } else { setupListLayoutManager() } + + (directories_refresh_layout.layoutParams as RelativeLayout.LayoutParams).addRule(RelativeLayout.BELOW, R.id.directories_switch_searching) } private fun setupGridLayoutManager() { val layoutManager = directories_grid.layoutManager as MyGridLayoutManager - (directories_grid.layoutParams as RelativeLayout.LayoutParams).apply { - topMargin = 0 - bottomMargin = 0 - } - if (config.scrollHorizontally) { layoutManager.orientation = RecyclerView.HORIZONTAL - directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) + directories_refresh_layout.layoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) } else { 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) } layoutManager.spanCount = config.dirColumnCnt @@ -649,63 +648,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val layoutManager = directories_grid.layoutManager as MyGridLayoutManager layoutManager.spanCount = 1 layoutManager.orientation = RecyclerView.VERTICAL - 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 - } - + directories_refresh_layout.layoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) mZoomListener = null } - private fun measureRecyclerViewContent(directories: ArrayList) { - directories_grid.onGlobalLayout { - if (config.scrollHorizontally) { - calculateContentWidth(directories) - } else { - calculateContentHeight(directories) - } - } - } - - private fun calculateContentWidth(directories: ArrayList) { - val layoutManager = directories_grid.layoutManager as MyGridLayoutManager - - val fullWidth = if (config.folderStyle == FOLDER_STYLE_SQUARE) { - val thumbnailWidth = layoutManager.getChildAt(0)?.width ?: 0 - ((directories.size - 1) / layoutManager.spanCount + 1) * thumbnailWidth - } else { - val thumbnailWidth = (layoutManager.getChildAt(0)?.width ?: 0) + resources.getDimension(R.dimen.medium_margin).toInt() * 2 - val columnCount = (directories.size - 1) / layoutManager.spanCount + 1 - columnCount * thumbnailWidth - } - - directories_horizontal_fastscroller.setContentWidth(fullWidth) - directories_horizontal_fastscroller.setScrollToX(directories_grid.computeHorizontalScrollOffset()) - } - - private fun calculateContentHeight(directories: ArrayList) { - val layoutManager = directories_grid.layoutManager as MyGridLayoutManager - - val fullHeight = if (config.folderStyle == FOLDER_STYLE_SQUARE) { - val thumbnailHeight = layoutManager.getChildAt(0)?.height ?: 0 - ((directories.size - 1) / layoutManager.spanCount + 1) * thumbnailHeight - } else { - var thumbnailHeight = (layoutManager.getChildAt(0)?.height ?: 0) - if (config.viewTypeFolders == VIEW_TYPE_GRID) { - thumbnailHeight += resources.getDimension(R.dimen.medium_margin).toInt() * 2 - } - - val rowCount = (directories.size - 1) / layoutManager.spanCount + 1 - rowCount * thumbnailHeight - } - - directories_vertical_fastscroller.setContentHeight(fullHeight) - directories_vertical_fastscroller.setScrollToY(directories_grid.computeVerticalScrollOffset()) - } - private fun initZoomListener() { if (config.viewTypeFolders == VIEW_TYPE_GRID) { val layoutManager = directories_grid.layoutManager as MyGridLayoutManager @@ -766,7 +712,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { invalidateOptionsMenu() getRecyclerAdapter()?.apply { notifyItemRangeChanged(0, dirs.size) - measureRecyclerViewContent(dirs) } } @@ -919,10 +864,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { runOnUiThread { 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) setupAdapter(dirs.clone() as ArrayList) } @@ -931,13 +872,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() val lastModifieds = mLastMediaFetcher!!.getLastModifieds() val dateTakens = mLastMediaFetcher!!.getDateTakens() @@ -1105,7 +1052,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { runOnUiThread { directories_empty_placeholder.beGone() directories_empty_placeholder_2.beGone() - directories_grid.beVisible() + directories_fastscroller.beVisible() } } @@ -1213,7 +1160,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } directories_empty_placeholder_2.underlineText() - directories_grid.beVisibleIf(directories_empty_placeholder.isGone()) + directories_fastscroller.beVisibleIf(directories_empty_placeholder.isGone()) } private fun setupAdapter(dirs: ArrayList, textToSearch: String = "", forceRecreate: Boolean = false) { @@ -1224,15 +1171,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 @@ -1251,12 +1196,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { directories_grid.adapter = this setupScrollDirection() - if (config.viewTypeFolders == VIEW_TYPE_LIST) { + if (config.viewTypeFolders == VIEW_TYPE_LIST && areSystemAnimationsEnabled) { directories_grid.scheduleLayoutAnimation() } } } - measureRecyclerViewContent(dirsToShow) } else { runOnUiThread { if (textToSearch.isNotEmpty()) { @@ -1266,7 +1210,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { checkPlaceholderVisibility(dirsToShow) (directories_grid.adapter as? DirectoryAdapter)?.updateDirs(dirsToShow) - measureRecyclerViewContent(dirsToShow) } } @@ -1277,22 +1220,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } private fun setupScrollDirection() { - val allowHorizontalScroll = config.scrollHorizontally && config.viewTypeFolders == VIEW_TYPE_GRID - directories_vertical_fastscroller.isHorizontal = false - directories_vertical_fastscroller.beGoneIf(allowHorizontalScroll) - - directories_horizontal_fastscroller.isHorizontal = true - directories_horizontal_fastscroller.beVisibleIf(allowHorizontalScroll) - - if (allowHorizontalScroll) { - directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout) { - directories_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it)) - } - } else { - directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) { - directories_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it)) - } - } + val scrollHorizontally = config.scrollHorizontally && config.viewTypeFolders == VIEW_TYPE_GRID + directories_fastscroller.setScrollVertically(!scrollHorizontally) } private fun checkInvalidDirectories(dirs: ArrayList) { @@ -1344,10 +1273,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun getCurrentlyDisplayedDirs() = getRecyclerAdapter()?.dirs ?: ArrayList() - private fun getBubbleTextItem(index: Int) = - getRecyclerAdapter()?.dirs?.getOrNull(index)?.getBubbleText(config.directorySorting, this, mDateFormat, mTimeFormat) - ?: "" - private fun setupLatestMediaId() { ensureBackgroundThread { if (hasPermission(PERMISSION_READ_STORAGE)) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index 665e1f94f..6b8150a60 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -12,7 +12,6 @@ import android.os.Handler import android.view.Menu import android.view.MenuItem import android.view.ViewGroup -import android.widget.FrameLayout import android.widget.RelativeLayout import androidx.appcompat.widget.SearchView import androidx.core.view.MenuItemCompat @@ -61,8 +60,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private var mLoadedInitialPhotos = false private var mIsSearchOpen = false private var mLastSearchedText = "" - private var mDateFormat = "" - private var mTimeFormat = "" private var mLatestMediaId = 0L private var mLatestMediaDateId = 0L private var mLastMediaHandler = Handler() @@ -125,9 +122,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { override fun onResume() { super.onResume() - mDateFormat = config.dateFormat - mTimeFormat = getTimeFormat() - if (mStoredAnimateGifs != config.animateGifs) { getMediaAdapter()?.updateAnimateGifs(config.animateGifs) } @@ -153,8 +147,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,9 +159,13 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { setupAdapter() } - media_horizontal_fastscroller.updateBubbleColors() - media_vertical_fastscroller.updateBubbleColors() + media_fastscroller.updateColors(adjustedPrimaryColor) media_refresh_layout.isEnabled = config.enablePullToRefresh + getMediaAdapter()?.apply { + dateFormat = config.dateFormat + timeFormat = getTimeFormat() + } + media_empty_text_placeholder.setTextColor(config.textColor) media_empty_text_placeholder_2.setTextColor(getAdjustedPrimaryColor()) @@ -368,13 +364,14 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (grouped.isEmpty()) { media_empty_text_placeholder.text = getString(R.string.no_items_found) media_empty_text_placeholder.beVisible() + media_fastscroller.beGone() } else { media_empty_text_placeholder.beGone() + media_fastscroller.beVisible() } handleGridSpacing(grouped) getMediaAdapter()?.updateMedia(grouped) - measureRecyclerViewContent(grouped) } } catch (ignored: Exception) { } @@ -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, this, mIsGetImageIntent || mIsGetVideoIntent || mIsGetAnyIntent, - mAllowPickingMultiple, mPath, media_grid, fastscroller + mAllowPickingMultiple, mPath, media_grid ) { if (it is Medium && !isFinishing) { itemClicked(it.path) @@ -424,17 +420,15 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { } val viewType = config.getFolderViewType(if (mShowAll) SHOW_ALL else mPath) - if (viewType == VIEW_TYPE_LIST) { + if (viewType == VIEW_TYPE_LIST && areSystemAnimationsEnabled) { media_grid.scheduleLayoutAnimation() } setupLayoutManager() handleGridSpacing() - measureRecyclerViewContent(mMedia) } else if (mLastSearchedText.isEmpty()) { (currAdapter as MediaAdapter).updateMedia(mMedia) handleGridSpacing() - measureRecyclerViewContent(mMedia) } else { searchQueryChanged(mLastSearchedText) } @@ -444,32 +438,8 @@ 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.beGoneIf(allowHorizontalScroll) - - media_horizontal_fastscroller.isHorizontal = true - media_horizontal_fastscroller.beVisibleIf(allowHorizontalScroll) - - val sorting = config.getFolderSorting(if (mShowAll) SHOW_ALL else mPath) - if (allowHorizontalScroll) { - media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout) { - media_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting)) - } - } else { - media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) { - media_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting)) - } - } - } - - private fun getBubbleTextItem(index: Int, sorting: Int): String { - var realIndex = index - val mediaAdapter = getMediaAdapter() - if (mediaAdapter?.isASectionTitle(index) == true) { - realIndex++ - } - return mediaAdapter?.getItemBubbleText(realIndex, sorting, mDateFormat, mTimeFormat) ?: "" + val scrollHorizontally = config.scrollHorizontally && viewType == VIEW_TYPE_GRID + media_fastscroller.setScrollVertically(!scrollHorizontally) } private fun checkLastMediaChanged() { @@ -693,17 +663,12 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun setupGridLayoutManager() { val layoutManager = media_grid.layoutManager as MyGridLayoutManager - (media_grid.layoutParams as RelativeLayout.LayoutParams).apply { - topMargin = 0 - bottomMargin = 0 - } - if (config.scrollHorizontally) { layoutManager.orientation = RecyclerView.HORIZONTAL - media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) + media_refresh_layout.layoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) } else { layoutManager.orientation = RecyclerView.VERTICAL - media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) + media_refresh_layout.layoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) } layoutManager.spanCount = config.mediaColumnCnt @@ -719,51 +684,12 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { } } - private fun measureRecyclerViewContent(media: ArrayList) { - media_grid.onGlobalLayout { - if (config.scrollHorizontally) { - calculateContentWidth(media) - } else { - calculateContentHeight(media) - } - } - } - - private fun calculateContentWidth(media: ArrayList) { + private fun setupListLayoutManager() { val layoutManager = media_grid.layoutManager as MyGridLayoutManager - 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()) - } - - private fun calculateContentHeight(media: ArrayList) { - val layoutManager = media_grid.layoutManager as MyGridLayoutManager - val pathToCheck = if (mPath.isEmpty()) SHOW_ALL else mPath - val hasSections = config.getFolderGrouping(pathToCheck) and GROUP_BY_NONE == 0 && !config.scrollHorizontally - val sectionTitleHeight = if (hasSections) layoutManager.getChildAt(0)?.height ?: 0 else 0 - val thumbnailHeight = if (hasSections) layoutManager.getChildAt(1)?.height ?: 0 else layoutManager.getChildAt(0)?.height ?: 0 - - var fullHeight = 0 - var curSectionItems = 0 - media.forEach { - if (it is ThumbnailSection) { - fullHeight += sectionTitleHeight - if (curSectionItems != 0) { - val rows = ((curSectionItems - 1) / layoutManager.spanCount + 1) - fullHeight += rows * thumbnailHeight - } - curSectionItems = 0 - } else { - curSectionItems++ - } - } - - 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()) + layoutManager.spanCount = 1 + layoutManager.orientation = RecyclerView.VERTICAL + media_refresh_layout.layoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) + mZoomListener = null } private fun handleGridSpacing(media: ArrayList = mMedia) { @@ -813,21 +739,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() { config.mediaColumnCnt = ++(media_grid.layoutManager as MyGridLayoutManager).spanCount columnCountChanged() @@ -843,7 +754,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { invalidateOptionsMenu() getMediaAdapter()?.apply { notifyItemRangeChanged(0, media.size) - measureRecyclerViewContent(media) } } @@ -928,12 +838,9 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (media_empty_text_placeholder.isVisible()) { media_empty_text_placeholder.text = getString(R.string.no_media_with_filters) } - media_grid.beVisibleIf(media_empty_text_placeholder.isGone()) + media_fastscroller.beVisibleIf(media_empty_text_placeholder.isGone()) 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) setupAdapter() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt index 450296e20..73af513a2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt @@ -25,20 +25,13 @@ import com.simplemobiletools.gallery.pro.helpers.* import com.simplemobiletools.gallery.pro.interfaces.MediaOperationsListener import com.simplemobiletools.gallery.pro.models.Medium import com.simplemobiletools.gallery.pro.models.ThumbnailItem -import com.simplemobiletools.gallery.pro.models.ThumbnailSection -import kotlinx.android.synthetic.main.activity_media.* +import kotlinx.android.synthetic.main.activity_main.* 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 { private var mIsSearchOpen = false private var mLastSearchedText = "" - private var mDateFormat = "" - private var mTimeFormat = "" private var mSearchMenuItem: MenuItem? = null private var mCurrAsyncTask: GetMediaAsynctask? = null @@ -48,9 +41,8 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { super.onCreate(savedInstanceState) setContentView(R.layout.activity_search) media_empty_text_placeholder.setTextColor(config.textColor) - mDateFormat = config.dateFormat - mTimeFormat = getTimeFormat() getAllMedia() + media_fastscroller.updateColors(getAdjustedPrimaryColor()) } override fun onDestroy() { @@ -126,7 +118,6 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { handleGridSpacing(grouped) getMediaAdapter()?.updateMedia(grouped) - measureRecyclerViewContent(grouped) } } catch (ignored: Exception) { } @@ -136,8 +127,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) } @@ -146,11 +136,9 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { } setupLayoutManager() handleGridSpacing(mAllMedia) - measureRecyclerViewContent(mAllMedia) } else if (mLastSearchedText.isEmpty()) { (currAdapter as MediaAdapter).updateMedia(mAllMedia) handleGridSpacing(mAllMedia) - measureRecyclerViewContent(mAllMedia) } else { textChanged(mLastSearchedText) } @@ -232,77 +220,8 @@ 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.beGoneIf(allowHorizontalScroll) - - media_horizontal_fastscroller.isHorizontal = true - media_horizontal_fastscroller.beVisibleIf(allowHorizontalScroll) - - val sorting = config.getFolderSorting(SHOW_ALL) - if (allowHorizontalScroll) { - media_horizontal_fastscroller.setViews(media_grid) { - media_horizontal_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting)) - } - } else { - media_vertical_fastscroller.setViews(media_grid) { - media_vertical_fastscroller.updateBubbleText(getBubbleTextItem(it, sorting)) - } - } - } - - private fun getBubbleTextItem(index: Int, sorting: Int): String { - var realIndex = index - val mediaAdapter = getMediaAdapter() - if (mediaAdapter?.isASectionTitle(index) == true) { - realIndex++ - } - return mediaAdapter?.getItemBubbleText(realIndex, sorting, mDateFormat, mTimeFormat) ?: "" - } - - private fun measureRecyclerViewContent(media: ArrayList) { - media_grid.onGlobalLayout { - if (config.scrollHorizontally) { - calculateContentWidth(media) - } else { - calculateContentHeight(media) - } - } - } - - private fun calculateContentWidth(media: ArrayList) { - 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()) - } - - private fun calculateContentHeight(media: ArrayList) { - val layoutManager = media_grid.layoutManager as MyGridLayoutManager - val pathToCheck = SHOW_ALL - val hasSections = config.getFolderGrouping(pathToCheck) and GROUP_BY_NONE == 0 && !config.scrollHorizontally - val sectionTitleHeight = if (hasSections) layoutManager.getChildAt(0)?.height ?: 0 else 0 - val thumbnailHeight = if (hasSections) layoutManager.getChildAt(1)?.height ?: 0 else layoutManager.getChildAt(0)?.height ?: 0 - - var fullHeight = 0 - var curSectionItems = 0 - media.forEach { - if (it is ThumbnailSection) { - fullHeight += sectionTitleHeight - if (curSectionItems != 0) { - val rows = ((curSectionItems - 1) / layoutManager.spanCount + 1) - fullHeight += rows * thumbnailHeight - } - curSectionItems = 0 - } else { - curSectionItems++ - } - } - - fullHeight += ((curSectionItems - 1) / layoutManager.spanCount + 1) * thumbnailHeight - media_vertical_fastscroller.setContentHeight(fullHeight) - media_vertical_fastscroller.setScrollToY(media_grid.computeVerticalScrollOffset()) + val scrollHorizontally = config.scrollHorizontally && viewType == VIEW_TYPE_GRID + media_fastscroller.setScrollVertically(!scrollHorizontally) } private fun getAllMedia() { @@ -377,9 +296,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { } } - override fun selectedPaths(paths: ArrayList) { - } + override fun selectedPaths(paths: ArrayList) {} - override fun updateMediaGridDecoration(media: ArrayList) { - } + override fun updateMediaGridDecoration(media: ArrayList) {} } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SetWallpaperActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SetWallpaperActivity.kt index a616a1285..46e609400 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SetWallpaperActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SetWallpaperActivity.kt @@ -92,7 +92,7 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete private fun setupAspectRatio() { val wallpaperWidth = if (isLandscapeRatio) wallpaperManager.desiredMinimumWidth else wallpaperManager.desiredMinimumWidth / 2 crop_image_view.setAspectRatio(wallpaperWidth, wallpaperManager.desiredMinimumHeight) - bottom_set_wallpaper_aspect_ratio.setImageResource(if (isLandscapeRatio) R.drawable.ic_minimize else R.drawable.ic_maximize) + bottom_set_wallpaper_aspect_ratio.setImageResource(if (isLandscapeRatio) R.drawable.ic_minimize_vector else R.drawable.ic_maximize_vector) } private fun changeAspectRatio(isLandscape: Boolean) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt index 6942b3e62..754357ee8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt @@ -85,11 +85,48 @@ class SettingsActivity : SimpleActivity() { setupShowRecycleBinLast() setupEmptyRecycleBin() updateTextColors(settings_holder) - setupSectionColors() setupClearCache() setupExportSettings() setupImportSettings() invalidateOptionsMenu() + + arrayOf( + settings_color_customization_label, + settings_general_settings_label, + settings_visibility_label, + settings_videos_label, + settings_thumbnails_label, + settings_scrolling_label, + settings_fullscreen_media_label, + settings_deep_zoomable_images_label, + settings_extended_details_label, + settings_security_label, + settings_file_operations_label, + settings_bottom_actions_label, + settings_recycle_bin_label, + settings_migrating_label + ).forEach { + it.setTextColor(getAdjustedPrimaryColor()) + } + + arrayOf( + settings_color_customization_holder, + settings_general_settings_holder, + settings_visibility_holder, + settings_videos_holder, + settings_thumbnails_holder, + settings_scrolling_holder, + settings_fullscreen_media_holder, + settings_deep_zoomable_images_holder, + settings_extended_details_holder, + settings_security_holder, + settings_file_operations_holder, + settings_bottom_actions_holder, + settings_recycle_bin_holder, + settings_migrating_holder + ).forEach { + it.background.applyColorFilter(baseConfig.backgroundColor.getContrastColor()) + } } override fun onCreateOptionsMenu(menu: Menu): Boolean { @@ -105,17 +142,6 @@ class SettingsActivity : SimpleActivity() { } } - private fun setupSectionColors() { - val adjustedPrimaryColor = getAdjustedPrimaryColor() - arrayListOf( - visibility_label, videos_label, thumbnails_label, scrolling_label, fullscreen_media_label, security_label, - file_operations_label, deep_zoomable_images_label, extended_details_label, bottom_actions_label, recycle_bin_label, - migrating_label - ).forEach { - it.setTextColor(adjustedPrimaryColor) - } - } - private fun setupCustomizeColors() { settings_customize_colors_holder.setOnClickListener { startCustomizationActivity() @@ -125,6 +151,11 @@ class SettingsActivity : SimpleActivity() { private fun setupUseEnglish() { settings_use_english_holder.beVisibleIf(config.wasUseEnglishToggled || Locale.getDefault().language != "en") settings_use_english.isChecked = config.useEnglish + + if (settings_use_english_holder.isGone()) { + settings_change_date_time_format_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) + } + settings_use_english_holder.setOnClickListener { settings_use_english.toggle() config.useEnglish = settings_use_english.isChecked @@ -445,6 +476,12 @@ class SettingsActivity : SimpleActivity() { settings_allow_rotating_with_gestures_holder.beVisibleIf(config.allowZoomingImages) settings_show_highest_quality_holder.beVisibleIf(config.allowZoomingImages) settings_allow_one_to_one_zoom_holder.beVisibleIf(config.allowZoomingImages) + + if (config.allowZoomingImages) { + settings_allow_zooming_images_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) + } else { + settings_allow_zooming_images_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme) + } } private fun setupShowHighestQuality() { @@ -473,16 +510,15 @@ class SettingsActivity : SimpleActivity() { private fun setupShowExtendedDetails() { settings_show_extended_details.isChecked = config.showExtendedDetails + updateExtendedDetailsButtons() settings_show_extended_details_holder.setOnClickListener { settings_show_extended_details.toggle() config.showExtendedDetails = settings_show_extended_details.isChecked - settings_manage_extended_details_holder.beVisibleIf(config.showExtendedDetails) - settings_hide_extended_details_holder.beVisibleIf(config.showExtendedDetails) + updateExtendedDetailsButtons() } } private fun setupHideExtendedDetails() { - settings_hide_extended_details_holder.beVisibleIf(config.showExtendedDetails) settings_hide_extended_details.isChecked = config.hideExtendedDetails settings_hide_extended_details_holder.setOnClickListener { settings_hide_extended_details.toggle() @@ -491,7 +527,6 @@ class SettingsActivity : SimpleActivity() { } private fun setupManageExtendedDetails() { - settings_manage_extended_details_holder.beVisibleIf(config.showExtendedDetails) settings_manage_extended_details_holder.setOnClickListener { ManageExtendedDetailsDialog(this) { if (config.extendedDetails == 0) { @@ -501,6 +536,17 @@ class SettingsActivity : SimpleActivity() { } } + private fun updateExtendedDetailsButtons() { + settings_manage_extended_details_holder.beVisibleIf(config.showExtendedDetails) + settings_hide_extended_details_holder.beVisibleIf(config.showExtendedDetails) + + if (config.showExtendedDetails) { + settings_show_extended_details_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) + } else { + settings_show_extended_details_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme) + } + } + private fun setupSkipDeleteConfirmation() { settings_skip_delete_confirmation.isChecked = config.skipDeleteConfirmation settings_skip_delete_confirmation_holder.setOnClickListener { @@ -534,20 +580,20 @@ class SettingsActivity : SimpleActivity() { ) private fun setupBottomActions() { - settings_bottom_actions.isChecked = config.bottomActions - settings_bottom_actions_holder.setOnClickListener { - settings_bottom_actions.toggle() - config.bottomActions = settings_bottom_actions.isChecked - settings_manage_bottom_actions_holder.beVisibleIf(config.bottomActions) + settings_bottom_actions_checkbox.isChecked = config.bottomActions + updateManageBottomActionsButtons() + settings_bottom_actions_checkbox_holder.setOnClickListener { + settings_bottom_actions_checkbox.toggle() + config.bottomActions = settings_bottom_actions_checkbox.isChecked + updateManageBottomActionsButtons() } } private fun setupManageBottomActions() { - settings_manage_bottom_actions_holder.beVisibleIf(config.bottomActions) settings_manage_bottom_actions_holder.setOnClickListener { ManageBottomActionsDialog(this) { if (config.visibleBottomActions == 0) { - settings_bottom_actions_holder.callOnClick() + settings_bottom_actions_checkbox_holder.callOnClick() config.bottomActions = false config.visibleBottomActions = DEFAULT_BOTTOM_ACTIONS } @@ -555,17 +601,22 @@ class SettingsActivity : SimpleActivity() { } } + private fun updateManageBottomActionsButtons() { + settings_manage_bottom_actions_holder.beVisibleIf(config.bottomActions) + if (config.bottomActions) { + settings_bottom_actions_checkbox_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) + } else { + settings_bottom_actions_checkbox_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme) + } + } + private fun setupUseRecycleBin() { - settings_empty_recycle_bin_holder.beVisibleIf(config.useRecycleBin) - settings_show_recycle_bin_holder.beVisibleIf(config.useRecycleBin) - settings_show_recycle_bin_last_holder.beVisibleIf(config.useRecycleBin && config.showRecycleBinAtFolders) + updateRecycleBinButtons() settings_use_recycle_bin.isChecked = config.useRecycleBin settings_use_recycle_bin_holder.setOnClickListener { settings_use_recycle_bin.toggle() config.useRecycleBin = settings_use_recycle_bin.isChecked - settings_empty_recycle_bin_holder.beVisibleIf(config.useRecycleBin) - settings_show_recycle_bin_holder.beVisibleIf(config.useRecycleBin) - settings_show_recycle_bin_last_holder.beVisibleIf(config.useRecycleBin && config.showRecycleBinAtFolders) + updateRecycleBinButtons() } } @@ -574,7 +625,7 @@ class SettingsActivity : SimpleActivity() { settings_show_recycle_bin_holder.setOnClickListener { settings_show_recycle_bin.toggle() config.showRecycleBinAtFolders = settings_show_recycle_bin.isChecked - settings_show_recycle_bin_last_holder.beVisibleIf(config.useRecycleBin && config.showRecycleBinAtFolders) + updateRecycleBinButtons() } } @@ -589,6 +640,18 @@ class SettingsActivity : SimpleActivity() { } } + private fun updateRecycleBinButtons() { + settings_show_recycle_bin_last_holder.beVisibleIf(config.useRecycleBin && config.showRecycleBinAtFolders) + settings_empty_recycle_bin_holder.beVisibleIf(config.useRecycleBin) + settings_show_recycle_bin_holder.beVisibleIf(config.useRecycleBin) + + if (config.useRecycleBin) { + settings_use_recycle_bin_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) + } else { + settings_use_recycle_bin_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme) + } + } + private fun setupEmptyRecycleBin() { ensureBackgroundThread { try { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index 91408e621..0f35852a3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -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 { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt index 1011ea2cb..c44684d85 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt @@ -17,6 +17,7 @@ import androidx.recyclerview.widget.RecyclerView import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import com.bumptech.glide.Glide import com.google.gson.Gson +import com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter import com.simplemobiletools.commons.dialogs.* @@ -26,7 +27,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 +56,9 @@ import kotlin.collections.HashMap class DirectoryAdapter( activity: BaseSimpleActivity, var dirs: ArrayList, 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, RecyclerViewFastScroller.OnPopupTextUpdate { private val config = activity.config private val isListViewType = config.viewTypeFolders == VIEW_TYPE_LIST @@ -75,6 +75,9 @@ class DirectoryAdapter( private var showMediaCount = config.showFolderMediaCount private var folderStyle = config.folderStyle private var limitFolderTitle = config.limitFolderTitle + var directorySorting = config.directorySorting + var dateFormat = config.dateFormat + var timeFormat = activity.getTimeFormat() init { setupDragListener(true) @@ -616,9 +619,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) { @@ -880,4 +883,6 @@ class DirectoryAdapter( override fun onRowClear(myViewHolder: ViewHolder?) { swipeRefreshLayout?.isEnabled = activity.config.enablePullToRefresh } + + override fun onChange(position: Int) = dirs.getOrNull(position)?.getBubbleText(directorySorting, activity, dateFormat, timeFormat) ?: "" } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageFoldersAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageFoldersAdapter.kt index 670174413..4b9339554 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageFoldersAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageFoldersAdapter.kt @@ -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, val isShowingExcludedFolders: Boolean, val listener: RefreshRecyclerViewListener?, - recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) { +class ManageFoldersAdapter( + activity: BaseSimpleActivity, var folders: ArrayList, val isShowingExcludedFolders: Boolean, val listener: RefreshRecyclerViewListener?, + recyclerView: MyRecyclerView, itemClick: (Any) -> Unit +) : MyRecyclerViewAdapter(activity, recyclerView, itemClick) { private val config = activity.config diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageHiddenFoldersAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageHiddenFoldersAdapter.kt index 972d3e7a1..79e67867e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageHiddenFoldersAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/ManageHiddenFoldersAdapter.kt @@ -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, val listener: RefreshRecyclerViewListener?, - recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) { +class ManageHiddenFoldersAdapter( + activity: BaseSimpleActivity, var folders: ArrayList, val listener: RefreshRecyclerViewListener?, + recyclerView: MyRecyclerView, itemClick: (Any) -> Unit +) : MyRecyclerViewAdapter(activity, recyclerView, itemClick) { private val config = activity.config diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt index 7a90b9cc9..702d25882 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt @@ -12,6 +12,7 @@ import android.view.View import android.view.ViewGroup import android.widget.Toast import com.bumptech.glide.Glide +import com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter import com.simplemobiletools.commons.dialogs.PropertiesDialog @@ -20,7 +21,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 @@ -43,9 +43,9 @@ import java.util.* class MediaAdapter( activity: BaseSimpleActivity, var media: ArrayList, 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), RecyclerViewFastScroller.OnPopupTextUpdate { private val INSTANT_LOAD_DURATION = 2000L private val IMAGE_LOAD_DELAY = 100L @@ -69,6 +69,10 @@ class MediaAdapter( private var displayFilenames = config.displayFileNames private var showFileTypes = config.showThumbnailFileTypes + var sorting = config.getFolderSorting(if (config.showAll) SHOW_ALL else path) + var dateFormat = config.dateFormat + var timeFormat = activity.getTimeFormat() + init { setupDragListener(true) enableInstantLoad() @@ -510,10 +514,6 @@ class MediaAdapter( }, INSTANT_LOAD_DURATION) } - fun getItemBubbleText(position: Int, sorting: Int, dateFormat: String, timeFormat: String): String { - return (media[position] as? Medium)?.getBubbleText(sorting, activity, dateFormat, timeFormat) ?: "" - } - private fun setupThumbnail(view: View, medium: Medium) { val isSelected = selectedKeys.contains(medium.path.hashCode()) view.apply { @@ -612,4 +612,13 @@ class MediaAdapter( thumbnail_section.setTextColor(textColor) } } + + override fun onChange(position: Int): String { + var realIndex = position + if (isASectionTitle(position)) { + realIndex++ + } + + return (media[realIndex] as? Medium)?.getBubbleText(sorting, activity, dateFormat, timeFormat) ?: "" + } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt index 53ee995c2..b968b0f9b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt @@ -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() private var allDirectories = ArrayList() @@ -31,15 +33,17 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri spanCount = if (isGridViewType) activity.config.dirColumnCnt else 1 } + view.directories_fastscroller.updateColors(activity.getAdjustedPrimaryColor()) + val builder = AlertDialog.Builder(activity) - .setPositiveButton(R.string.ok, null) - .setNegativeButton(R.string.cancel, null) - .setOnKeyListener { dialogInterface, i, keyEvent -> - if (keyEvent.action == KeyEvent.ACTION_UP && i == KeyEvent.KEYCODE_BACK) { - backPressed() - } - true + .setPositiveButton(R.string.ok, null) + .setNegativeButton(R.string.cancel, null) + .setOnKeyListener { dialogInterface, i, keyEvent -> + if (keyEvent.action == KeyEvent.ACTION_UP && i == KeyEvent.KEYCODE_BACK) { + backPressed() } + true + } if (showOtherFolderButton) { builder.setNeutralButton(R.string.other_folder) { dialogInterface, i -> showOtherFolder() } @@ -90,7 +94,8 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri allDirectories = newDirs.clone() as ArrayList } - val distinctDirs = newDirs.filter { showFavoritesBin || (!it.isRecycleBin() && !it.areFavorites()) }.distinctBy { it.path.getDistinctPath() }.toMutableList() as ArrayList + val distinctDirs = newDirs.filter { showFavoritesBin || (!it.isRecycleBin() && !it.areFavorites()) }.distinctBy { it.path.getDistinctPath() } + .toMutableList() as ArrayList val sortedDirs = activity.getSortedDirectories(distinctDirs) val dirs = activity.getDirsToShow(sortedDirs, allDirectories, currentPathPrefix).clone() as ArrayList if (dirs.hashCode() == shownDirectories.hashCode()) { @@ -121,27 +126,9 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri } val scrollHorizontally = activity.config.scrollHorizontally && isGridViewType - val sorting = activity.config.directorySorting - val dateFormat = activity.config.dateFormat - val timeFormat = activity.getTimeFormat() view.apply { directories_grid.adapter = adapter - - directories_vertical_fastscroller.isHorizontal = false - directories_vertical_fastscroller.beGoneIf(scrollHorizontally) - - directories_horizontal_fastscroller.isHorizontal = true - directories_horizontal_fastscroller.beVisibleIf(scrollHorizontally) - - if (scrollHorizontally) { - directories_horizontal_fastscroller.setViews(directories_grid) { - directories_horizontal_fastscroller.updateBubbleText(dirs[it].getBubbleText(sorting, activity, dateFormat, timeFormat)) - } - } else { - directories_vertical_fastscroller.setViews(directories_grid) { - directories_vertical_fastscroller.updateBubbleText(dirs[it].getBubbleText(sorting, activity, dateFormat, timeFormat)) - } - } + directories_fastscroller.setScrollVertically(!scrollHorizontally) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickMediumDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickMediumDialog.kt index 1e3b2465e..7c3da17a0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickMediumDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickMediumDialog.kt @@ -3,9 +3,7 @@ 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.getAdjustedPrimaryColor import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.helpers.VIEW_TYPE_GRID import com.simplemobiletools.commons.views.MyGridLayoutManager @@ -14,24 +12,29 @@ import com.simplemobiletools.gallery.pro.adapters.MediaAdapter import com.simplemobiletools.gallery.pro.asynctasks.GetMediaAsynctask import com.simplemobiletools.gallery.pro.extensions.config import com.simplemobiletools.gallery.pro.extensions.getCachedMedia +import com.simplemobiletools.gallery.pro.helpers.GridSpacingItemDecoration import com.simplemobiletools.gallery.pro.helpers.SHOW_ALL import com.simplemobiletools.gallery.pro.models.Medium import com.simplemobiletools.gallery.pro.models.ThumbnailItem +import com.simplemobiletools.gallery.pro.models.ThumbnailSection import kotlinx.android.synthetic.main.dialog_medium_picker.view.* class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val callback: (path: String) -> Unit) { var dialog: AlertDialog var shownMedia = ArrayList() val view = activity.layoutInflater.inflate(R.layout.dialog_medium_picker, null) - val viewType = activity.config.getFolderViewType(if (activity.config.showAll) SHOW_ALL else path) + val config = activity.config + val viewType = config.getFolderViewType(if (config.showAll) SHOW_ALL else path) var isGridViewType = viewType == VIEW_TYPE_GRID init { (view.media_grid.layoutManager as MyGridLayoutManager).apply { - orientation = if (activity.config.scrollHorizontally && isGridViewType) RecyclerView.HORIZONTAL else RecyclerView.VERTICAL - spanCount = if (isGridViewType) activity.config.mediaColumnCnt else 1 + orientation = if (config.scrollHorizontally && isGridViewType) RecyclerView.HORIZONTAL else RecyclerView.VERTICAL + spanCount = if (isGridViewType) config.mediaColumnCnt else 1 } + view.media_fastscroller.updateColors(activity.getAdjustedPrimaryColor()) + dialog = AlertDialog.Builder(activity) .setPositiveButton(R.string.ok, null) .setNegativeButton(R.string.cancel, null) @@ -66,36 +69,39 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c return shownMedia = media - val adapter = MediaAdapter(activity, shownMedia.clone() as ArrayList, null, true, false, path, view.media_grid, null) { + val adapter = MediaAdapter(activity, shownMedia.clone() as ArrayList, null, true, false, path, view.media_grid) { if (it is Medium) { callback(it.path) dialog.dismiss() } } - val scrollHorizontally = activity.config.scrollHorizontally && isGridViewType - val sorting = activity.config.getFolderSorting(if (path.isEmpty()) SHOW_ALL else path) - val dateFormat = activity.config.dateFormat - val timeFormat = activity.getTimeFormat() + val scrollHorizontally = config.scrollHorizontally && isGridViewType view.apply { media_grid.adapter = adapter + media_fastscroller.setScrollVertically(!scrollHorizontally) + } + handleGridSpacing(media) + } - media_vertical_fastscroller.isHorizontal = false - media_vertical_fastscroller.beGoneIf(scrollHorizontally) + private fun handleGridSpacing(media: ArrayList) { + if (isGridViewType) { + val spanCount = config.mediaColumnCnt + val spacing = config.thumbnailSpacing + val useGridPosition = media.firstOrNull() is ThumbnailSection - media_horizontal_fastscroller.isHorizontal = true - media_horizontal_fastscroller.beVisibleIf(scrollHorizontally) + var currentGridDecoration: GridSpacingItemDecoration? = null + if (view.media_grid.itemDecorationCount > 0) { + currentGridDecoration = view.media_grid.getItemDecorationAt(0) as GridSpacingItemDecoration + currentGridDecoration.items = media + } - if (scrollHorizontally) { - media_horizontal_fastscroller.setViews(media_grid) { - val medium = (media[it] as? Medium) - media_horizontal_fastscroller.updateBubbleText(medium?.getBubbleText(sorting, activity, dateFormat, timeFormat) ?: "") - } - } else { - media_vertical_fastscroller.setViews(media_grid) { - val medium = (media[it] as? Medium) - media_vertical_fastscroller.updateBubbleText(medium?.getBubbleText(sorting, activity, dateFormat, timeFormat) ?: "") + val newGridDecoration = GridSpacingItemDecoration(spanCount, spacing, config.scrollHorizontally, config.fileRoundedCorners, media, useGridPosition) + if (currentGridDecoration.toString() != newGridDecoration.toString()) { + if (currentGridDecoration != null) { + view.media_grid.removeItemDecoration(currentGridDecoration) } + view.media_grid.addItemDecoration(newGridDecoration) } } } diff --git a/app/src/main/res/drawable-hdpi/ic_cardboard.png b/app/src/main/res/drawable-hdpi/ic_cardboard.png deleted file mode 100644 index 0df820802..000000000 Binary files a/app/src/main/res/drawable-hdpi/ic_cardboard.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_maximize.png b/app/src/main/res/drawable-hdpi/ic_maximize.png deleted file mode 100644 index 7f5c94003..000000000 Binary files a/app/src/main/res/drawable-hdpi/ic_maximize.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_minimize.png b/app/src/main/res/drawable-hdpi/ic_minimize.png deleted file mode 100644 index fe86cd0d4..000000000 Binary files a/app/src/main/res/drawable-hdpi/ic_minimize.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_cardboard.png b/app/src/main/res/drawable-xhdpi/ic_cardboard.png deleted file mode 100644 index 1c978a019..000000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_cardboard.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_maximize.png b/app/src/main/res/drawable-xhdpi/ic_maximize.png deleted file mode 100644 index 95b324a90..000000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_maximize.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_minimize.png b/app/src/main/res/drawable-xhdpi/ic_minimize.png deleted file mode 100644 index 8a389fdbc..000000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_minimize.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_cardboard.png b/app/src/main/res/drawable-xxhdpi/ic_cardboard.png deleted file mode 100644 index 71c05230d..000000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_cardboard.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_maximize.png b/app/src/main/res/drawable-xxhdpi/ic_maximize.png deleted file mode 100644 index cd9bcb195..000000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_maximize.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_minimize.png b/app/src/main/res/drawable-xxhdpi/ic_minimize.png deleted file mode 100644 index 6a9adb38e..000000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_minimize.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_cardboard.png b/app/src/main/res/drawable-xxxhdpi/ic_cardboard.png deleted file mode 100644 index d33c6ef77..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_cardboard.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_maximize.png b/app/src/main/res/drawable-xxxhdpi/ic_maximize.png deleted file mode 100644 index 6d89e4665..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_maximize.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_minimize.png b/app/src/main/res/drawable-xxxhdpi/ic_minimize.png deleted file mode 100644 index 5746cb51d..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_minimize.png and /dev/null differ diff --git a/app/src/main/res/drawable/ic_aspect_ratio_vector.xml b/app/src/main/res/drawable/ic_aspect_ratio_vector.xml index d0ebe2814..3fcbb3683 100644 --- a/app/src/main/res/drawable/ic_aspect_ratio_vector.xml +++ b/app/src/main/res/drawable/ic_aspect_ratio_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/drawable/ic_cardboard_vector.xml b/app/src/main/res/drawable/ic_cardboard_vector.xml new file mode 100644 index 000000000..e250fe73d --- /dev/null +++ b/app/src/main/res/drawable/ic_cardboard_vector.xml @@ -0,0 +1,3 @@ + + + diff --git a/app/src/main/res/drawable/ic_crop_rotate_vector.xml b/app/src/main/res/drawable/ic_crop_rotate_vector.xml index 681d300cd..d24e5faf5 100644 --- a/app/src/main/res/drawable/ic_crop_rotate_vector.xml +++ b/app/src/main/res/drawable/ic_crop_rotate_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/drawable/ic_draw_vector.xml b/app/src/main/res/drawable/ic_draw_vector.xml index 1e296d845..dfa88b66e 100644 --- a/app/src/main/res/drawable/ic_draw_vector.xml +++ b/app/src/main/res/drawable/ic_draw_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/drawable/ic_explore_off_vector.xml b/app/src/main/res/drawable/ic_explore_off_vector.xml index a67123134..8005ddbfd 100644 --- a/app/src/main/res/drawable/ic_explore_off_vector.xml +++ b/app/src/main/res/drawable/ic_explore_off_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/drawable/ic_explore_vector.xml b/app/src/main/res/drawable/ic_explore_vector.xml index 07d304b87..5545365c3 100644 --- a/app/src/main/res/drawable/ic_explore_vector.xml +++ b/app/src/main/res/drawable/ic_explore_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/drawable/ic_flip_horizontally_vector.xml b/app/src/main/res/drawable/ic_flip_horizontally_vector.xml index 7b82d9d7c..42733799a 100644 --- a/app/src/main/res/drawable/ic_flip_horizontally_vector.xml +++ b/app/src/main/res/drawable/ic_flip_horizontally_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/drawable/ic_flip_vertically_vector.xml b/app/src/main/res/drawable/ic_flip_vertically_vector.xml index 4d9437cf6..92eb70ba3 100644 --- a/app/src/main/res/drawable/ic_flip_vertically_vector.xml +++ b/app/src/main/res/drawable/ic_flip_vertically_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/drawable/ic_maximize_vector.xml b/app/src/main/res/drawable/ic_maximize_vector.xml new file mode 100644 index 000000000..7598ad394 --- /dev/null +++ b/app/src/main/res/drawable/ic_maximize_vector.xml @@ -0,0 +1,3 @@ + + + diff --git a/app/src/main/res/drawable/ic_minimize_vector.xml b/app/src/main/res/drawable/ic_minimize_vector.xml new file mode 100644 index 000000000..77e8c0f3c --- /dev/null +++ b/app/src/main/res/drawable/ic_minimize_vector.xml @@ -0,0 +1,3 @@ + + + diff --git a/app/src/main/res/drawable/ic_photo_filter_vector.xml b/app/src/main/res/drawable/ic_photo_filter_vector.xml index 127f154be..7b2290b49 100644 --- a/app/src/main/res/drawable/ic_photo_filter_vector.xml +++ b/app/src/main/res/drawable/ic_photo_filter_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/drawable/ic_portrait_photo_vector.xml b/app/src/main/res/drawable/ic_portrait_photo_vector.xml index e94d39587..54c8f9624 100644 --- a/app/src/main/res/drawable/ic_portrait_photo_vector.xml +++ b/app/src/main/res/drawable/ic_portrait_photo_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/drawable/ic_rotate_right_vector.xml b/app/src/main/res/drawable/ic_rotate_right_vector.xml index ba4935170..fed0c5047 100644 --- a/app/src/main/res/drawable/ic_rotate_right_vector.xml +++ b/app/src/main/res/drawable/ic_rotate_right_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/drawable/ic_set_as_vector.xml b/app/src/main/res/drawable/ic_set_as_vector.xml index 51a983f3b..5f00129cc 100644 --- a/app/src/main/res/drawable/ic_set_as_vector.xml +++ b/app/src/main/res/drawable/ic_set_as_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/drawable/ic_slideshow_vector.xml b/app/src/main/res/drawable/ic_slideshow_vector.xml index a9bc8667b..f8e373b4e 100644 --- a/app/src/main/res/drawable/ic_slideshow_vector.xml +++ b/app/src/main/res/drawable/ic_slideshow_vector.xml @@ -1,9 +1,3 @@ - - + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 905823c41..b500e9c62 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,86 +1,68 @@ - - + android:layout_height="wrap_content" + android:background="?attr/selectableItemBackground" + android:gravity="center" + android:padding="@dimen/activity_margin" + android:text="@string/switch_to_file_search" + android:visibility="gone" /> - + + + + + + + app:supportSwipeToRefresh="true"> - + - - - - - - - - - - - - - - - - - + + + diff --git a/app/src/main/res/layout/activity_media.xml b/app/src/main/res/layout/activity_media.xml index c17033620..45fb409b1 100644 --- a/app/src/main/res/layout/activity_media.xml +++ b/app/src/main/res/layout/activity_media.xml @@ -1,73 +1,56 @@ - - + + + + - + app:supportSwipeToRefresh="true"> - + - - - - - - - - - - - - - - - + + + diff --git a/app/src/main/res/layout/activity_panorama_photo.xml b/app/src/main/res/layout/activity_panorama_photo.xml index f4a92234d..4884433e5 100644 --- a/app/src/main/res/layout/activity_panorama_photo.xml +++ b/app/src/main/res/layout/activity_panorama_photo.xml @@ -27,7 +27,7 @@ android:layout_alignParentEnd="true" android:layout_alignParentBottom="true" android:padding="@dimen/activity_margin" - android:src="@drawable/ic_cardboard"/> + android:src="@drawable/ic_cardboard_vector"/> + android:src="@drawable/ic_cardboard_vector"/> diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index 6ab0974b7..e16962452 100644 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -19,36 +19,18 @@ android:textStyle="italic" android:visibility="gone" /> - + android:layout_height="wrap_content"> - + - - - - - - - - - + diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 48397539c..3e280a478 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -1,6 +1,5 @@ - + android:text="@string/color_customization" /> - - - - - + android:layout_margin="@dimen/medium_margin" + android:background="@drawable/section_holder_stroke" + android:orientation="vertical"> - + android:background="@drawable/ripple_all_corners"> - + - + + + + android:text="@string/general_settings" /> - - - - - + android:layout_margin="@dimen/medium_margin" + android:background="@drawable/section_holder_stroke" + android:orientation="vertical"> - + android:background="@drawable/ripple_top_corners"> - + - + - - - - - - - - - - - - - - - - - - - - - - - + android:background="@drawable/ripple_background"> - + - + - - - + android:background="@drawable/ripple_bottom_corners"> - + - + + + + + + android:text="@string/visibility" /> - + + + android:background="@drawable/ripple_top_corners"> - + - + - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_bottom_corners"> - + - + + - + android:text="@string/videos" /> - + + + android:background="@drawable/ripple_top_corners"> - + - + - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_background"> - + - + - - - - - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_bottom_corners"> - + - + + - + android:text="@string/thumbnails" /> - + + + android:background="@drawable/ripple_top_corners"> - + - + - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_bottom_corners"> - + - + + + + + + android:text="@string/scrolling" /> - + + + android:background="@drawable/ripple_top_corners"> - + - + - + android:background="@drawable/ripple_bottom_corners"> - + - + + + + android:text="@string/fullscreen_media" /> - + + + android:background="@drawable/ripple_top_corners"> - + - + - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_background"> - + - + - - - - - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_background"> - + - + - - - - + android:background="@drawable/ripple_bottom_corners"> - + + + + + + + + android:text="@string/deep_zoomable_images" /> - + + - + android:background="@drawable/ripple_top_corners"> - + - + - - - - - - - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_bottom_corners"> - + - + + - + android:text="@string/extended_details" /> - - - - - + android:layout_margin="@dimen/medium_margin" + android:background="@drawable/section_holder_stroke" + android:orientation="vertical"> - + android:background="@drawable/ripple_top_corners"> - + - + + + + + + + + + + + + + + + + android:text="@string/security" /> - + + + android:background="@drawable/ripple_top_corners"> - + - + + + + + + + + + + + + + + + + android:text="@string/file_operations" /> - + + + + + + + + + + + + + + + + + + + + + + + + android:layout_margin="@dimen/medium_margin" + android:background="@drawable/section_holder_stroke" + android:orientation="vertical"> - + android:background="@drawable/ripple_top_corners"> - + - + - - - - - - - - - + android:background="@drawable/ripple_bottom_corners"> - + - + + + + android:text="@string/recycle_bin" /> - + + + android:background="@drawable/ripple_top_corners"> - + - + - + android:background="@drawable/ripple_background"> - + - + - + android:background="@drawable/ripple_background"> - + - + - - - - - + android:background="@drawable/ripple_bottom_corners"> - + - + - + + + + android:text="@string/migrating" /> - - - - - + android:layout_margin="@dimen/medium_margin" + android:background="@drawable/section_holder_stroke" + android:orientation="vertical"> - + android:background="@drawable/ripple_top_corners"> - + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_widget_config.xml b/app/src/main/res/layout/activity_widget_config.xml index 2604a6a03..f37abb989 100644 --- a/app/src/main/res/layout/activity_widget_config.xml +++ b/app/src/main/res/layout/activity_widget_config.xml @@ -1,7 +1,5 @@ - + android:background="?attr/selectableItemBackground"> - + android:text="@string/show_folder_name" /> @@ -44,7 +37,7 @@ android:layout_marginTop="@dimen/small_margin" android:layout_marginBottom="@dimen/normal_margin" android:paddingStart="@dimen/activity_margin" - android:text="@string/folder_on_widget"/> + android:text="@string/folder_on_widget" /> + tools:text="@string/internal" /> @@ -71,7 +64,7 @@ android:layout_centerHorizontal="true" android:layout_marginLeft="@dimen/normal_margin" android:layout_marginTop="@dimen/normal_margin" - android:layout_marginRight="@dimen/normal_margin"/> + android:layout_marginRight="@dimen/normal_margin" /> + tools:text="@string/internal" /> @@ -91,7 +84,7 @@ android:id="@+id/config_bg_color" android:layout_width="@dimen/widget_colorpicker_size" android:layout_height="@dimen/widget_colorpicker_size" - android:layout_above="@+id/config_save"/> + android:layout_above="@+id/config_save" /> + android:paddingRight="@dimen/activity_margin" /> + android:layout_alignParentBottom="true" />