use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class ConnectedUsbDeviceUpdater method initUsbPreference.
public void initUsbPreference(Context context) {
mUsbPreference = new RestrictedPreference(context, null);
mUsbPreference.setTitle(R.string.usb_pref);
mUsbPreference.setIcon(R.drawable.ic_usb);
mUsbPreference.setKey(PREF_KEY);
mUsbPreference.setDisabledByAdmin(checkIfUsbDataSignalingIsDisabled(context, UserHandle.myUserId()));
mUsbPreference.setOnPreferenceClickListener((Preference p) -> {
mMetricsFeatureProvider.logClickedPreference(p, mFragment.getMetricsCategory());
// New version - uses a separate screen.
new SubSettingLauncher(mFragment.getContext()).setDestination(UsbDetailsFragment.class.getName()).setTitleRes(R.string.usb_preference).setSourceMetricsCategory(mFragment.getMetricsCategory()).launch();
return true;
});
forceUpdate();
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class StorageUtils method launchForgetMissingVolumeRecordFragment.
/**
* Launches the fragment to forget a specified missing volume record.
*/
public static void launchForgetMissingVolumeRecordFragment(Context context, StorageEntry storageEntry) {
if (storageEntry == null || !storageEntry.isVolumeRecordMissed()) {
return;
}
final Bundle args = new Bundle();
args.putString(VolumeRecord.EXTRA_FS_UUID, storageEntry.getFsUuid());
new SubSettingLauncher(context).setDestination(PrivateVolumeForget.class.getCanonicalName()).setTitleRes(R.string.storage_menu_forget).setSourceMetricsCategory(SettingsEnums.SETTINGS_STORAGE_CATEGORY).setArguments(args).launch();
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class AccessibilitySettingsForSetupWizardActivity method tryLaunchFontSizeSettings.
@VisibleForTesting
void tryLaunchFontSizeSettings() {
if (WizardManagerHelper.isAnySetupWizard(getIntent()) && new ComponentName(getPackageName(), CLASS_NAME_FONT_SIZE_SETTINGS_FOR_SUW).equals(getIntent().getComponent())) {
final Bundle args = new Bundle();
args.putInt(HelpResourceProvider.HELP_URI_RESOURCE_KEY, 0);
args.putBoolean(SearchMenuController.NEED_SEARCH_ICON_IN_ACTION_BAR, false);
final SubSettingLauncher subSettingLauncher = new SubSettingLauncher(this).setDestination(FontSizePreferenceFragmentForSetupWizard.class.getName()).setArguments(args).setSourceMetricsCategory(Instrumentable.METRICS_CATEGORY_UNKNOWN).setExtras(SetupWizardUtils.copyLifecycleExtra(getIntent().getExtras(), new Bundle())).setTransitionType(SettingsTransitionHelper.TransitionType.TRANSITION_FADE);
Log.d(LOG_TAG, "Launch font size settings");
subSettingLauncher.launch();
finish();
}
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class AccessibilitySettingsForSetupWizardActivity method onPreferenceStartFragment.
@Override
public boolean onPreferenceStartFragment(PreferenceFragmentCompat caller, Preference pref) {
Bundle args = pref.getExtras();
if (args == null) {
args = new Bundle();
}
args.putInt(HelpResourceProvider.HELP_URI_RESOURCE_KEY, 0);
args.putBoolean(SearchMenuController.NEED_SEARCH_ICON_IN_ACTION_BAR, false);
new SubSettingLauncher(this).setDestination(pref.getFragment()).setArguments(args).setSourceMetricsCategory(caller instanceof Instrumentable ? ((Instrumentable) caller).getMetricsCategory() : Instrumentable.METRICS_CATEGORY_UNKNOWN).setExtras(SetupWizardUtils.copyLifecycleExtra(getIntent().getExtras(), new Bundle())).setTransitionType(SettingsTransitionHelper.TransitionType.TRANSITION_FADE).launch();
return true;
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class AccessibilityDialogUtils method getCustomizeAccessibilityButtonLink.
private static CharSequence getCustomizeAccessibilityButtonLink(Context context) {
final View.OnClickListener linkListener = v -> new SubSettingLauncher(context).setDestination(AccessibilityButtonFragment.class.getName()).setSourceMetricsCategory(SettingsEnums.SWITCH_SHORTCUT_DIALOG_ACCESSIBILITY_BUTTON_SETTINGS).launch();
final AnnotationSpan.LinkInfo linkInfo = new AnnotationSpan.LinkInfo(AnnotationSpan.LinkInfo.DEFAULT_ANNOTATION, linkListener);
return AnnotationSpan.linkify(context.getText(R.string.accessibility_shortcut_edit_dialog_summary_software_floating), linkInfo);
}
Aggregations