Skip to content

Commit

Permalink
Merge pull request #54 from emreesen27/develop
Browse files Browse the repository at this point in the history
v1.0.0-beta7 is completed
  • Loading branch information
emreesen27 authored Apr 27, 2024
2 parents 9a82e95 + 83147d5 commit c703409
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## v1.0.0-beta7 (26.04.2024)

* ActivityNotFoundException and ClassNotFoundException fixed.

## v1.0.0-beta6 (24.04.2024)

* The "Rename" feature added.
* Dialogs UI improvement
* The issue of license URLs redirecting to the wrong address fixed
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ android {
applicationId "com.sn.snfilemanager"
minSdk 26
targetSdk 34
versionCode 6
versionName "1.0.0-beta6"
versionCode 7
versionName "1.0.0-beta7"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ fun Context.startActivitySafely(intent: Intent) {
try {
startActivity(intent)
} catch (e: ActivityNotFoundException) {
// Todo
e.message?.let { errorToast(it) }
}
}

Expand Down
21 changes: 11 additions & 10 deletions app/src/main/java/com/sn/snfilemanager/feature/home/HomeFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import android.os.Build
import android.os.Environment
import android.provider.Settings
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.RequiresApi
import androidx.appcompat.widget.Toolbar
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat
Expand All @@ -22,6 +21,7 @@ import com.sn.snfilemanager.core.extensions.getPackage
import com.sn.snfilemanager.core.extensions.infoToast
import com.sn.snfilemanager.core.extensions.observe
import com.sn.snfilemanager.core.extensions.openUrl
import com.sn.snfilemanager.core.extensions.startActivitySafely
import com.sn.snfilemanager.core.util.Constant
import com.sn.snfilemanager.core.util.DocumentType
import com.sn.snfilemanager.core.util.RootPath
Expand Down Expand Up @@ -129,14 +129,15 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>() {
}
}

@RequiresApi(Build.VERSION_CODES.R)
private fun routeFileAccessSettings() {
val intent =
Intent(
Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION,
Uri.parse(context?.getPackage()),
)
startActivity(intent)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
val intent =
Intent(
Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION,
Uri.parse(context?.getPackage()),
)
context?.startActivitySafely(intent)
}
}

private fun routeAppSettings() {
Expand All @@ -145,7 +146,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>() {
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.parse(context?.getPackage()),
)
startActivity(intent)
context?.startActivitySafely(intent)
}

private fun routeNotificationSettings() {
Expand All @@ -156,7 +157,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>() {
action = Settings.ACTION_APP_NOTIFICATION_SETTINGS
putExtra(Settings.EXTRA_APP_PACKAGE, context?.packageName)
}
context?.startActivity(settingsIntent)
context?.startActivitySafely(settingsIntent)
}
}

Expand Down
2 changes: 1 addition & 1 deletion mediastorepv

0 comments on commit c703409

Please sign in to comment.