Merge pull request #2393 from KryptKode/chore/update-commons

Update gallery with recent commons module
This commit is contained in:
Tibor Kaputa 2022-03-31 07:22:51 +02:00 committed by GitHub
commit d74c84859a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 27 additions and 27 deletions

View file

@ -10,7 +10,7 @@ if (keystorePropertiesFile.exists()) {
} }
android { android {
compileSdk 30 compileSdk 31
defaultConfig { defaultConfig {
applicationId "com.simplemobiletools.gallery.pro" applicationId "com.simplemobiletools.gallery.pro"
@ -77,7 +77,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:4ef63f88a3' implementation 'com.github.SimpleMobileTools:Simple-Commons:b16cc87e63'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24'

View file

@ -107,7 +107,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
isEditingWithThirdParty = false isEditingWithThirdParty = false
bottom_draw_width.setColors(config.textColor, getAdjustedPrimaryColor(), config.backgroundColor) bottom_draw_width.setColors(config.textColor, getProperPrimaryColor(), config.backgroundColor)
} }
override fun onStop() { override fun onStop() {
@ -592,7 +592,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
else -> null else -> null
} }
currentPrimaryActionButton?.applyColorFilter(getAdjustedPrimaryColor()) currentPrimaryActionButton?.applyColorFilter(getProperPrimaryColor())
bottom_editor_filter_actions.beVisibleIf(currPrimaryAction == PRIMARY_ACTION_FILTER) bottom_editor_filter_actions.beVisibleIf(currPrimaryAction == PRIMARY_ACTION_FILTER)
bottom_editor_crop_rotate_actions.beVisibleIf(currPrimaryAction == PRIMARY_ACTION_CROP_ROTATE) bottom_editor_crop_rotate_actions.beVisibleIf(currPrimaryAction == PRIMARY_ACTION_CROP_ROTATE)
bottom_editor_draw_actions.beVisibleIf(currPrimaryAction == PRIMARY_ACTION_DRAW) bottom_editor_draw_actions.beVisibleIf(currPrimaryAction == PRIMARY_ACTION_DRAW)
@ -708,7 +708,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
else -> bottom_aspect_ratio_other else -> bottom_aspect_ratio_other
} }
currentAspectRatioButton.setTextColor(getAdjustedPrimaryColor()) currentAspectRatioButton.setTextColor(getProperPrimaryColor())
} }
private fun updateCropRotateActionButtons() { private fun updateCropRotateActionButtons() {
@ -721,7 +721,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
else -> null else -> null
} }
primaryActionView?.applyColorFilter(getAdjustedPrimaryColor()) primaryActionView?.applyColorFilter(getProperPrimaryColor())
} }
private fun updateDrawColor(color: Int) { private fun updateDrawColor(color: Int) {

View file

@ -83,7 +83,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
private var mStoredCropThumbnails = true private var mStoredCropThumbnails = true
private var mStoredScrollHorizontally = true private var mStoredScrollHorizontally = true
private var mStoredTextColor = 0 private var mStoredTextColor = 0
private var mStoredAdjustedPrimaryColor = 0 private var mStoredPrimaryColor = 0
private var mStoredStyleString = "" private var mStoredStyleString = ""
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
@ -184,8 +184,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
getRecyclerAdapter()?.updateTextColor(config.textColor) getRecyclerAdapter()?.updateTextColor(config.textColor)
} }
val adjustedPrimaryColor = getAdjustedPrimaryColor() val primaryColor = getProperPrimaryColor()
if (mStoredAdjustedPrimaryColor != adjustedPrimaryColor) { if (mStoredPrimaryColor != primaryColor) {
getRecyclerAdapter()?.updatePrimaryColor(config.primaryColor) getRecyclerAdapter()?.updatePrimaryColor(config.primaryColor)
} }
@ -194,7 +194,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
setupAdapter(mDirs, forceRecreate = true) setupAdapter(mDirs, forceRecreate = true)
} }
directories_fastscroller.updateColors(adjustedPrimaryColor) directories_fastscroller.updateColors(primaryColor)
directories_refresh_layout.isEnabled = config.enablePullToRefresh directories_refresh_layout.isEnabled = config.enablePullToRefresh
getRecyclerAdapter()?.apply { getRecyclerAdapter()?.apply {
dateFormat = config.dateFormat dateFormat = config.dateFormat
@ -202,8 +202,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
} }
directories_empty_placeholder.setTextColor(config.textColor) directories_empty_placeholder.setTextColor(config.textColor)
directories_empty_placeholder_2.setTextColor(adjustedPrimaryColor) directories_empty_placeholder_2.setTextColor(primaryColor)
directories_switch_searching.setTextColor(adjustedPrimaryColor) directories_switch_searching.setTextColor(primaryColor)
directories_switch_searching.underlineText() directories_switch_searching.underlineText()
if (!mIsSearchOpen) { if (!mIsSearchOpen) {
@ -341,7 +341,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
mStoredTextColor = textColor mStoredTextColor = textColor
mStoredStyleString = "$folderStyle$showFolderMediaCount$limitFolderTitle" mStoredStyleString = "$folderStyle$showFolderMediaCount$limitFolderTitle"
} }
mStoredAdjustedPrimaryColor = getAdjustedPrimaryColor() mStoredPrimaryColor = getProperPrimaryColor()
} }
private fun setupSearch(menu: Menu) { private fun setupSearch(menu: Menu) {

View file

@ -75,7 +75,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
private var mStoredRoundedCorners = false private var mStoredRoundedCorners = false
private var mStoredMarkFavoriteItems = true private var mStoredMarkFavoriteItems = true
private var mStoredTextColor = 0 private var mStoredTextColor = 0
private var mStoredAdjustedPrimaryColor = 0 private var mStoredPrimaryColor = 0
private var mStoredThumbnailSpacing = 0 private var mStoredThumbnailSpacing = 0
companion object { companion object {
@ -145,8 +145,8 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
getMediaAdapter()?.updateTextColor(config.textColor) getMediaAdapter()?.updateTextColor(config.textColor)
} }
val adjustedPrimaryColor = getAdjustedPrimaryColor() val primaryColor = getProperPrimaryColor()
if (mStoredAdjustedPrimaryColor != adjustedPrimaryColor) { if (mStoredPrimaryColor != primaryColor) {
getMediaAdapter()?.updatePrimaryColor(config.primaryColor) getMediaAdapter()?.updatePrimaryColor(config.primaryColor)
} }
@ -159,7 +159,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
setupAdapter() setupAdapter()
} }
media_fastscroller.updateColors(adjustedPrimaryColor) media_fastscroller.updateColors(primaryColor)
media_refresh_layout.isEnabled = config.enablePullToRefresh media_refresh_layout.isEnabled = config.enablePullToRefresh
getMediaAdapter()?.apply { getMediaAdapter()?.apply {
dateFormat = config.dateFormat dateFormat = config.dateFormat
@ -167,7 +167,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
} }
media_empty_text_placeholder.setTextColor(config.textColor) media_empty_text_placeholder.setTextColor(config.textColor)
media_empty_text_placeholder_2.setTextColor(getAdjustedPrimaryColor()) media_empty_text_placeholder_2.setTextColor(getProperPrimaryColor())
if (!mIsSearchOpen) { if (!mIsSearchOpen) {
invalidateOptionsMenu() invalidateOptionsMenu()
@ -312,7 +312,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
mStoredRoundedCorners = fileRoundedCorners mStoredRoundedCorners = fileRoundedCorners
mShowAll = showAll mShowAll = showAll
} }
mStoredAdjustedPrimaryColor = getAdjustedPrimaryColor() mStoredPrimaryColor = getProperPrimaryColor()
} }
private fun setupSearch(menu: Menu) { private fun setupSearch(menu: Menu) {

View file

@ -42,7 +42,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener {
setContentView(R.layout.activity_search) setContentView(R.layout.activity_search)
media_empty_text_placeholder.setTextColor(config.textColor) media_empty_text_placeholder.setTextColor(config.textColor)
getAllMedia() getAllMedia()
media_fastscroller.updateColors(getAdjustedPrimaryColor()) media_fastscroller.updateColors(getProperPrimaryColor())
} }
override fun onDestroy() { override fun onDestroy() {

View file

@ -105,7 +105,7 @@ class SettingsActivity : SimpleActivity() {
settings_recycle_bin_label, settings_recycle_bin_label,
settings_migrating_label settings_migrating_label
).forEach { ).forEach {
it.setTextColor(getAdjustedPrimaryColor()) it.setTextColor(getProperPrimaryColor())
} }
arrayOf( arrayOf(

View file

@ -761,7 +761,7 @@ class DirectoryAdapter(
dir_check?.beVisibleIf(isSelected) dir_check?.beVisibleIf(isSelected)
if (isSelected) { if (isSelected) {
dir_check.background?.applyColorFilter(adjustedPrimaryColor) dir_check.background?.applyColorFilter(properPrimaryColor)
dir_check.applyColorFilter(contrastColor) dir_check.applyColorFilter(contrastColor)
} }

View file

@ -585,7 +585,7 @@ class MediaAdapter(
medium_check?.beVisibleIf(isSelected) medium_check?.beVisibleIf(isSelected)
if (isSelected) { if (isSelected) {
medium_check?.background?.applyColorFilter(adjustedPrimaryColor) medium_check?.background?.applyColorFilter(properPrimaryColor)
medium_check.applyColorFilter(contrastColor) medium_check.applyColorFilter(contrastColor)
} }

View file

@ -34,7 +34,7 @@ class PickDirectoryDialog(
spanCount = if (isGridViewType) activity.config.dirColumnCnt else 1 spanCount = if (isGridViewType) activity.config.dirColumnCnt else 1
} }
view.directories_fastscroller.updateColors(activity.getAdjustedPrimaryColor()) view.directories_fastscroller.updateColors(activity.getProperPrimaryColor())
val builder = AlertDialog.Builder(activity) val builder = AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, null) .setPositiveButton(R.string.ok, null)

View file

@ -3,7 +3,7 @@ package com.simplemobiletools.gallery.pro.dialogs
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor import com.simplemobiletools.commons.extensions.getProperPrimaryColor
import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.helpers.VIEW_TYPE_GRID import com.simplemobiletools.commons.helpers.VIEW_TYPE_GRID
import com.simplemobiletools.commons.views.MyGridLayoutManager import com.simplemobiletools.commons.views.MyGridLayoutManager
@ -33,7 +33,7 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c
spanCount = if (isGridViewType) config.mediaColumnCnt else 1 spanCount = if (isGridViewType) config.mediaColumnCnt else 1
} }
view.media_fastscroller.updateColors(activity.getAdjustedPrimaryColor()) view.media_fastscroller.updateColors(activity.getProperPrimaryColor())
dialog = AlertDialog.Builder(activity) dialog = AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, null) .setPositiveButton(R.string.ok, null)

View file

@ -18,7 +18,7 @@ class PicassoRegionDecoder(
override fun init(context: Context, uri: Uri): Point { override fun init(context: Context, uri: Uri): Point {
val newUri = Uri.parse(uri.toString().replace("%", "%25").replace("#", "%23")) val newUri = Uri.parse(uri.toString().replace("%", "%25").replace("#", "%23"))
val inputStream = context.contentResolver.openInputStream(newUri) val inputStream = context.contentResolver.openInputStream(newUri)
decoder = BitmapRegionDecoder.newInstance(inputStream, false) decoder = BitmapRegionDecoder.newInstance(inputStream!!, false)
return Point(decoder!!.width, decoder!!.height) return Point(decoder!!.width, decoder!!.height)
} }