Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.93 to main #178

Merged
merged 22 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1588b60
store growing apps sorted by change
seelchen Jan 8, 2024
d8149d2
Merge pull request #166 from seelchen/bugfix/growing-apps-sorting
VishalNehra Jan 11, 2024
69fdfa6
Update README.md
inson1 Feb 6, 2024
dfcda81
Merge pull request #167 from inson1/patch-1
VishalNehra Jul 8, 2024
868d0c4
Fix cutout mode crashes for full screen players
VishalNehra Jul 8, 2024
383b104
Merge pull request #171 from TeamAmaze/bugfix/fullscreen-cutoff
VishalNehra Jul 8, 2024
a143c3c
Show usage hours in most used apps analyisis
VishalNehra Jul 14, 2024
ad783c0
Apply spotless
VishalNehra Jul 14, 2024
13a7b02
Merge pull request #172 from TeamAmaze/feature-140
VishalNehra Jul 14, 2024
0d95e29
Fix permission activity not found issue on few devices
VishalNehra Jul 14, 2024
1eaf9c2
Merge pull request #173 from TeamAmaze/bugfix/permissions-activity
VishalNehra Jul 14, 2024
6df2101
Fixing purchase flow crash
VishalNehra Jul 14, 2024
9e8746a
Apply spotless
VishalNehra Jul 14, 2024
34f554f
Merge pull request #174 from TeamAmaze/bugfix/purchase-flow
VishalNehra Jul 14, 2024
f5d5d76
Fix usage access permissions issues; fix audio list fragment crash; f…
VishalNehra Jul 14, 2024
adf4d6e
Merge pull request #175 from TeamAmaze/bugfix/purchase-flow
VishalNehra Jul 14, 2024
c2d73ab
Update settings page summary
VishalNehra Jul 14, 2024
6c73363
Apply spotless
VishalNehra Jul 14, 2024
fecc91c
Merge pull request #176 from TeamAmaze/feature-170
VishalNehra Jul 14, 2024
e1cc727
Update translations
VishalNehra Jul 14, 2024
5eb54f0
Merge pull request #177 from TeamAmaze/update-translations
VishalNehra Jul 14, 2024
9b7ef51
Bump version to 1.93
VishalNehra Jul 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ The device vendors/ROM developers are free to include Amaze apk pre-installed in

We strongly recommend using apk signed by us (either Play Store version or from AFH link above) so that users would be able to update directly from Play Store after distribution. Furthermore, a change in digital signature will break plug-ins.

