Search in sources :

Example 86 with SettingsActivity

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

the class BluetoothDeviceDetailsRotationTest method rotation.

@Test
public void rotation() {
    Intent intent = new Intent("android.settings.BLUETOOTH_SETTINGS");
    SettingsActivity activity = (SettingsActivity) mInstrumentation.startActivitySync(intent);
    Bundle args = new Bundle(1);
    args.putString(BluetoothDeviceDetailsFragment.KEY_DEVICE_ADDRESS, mDeviceAddress);
    activity.startPreferencePanel(null, BluetoothDeviceDetailsFragment.class.getName(), args, 0, null, null, 0);
    try {
        mUiDevice.setOrientationLeft();
        mUiDevice.setOrientationNatural();
        mUiDevice.setOrientationRight();
        mUiDevice.setOrientationNatural();
    } catch (RemoteException e) {
        throw new RuntimeException(e);
    }
}
Also used : Bundle(android.os.Bundle) Intent(android.content.Intent) RemoteException(android.os.RemoteException) SettingsActivity(com.android.settings.SettingsActivity) Test(org.junit.Test) SmallTest(android.support.test.filters.SmallTest)

Example 87 with SettingsActivity

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

the class ToggleFeaturePreferenceFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    SettingsActivity activity = (SettingsActivity) getActivity();
    mSwitchBar = activity.getSwitchBar();
    mToggleSwitch = mSwitchBar.getSwitch();
    onProcessArguments(getArguments());
    // Show the "Settings" menu as if it were a preference screen
    if (mSettingsTitle != null && mSettingsIntent != null) {
        PreferenceScreen preferenceScreen = getPreferenceScreen();
        Preference settingsPref = new Preference(preferenceScreen.getContext());
        settingsPref.setTitle(mSettingsTitle);
        settingsPref.setIconSpaceReserved(true);
        settingsPref.setIntent(mSettingsIntent);
        preferenceScreen.addPreference(settingsPref);
    }
}
Also used : PreferenceScreen(android.support.v7.preference.PreferenceScreen) Preference(android.support.v7.preference.Preference) SettingsActivity(com.android.settings.SettingsActivity)

Example 88 with SettingsActivity

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

the class AccountPreferenceController method onPreferenceClick.

@Override
public boolean onPreferenceClick(Preference preference) {
    // Check the preference
    final int count = mProfiles.size();
    for (int i = 0; i < count; i++) {
        ProfileData profileData = mProfiles.valueAt(i);
        if (preference == profileData.addAccountPreference) {
            Intent intent = new Intent(ACTION_ADD_ACCOUNT);
            intent.putExtra(EXTRA_USER, profileData.userInfo.getUserHandle());
            intent.putExtra(EXTRA_AUTHORITIES, mAuthorities);
            mContext.startActivity(intent);
            return true;
        }
        if (preference == profileData.removeWorkProfilePreference) {
            final int userId = profileData.userInfo.id;
            RemoveUserFragment.newInstance(userId).show(mParent.getFragmentManager(), "removeUser");
            return true;
        }
        if (preference == profileData.managedProfilePreference) {
            Bundle arguments = new Bundle();
            arguments.putParcelable(Intent.EXTRA_USER, profileData.userInfo.getUserHandle());
            ((SettingsActivity) mParent.getActivity()).startPreferencePanel(mParent, ManagedProfileSettings.class.getName(), arguments, R.string.managed_profile_settings_title, null, null, 0);
            return true;
        }
    }
    return false;
}
Also used : Bundle(android.os.Bundle) Intent(android.content.Intent) SettingsActivity(com.android.settings.SettingsActivity)

Example 89 with SettingsActivity

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

the class CaptionPropertiesFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    final boolean enabled = mCaptioningManager.isEnabled();
    SettingsActivity activity = (SettingsActivity) getActivity();
    mSwitchBar = activity.getSwitchBar();
    mSwitchBar.setCheckedInternal(enabled);
    mToggleSwitch = mSwitchBar.getSwitch();
    getPreferenceScreen().setEnabled(enabled);
    refreshPreviewText();
    installSwitchBarToggleSwitch();
}
Also used : SettingsActivity(com.android.settings.SettingsActivity)

Example 90 with SettingsActivity

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

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