mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 14:27:57 +01:00 
			
		
		
		
	Add shortcut to open extension package in system settings
This commit is contained in:
		| @@ -2,7 +2,10 @@ package eu.kanade.tachiyomi.ui.browse.extension.details | ||||
|  | ||||
| import android.annotation.SuppressLint | ||||
| import android.content.Context | ||||
| import android.content.Intent | ||||
| import android.net.Uri | ||||
| import android.os.Bundle | ||||
| import android.provider.Settings | ||||
| import android.util.TypedValue | ||||
| import android.view.LayoutInflater | ||||
| import android.view.Menu | ||||
| @@ -180,6 +183,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) : | ||||
|         when (item.itemId) { | ||||
|             R.id.action_enable_all -> toggleAllSources(true) | ||||
|             R.id.action_disable_all -> toggleAllSources(false) | ||||
|             R.id.action_open_in_settings -> openInSettings() | ||||
|         } | ||||
|         return super.onOptionsItemSelected(item) | ||||
|     } | ||||
| @@ -204,6 +208,13 @@ class ExtensionDetailsController(bundle: Bundle? = null) : | ||||
|         ) | ||||
|     } | ||||
|  | ||||
|     private fun openInSettings() { | ||||
|         val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply { | ||||
|             data = Uri.fromParts("package", presenter.pkgName, null) | ||||
|         } | ||||
|         startActivity(intent) | ||||
|     } | ||||
|  | ||||
|     private fun Source.isEnabled(): Boolean { | ||||
|         return id.toString() !in preferences.disabledSources().get() | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user