d4rken-org / permission-pilot

Android permission explorer 🧑‍✈️
GNU General Public License v3.0
387 stars 38 forks source link

Long-press action for Tabs #119

Open TheRealMystic opened 2 years ago

TheRealMystic commented 2 years ago

Can you implement long-press action for the 3 tabs at the bottom?

Overview Tab will launch System Settings Homepage: com.android.settings.Settings OR com.android.settings.homepage.SettingsHomepageActivity

Apps Tab will launch App Dashboard*: com.android.settings.Settings$AppDashboardActivity

Permissions Tab will launch the Permissions Manager page directly, OR Privacy Dashboard: com.android.settings.Settings$PrivacyDashboardActivity

*the reason I chose App Dashboard and NOT this one: com.android.settings.Settings$ManageApplicationsActivity

is because I haven't found a direct shortcut to the Special Access page. App Dashboard gives quick access to both Applications as well as Special Access.

d4rken commented 2 years ago

These are package names + Activity components, while we could probably launch these, this is just an implementation details of a specific ROM. It will not work on every ROM.

To work on all ROMs, we need to use Intent actions defined by the SDK, e.g.:

https://developer.android.com/reference/android/provider/Settings#ACTION_ACCESSIBILITY_SETTINGS

If something is not possible with intent actions, and we really want to still launch that activity, then we need to build a ROM database to account for the differences.

TheRealMystic commented 2 years ago

Okay. I don't know the details.

I use Shortcut Maker app to quickly launch a few System Settings, and I picked up these details from this app

These shortcuts work on both my Samsung phone and OnePlus phone (both are on Android 12).

d4rken commented 2 years ago

Couldn't find an official way to do this. Do we just try these and throw an error otherwise?

TheRealMystic commented 2 years ago

Couldn't find an official way to do this. Do we just try these and throw an error otherwise?

Why not let the user choose what he wants to launch with a long-press? You can allow for long-press configuration under app settings. The setting for each tab will launch full list of 'Activities' or 'Intents' that the ROM supports. User can choose whatever best suits his requirement.

d4rken commented 2 years ago

Not directly supported by BottomNavigationView.