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 c67750636..8ba0ec26c 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 @@ -61,6 +61,8 @@ 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() @@ -122,6 +124,9 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { override fun onResume() { super.onResume() + mDateFormat = config.dateFormat + mTimeFormat = getTimeFormat() + if (mStoredAnimateGifs != config.animateGifs) { getMediaAdapter()?.updateAnimateGifs(config.animateGifs) } @@ -443,7 +448,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (mediaAdapter?.isASectionTitle(index) == true) { realIndex++ } - return mediaAdapter?.getItemBubbleText(realIndex, sorting) ?: "" + return mediaAdapter?.getItemBubbleText(realIndex, sorting, mDateFormat, mTimeFormat) ?: "" } private fun checkLastMediaChanged() { 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 ced82efa0..4eea261ac 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 @@ -31,6 +31,8 @@ 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 @@ -40,6 +42,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() } @@ -232,7 +236,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { if (mediaAdapter?.isASectionTitle(index) == true) { realIndex++ } - return mediaAdapter?.getItemBubbleText(realIndex, sorting) ?: "" + return mediaAdapter?.getItemBubbleText(realIndex, sorting, mDateFormat, mTimeFormat) ?: "" } private fun measureRecyclerViewContent(media: ArrayList) { 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 abe446094..eb9564979 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 @@ -493,7 +493,9 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList name sorting and SORT_BY_PATH != 0 -> path sorting and SORT_BY_SIZE != 0 -> size.formatSize() - sorting and SORT_BY_DATE_MODIFIED != 0 -> modified.formatDate(context) + sorting and SORT_BY_DATE_MODIFIED != 0 -> modified.formatDate(context, dateFormat, timeFormat) else -> taken.formatDate(context) }