## License:
## License
Amaze File Utilities is licenced under [GPLv3](https://teamamaze.xyz/license-agreement-utilities) and anyone wanting to use it (as a base for your own project or even use some of its parts or features) has to adhere to this license completely. Make sure that you are aware of all the licensing terms before creating your own project based on Amaze Utilities.

Here some important points to keep in mind, as to how we handle licensing:
Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ android {
minSdk 21
targetSdk 33

Integer sudoVersionCode = 33
String versionNameText = "1.92"
Integer sudoVersionCode = 34
String versionNameText = "1.93"

String[] abiFilterList = property("abiFilters").toString().split(';')
Integer minorVersion = 0
Expand Down Expand Up @@ -202,7 +202,7 @@ android {
// track.set("internal")
track.set("production")
userFraction.set(1.0d)
updatePriority.set(2)
updatePriority.set(4)
releaseStatus.set(com.github.triplet.gradle.androidpublisher.ReleaseStatus.COMPLETED)
}
}
Expand Down Expand Up @@ -263,7 +263,7 @@ dependencies {
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.google.android.exoplayer:exoplayer:2.16.0'
implementation 'com.google.android.exoplayer:extension-mediasession:2.16.0'
implementation 'com.ramijemli.percentagechartview:percentagechartview:0.3.1'
implementation 'com.github.DroidsOnRoids:PercentageChartView:5a6836bd0d'
implementation 'com.github.massoudss:waveformSeekBar:5.0.1'
implementation 'com.github.lincollincol:amplituda:2.1.6'
//Simple library show
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<activity
android:name=".image_viewer.ImageViewerActivity"
android:label="@string/image_viewer"
android:theme="@style/Theme.AmazeFileUtilities.FullScreen.Dark"
android:theme="@style/Theme.AmazeFileUtilities.FullScreen.Dark.Fallback"
android:exported="true"
>
<intent-filter
Expand All @@ -111,7 +111,7 @@
<activity
android:name=".image_viewer.editor.EditImageActivity"
android:label="@string/image_editor"
android:theme="@style/Theme.AmazeFileUtilities.FullScreen.Dark"
android:theme="@style/Theme.AmazeFileUtilities.FullScreen.Dark.Fallback"
android:exported="true"
>
<intent-filter
Expand Down Expand Up @@ -159,7 +159,7 @@
android:supportsPictureInPicture="true"
android:resizeableActivity="true"
android:taskAffinity="com.amaze.fileutilitiespip"
android:theme="@style/Theme.AmazeFileUtilities.FullScreen.Dark"
android:theme="@style/Theme.AmazeFileUtilities.FullScreen.Dark.Fallback"
android:exported="true">
<intent-filter
android:label="@string/video_player_full_screen"
Expand Down
44 changes: 27 additions & 17 deletions app/src/main/java/com/amaze/fileutilities/PermissionsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -161,30 +161,35 @@ open class PermissionsActivity :

private fun checkStoragePermission(): Boolean {
// Verify that all required contact permissions have been granted.
var isFound = false
if (VERSION.SDK_INT >= Build.VERSION_CODES.R) {
try {
isFound = (
ActivityCompat.checkSelfPermission(
this, Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
)
== PackageManager.PERMISSION_GRANTED
) || (
ActivityCompat.checkSelfPermission(
this, Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION
)

// Verify that all required contact permissions have been granted.
return if (VERSION.SDK_INT >= Build.VERSION_CODES.R) {
(
ActivityCompat.checkSelfPermission(
this, Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
)
== PackageManager.PERMISSION_GRANTED
) || (
ActivityCompat.checkSelfPermission(
this, Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION
)

== PackageManager.PERMISSION_GRANTED
) || Environment.isExternalStorageManager()
} else {
(
== PackageManager.PERMISSION_GRANTED
) || Environment.isExternalStorageManager()
} catch (anfe: ActivityNotFoundException) {
log.warn("all files access permission activity missing, fallback to default", anfe)
}
}
if (!isFound) {
isFound = (
ActivityCompat.checkSelfPermission(
this,
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
== PackageManager.PERMISSION_GRANTED
)
}
return isFound
}

fun isLocationEnabled(onPermissionGranted: OnPermissionGranted) {
Expand All @@ -204,7 +209,12 @@ open class PermissionsActivity :
.setPositiveButton(
resources.getString(R.string.yes)
) { dialog, _ ->
startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS))
try {
startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS))
} catch (anfe: ActivityNotFoundException) {
log.warn("failed to find location settings activity", anfe)
this.showToastInCenter(getString(R.string.grantfailed))
}
dialog.cancel()
}
.setNegativeButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ class MainActivity :
}

private fun exit() {
if (getFilesModel().backPressedToExitOnce) {
val confirmBeforeExitPref = getAppCommonSharedPreferences().getBoolean(
PreferencesConstants.KEY_CONFIRM_BEFORE_EXIT,
PreferencesConstants.DEFAULT_CONFIRM_BEFORE_EXIT
)
if (!confirmBeforeExitPref || getFilesModel().backPressedToExitOnce) {
finish()
} else {
getFilesModel().backPressedToExitOnce = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,27 +147,35 @@ abstract class WelcomePermissionScreen :

fun checkStoragePermission(): Boolean {
// Verify that all required contact permissions have been granted.
return if (VERSION.SDK_INT >= Build.VERSION_CODES.R) {
(
ActivityCompat.checkSelfPermission(
this, Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
)
== PackageManager.PERMISSION_GRANTED
) || (
ActivityCompat.checkSelfPermission(
this, Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION
)
== PackageManager.PERMISSION_GRANTED
) || Environment.isExternalStorageManager()
} else {
(
var isFound = false
if (VERSION.SDK_INT >= Build.VERSION_CODES.R) {
try {
isFound = (
ActivityCompat.checkSelfPermission(
this, Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
)
== PackageManager.PERMISSION_GRANTED
) || (
ActivityCompat.checkSelfPermission(
this, Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION
)

== PackageManager.PERMISSION_GRANTED
) || Environment.isExternalStorageManager()
} catch (anfe: ActivityNotFoundException) {
log.warn("all files access permission activity missing, fallback to default", anfe)
}
}
if (!isFound) {
isFound = (
ActivityCompat.checkSelfPermission(
this,
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
== PackageManager.PERMISSION_GRANTED
)
}
return isFound
}

fun isLocationEnabled(onPermissionGranted: OnPermissionGranted) {
Expand All @@ -187,7 +195,12 @@ abstract class WelcomePermissionScreen :
.setPositiveButton(
resources.getString(R.string.yes)
) { dialog, _ ->
startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS))
try {
startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS))
} catch (anfe: ActivityNotFoundException) {
log.warn("failed to find location settings activity", anfe)
this.showToastInCenter(getString(R.string.grantfailed))
}
dialog.cancel()
}
.setNegativeButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package com.amaze.fileutilities.home_page.ui.analyse

import android.content.ActivityNotFoundException
import android.content.Intent
import android.content.SharedPreferences
import android.net.Uri
Expand Down Expand Up @@ -48,11 +49,16 @@ import com.amaze.fileutilities.utilis.AbstractMediaFileInfoOperationsFragment
import com.amaze.fileutilities.utilis.PreferencesConstants
import com.amaze.fileutilities.utilis.Utils
import com.amaze.fileutilities.utilis.getAppCommonSharedPreferences
import com.amaze.fileutilities.utilis.showToastInCenter
import com.amaze.fileutilities.utilis.showToastOnBottom
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import kotlin.concurrent.thread

class AnalyseFragment : AbstractMediaFileInfoOperationsFragment() {

private var log: Logger = LoggerFactory.getLogger(AnalyseFragment::class.java)

private lateinit var analyseViewModel: AnalyseViewModel
private val filesViewModel: FilesViewModel by activityViewModels()

Expand Down Expand Up @@ -483,9 +489,7 @@ class AnalyseFragment : AbstractMediaFileInfoOperationsFragment() {
unusedAppsPreview.visibility = View.VISIBLE
if (!isUsageStatsPermissionGranted()) {
unusedAppsPreview.loadRequireElevatedPermission({
val intent = Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS)
intent.data = Uri.parse("package:${requireActivity().packageName}")
startActivity(intent)
launchUsageAccessScreen()
}, ::usageStatsPermissionReload)
} else {
filesViewModel.getUnusedApps().observe(viewLifecycleOwner) {
Expand All @@ -508,14 +512,10 @@ class AnalyseFragment : AbstractMediaFileInfoOperationsFragment() {
leastUsedAppsPreview.visibility = View.VISIBLE
if (!isUsageStatsPermissionGranted()) {
mostUsedAppsPreview.loadRequireElevatedPermission({
val intent = Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS)
intent.data = Uri.parse("package:${requireActivity().packageName}")
startActivity(intent)
launchUsageAccessScreen()
}, ::usageStatsPermissionReload)
leastUsedAppsPreview.loadRequireElevatedPermission({
val intent = Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS)
intent.data = Uri.parse("package:${requireActivity().packageName}")
startActivity(intent)
launchUsageAccessScreen()
}, ::usageStatsPermissionReload)
} else {
filesViewModel.getMostUsedApps().observe(viewLifecycleOwner) {
Expand Down Expand Up @@ -554,9 +554,7 @@ class AnalyseFragment : AbstractMediaFileInfoOperationsFragment() {
!isUsageStatsPermissionGranted()
) {
networkIntensiveAppsPreview.loadRequireElevatedPermission({
val intent = Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS)
intent.data = Uri.parse("package:${requireActivity().packageName}")
startActivity(intent)
launchUsageAccessScreen()
}, ::usageStatsPermissionReload)
} else {
filesViewModel.getNetworkIntensiveApps().observe(viewLifecycleOwner) {
Expand Down Expand Up @@ -617,8 +615,7 @@ class AnalyseFragment : AbstractMediaFileInfoOperationsFragment() {
// Starting with version O, the PACKAGE_USAGE_STATS permission is necessary to query
// the size of other apps
largeSizeDiffAppsPreview.loadRequireElevatedPermission({
val intent = Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS)
startActivity(intent)
launchUsageAccessScreen()
}, ::usageStatsPermissionReload)
} else {
filesViewModel.getLargeSizeDiffApps()
Expand Down Expand Up @@ -1084,4 +1081,15 @@ class AnalyseFragment : AbstractMediaFileInfoOperationsFragment() {
}
}
}

private fun launchUsageAccessScreen() {
try {
val intent = Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS)
intent.data = Uri.parse("package:${requireActivity().packageName}")
startActivity(intent)
} catch (anfe: ActivityNotFoundException) {
log.warn("usage access activity not found", anfe)
requireContext().showToastInCenter(getString(R.string.grantfailed))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.amaze.fileutilities.home_page.ui.files.MediaInfoRecyclerViewHolder
import com.amaze.fileutilities.utilis.AbstractMediaFilesAdapter
import com.amaze.fileutilities.utilis.EmptyViewHolder
import com.amaze.fileutilities.utilis.FileUtils
import com.amaze.fileutilities.utilis.Utils
import java.lang.ref.WeakReference

class ReviewAnalysisAdapter(
Expand Down Expand Up @@ -99,6 +100,16 @@ class ReviewAnalysisAdapter(
} else {
holder.infoSummary.text = totalSize
}
} else if (analysisType == ReviewImagesFragment.TYPE_MOST_USED_APPS) {
val timeForeground =
Utils.convertMillisToHoursMinutes(
this.mediaFileInfo?.extraInfo
?.apkMetaData?.timeForeground ?: 0L
)
val size = this.mediaFileInfo?.getFormattedSize(context)
holder.infoSummary.text = "${context.getString(R.string.size)}: $size"
holder.extraInfo.text = "${context.getString(R.string.usage)}: " +
"$timeForeground"
} else {
holder.infoSummary.text = this.mediaFileInfo?.getFormattedSize(context)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,14 +579,16 @@ class AudiosListFragment : AbstractMediaInfoListFragment(), IAudioPlayerInterfac
val selectedSongList = getMediaFileAdapter()?.checkItemsList
if (selectedSongList?.size == 1) {
selectedSongList[0].mediaFileInfo?.getContentUri(requireContext())?.let { it1 ->
audioPlaybackServiceConnection
.getAudioServiceInstance()?.insertPlayNextSong(
it1
)
Toast.makeText(
requireContext(), R.string.play_next_success,
Toast.LENGTH_LONG
).show()
if (::audioPlaybackServiceConnection.isInitialized) {
audioPlaybackServiceConnection
.getAudioServiceInstance()?.insertPlayNextSong(
it1
)
Toast.makeText(
requireContext(), R.string.play_next_success,
Toast.LENGTH_LONG
).show()
}
}
}
hideActionBar()
Expand Down
Loading
Loading