compose: details: Setup menu

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2025-05-16 17:49:38 +08:00
parent 6c38ff5479
commit e7f6d40709
5 changed files with 193 additions and 13 deletions

View File

@@ -32,6 +32,7 @@ import android.graphics.Color
import android.os.Bundle
import android.os.Environment
import android.os.PowerManager
import android.provider.Settings
import android.util.Log
import android.util.TypedValue
import android.view.LayoutInflater
@@ -60,6 +61,17 @@ fun Context.browse(url: String) {
}
}
fun Context.appInfo(packageName: String) {
try {
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
data = "package:$packageName".toUri()
}
startActivity(intent)
} catch (exception: Exception) {
Log.e(TAG, "Failed to open app info", exception)
}
}
fun Context.share(app: App) {
try {
val sendIntent = Intent().apply {