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

V1.0.0 beta7 is completed #53

Merged
merged 4 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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