Search in sources :

Example 91 with SettingsActivity

use of com.android.settings.SettingsActivity in project android_packages_apps_Settings by crdroidandroid.

the class BluetoothSettings method setOffMessage.

private void setOffMessage() {
    final TextView emptyView = getEmptyTextView();
    if (emptyView == null) {
        return;
    }
    final CharSequence briefText = getText(R.string.bluetooth_empty_list_bluetooth_off);
    final ContentResolver resolver = getActivity().getContentResolver();
    final boolean bleScanningMode = Settings.Global.getInt(resolver, Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, 0) == 1;
    if (!bleScanningMode) {
        // Show only the brief text if the scanning mode has been turned off.
        emptyView.setText(briefText, TextView.BufferType.SPANNABLE);
    } else {
        final StringBuilder contentBuilder = new StringBuilder();
        contentBuilder.append(briefText);
        contentBuilder.append("\n\n");
        contentBuilder.append(getText(R.string.ble_scan_notify_text));
        LinkifyUtils.linkify(emptyView, contentBuilder, new LinkifyUtils.OnClickListener() {

            @Override
            public void onClick() {
                final SettingsActivity activity = (SettingsActivity) BluetoothSettings.this.getActivity();
                activity.startPreferencePanel(BluetoothSettings.this, ScanningSettings.class.getName(), null, R.string.location_scanning_screen_title, null, null, 0);
            }
        });
    }
    setTextSpan(emptyView.getText(), briefText);
}
Also used : LinkifyUtils(com.android.settings.LinkifyUtils) TextView(android.widget.TextView) SettingsActivity(com.android.settings.SettingsActivity) ContentResolver(android.content.ContentResolver)

Example 92 with SettingsActivity

use of com.android.settings.SettingsActivity in project android_packages_apps_Settings by crdroidandroid.

the class BluetoothSettings method getPreferenceControllers.

@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    final Lifecycle lifecycle = getLifecycle();
    mDeviceNamePrefController = new BluetoothDeviceNamePreferenceController(context, lifecycle);
    mPairingPrefController = new BluetoothPairingPreferenceController(context, this, (SettingsActivity) getActivity());
    controllers.add(mDeviceNamePrefController);
    controllers.add(mPairingPrefController);
    controllers.add(new BluetoothFilesPreferenceController(context));
    controllers.add(new BluetoothDeviceRenamePreferenceController(context, this, lifecycle));
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) ArrayList(java.util.ArrayList) SettingsActivity(com.android.settings.SettingsActivity)

Example 93 with SettingsActivity

use of com.android.settings.SettingsActivity in project platform_packages_apps_Settings by BlissRoms.

the class RunningProcessesView method startServiceDetailsActivity.

// utility method used to start sub activity
private void startServiceDetailsActivity(RunningState.MergedItem mi) {
    if (mOwner != null && mi != null) {
        // start new fragment to display extended information
        Bundle args = new Bundle();
        if (mi.mProcess != null) {
            args.putInt(RunningServiceDetails.KEY_UID, mi.mProcess.mUid);
            args.putString(RunningServiceDetails.KEY_PROCESS, mi.mProcess.mProcessName);
        }
        args.putInt(RunningServiceDetails.KEY_USER_ID, mi.mUserId);
        args.putBoolean(RunningServiceDetails.KEY_BACKGROUND, mAdapter.mShowBackground);
        SettingsActivity sa = (SettingsActivity) mOwner.getActivity();
        sa.startPreferencePanel(mOwner, RunningServiceDetails.class.getName(), args, R.string.runningservicedetails_settings_title, null, null, 0);
    }
}
Also used : Bundle(android.os.Bundle) SettingsActivity(com.android.settings.SettingsActivity)

Example 94 with SettingsActivity

use of com.android.settings.SettingsActivity in project platform_packages_apps_Settings by BlissRoms.

the class InstalledAppDetails method startAppInfoFragment.

public static void startAppInfoFragment(Class<?> fragment, CharSequence title, SettingsPreferenceFragment caller, AppEntry appEntry) {
    // start new fragment to display extended information
    Bundle args = new Bundle();
    args.putString(ARG_PACKAGE_NAME, appEntry.info.packageName);
    args.putInt(ARG_PACKAGE_UID, appEntry.info.uid);
    SettingsActivity sa = (SettingsActivity) caller.getActivity();
    sa.startPreferencePanel(caller, fragment.getName(), args, -1, title, caller, SUB_INFO_FRAGMENT);
}
Also used : Bundle(android.os.Bundle) SettingsActivity(com.android.settings.SettingsActivity)

Example 95 with SettingsActivity

use of com.android.settings.SettingsActivity in project platform_packages_apps_Settings by BlissRoms.

the class AppOpsDetails method setIntentAndFinish.

private void setIntentAndFinish(boolean finish, boolean appChanged) {
    Intent intent = new Intent();
    intent.putExtra(ManageApplications.APP_CHG, appChanged);
    SettingsActivity sa = (SettingsActivity) getActivity();
    sa.finishPreferencePanel(this, Activity.RESULT_OK, intent);
}
Also used : Intent(android.content.Intent) SettingsActivity(com.android.settings.SettingsActivity)

Aggregations

SettingsActivity (com.android.settings.SettingsActivity)246 Bundle (android.os.Bundle)71 Intent (android.content.Intent)37 ArrayList (java.util.ArrayList)27 Preference (android.support.v7.preference.Preference)25 AnomalySummaryPreferenceController (com.android.settings.fuelgauge.anomaly.AnomalySummaryPreferenceController)18 SwitchBarController (com.android.settings.widget.SwitchBarController)16 ContentResolver (android.content.ContentResolver)15 TextView (android.widget.TextView)15 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)15 Test (org.junit.Test)15 Context (android.content.Context)14 View (android.view.View)14 LinkifyUtils (com.android.settings.LinkifyUtils)14 RemoteException (android.os.RemoteException)13 EngineInfo (android.speech.tts.TextToSpeech.EngineInfo)13 PreferenceScreen (android.support.v7.preference.PreferenceScreen)13 RecyclerView (android.support.v7.widget.RecyclerView)12 LayoutPreference (com.android.settings.applications.LayoutPreference)12 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)11