diff --git a/res/values/strings.xml b/res/values/strings.xml index 887491d5a7b..89c4540b9f1 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -9734,8 +9734,10 @@ Open by default Open supported links + In the app + In your browser - Allow web links to open in this app + Choose how to open web links for this app Links to open in this app diff --git a/res/xml/installed_app_launch_settings.xml b/res/xml/installed_app_launch_settings.xml index 2268d5c9d98..ffd73bc78c8 100644 --- a/res/xml/installed_app_launch_settings.xml +++ b/res/xml/installed_app_launch_settings.xml @@ -19,9 +19,15 @@ xmlns:settings="http://schemas.android.com/apk/res-auto" android:title="@string/launch_by_default"> - + + + + + 0); } + private void setOpenByDefaultPreference(boolean openInApp) { + if (mOpenInBrowserSelector == null || mOpenInAppSelector == null) return; + mOpenInAppSelector.setChecked(openInApp); + mOpenInBrowserSelector.setChecked(!openInApp); + } + private void showVerifiedLinksDialog() { final int linksNo = getLinksNumber(DOMAIN_STATE_VERIFIED); if (linksNo == 0) { @@ -360,9 +372,12 @@ public class AppLaunchSettings extends AppInfoBase implements } private void disabledPreference() { - mMainSwitchPreference.updateStatus(false); - mMainSwitchPreference.setSelectable(false); - mMainSwitchPreference.setEnabled(false); + if (mOpenInAppSelector == null ||mOpenInBrowserSelector == null) return; + setOpenByDefaultPreference(false /* openInApp */); + mOpenInAppSelector.setSelectable(false); + mOpenInAppSelector.setEnabled(false); + mOpenInBrowserSelector.setSelectable(false); + mOpenInBrowserSelector.setEnabled(false); mMainPreferenceCategory.setVisible(false); }