Search in sources :

Example 96 with Activity

use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SettingsPreferenceFragment method startFragment.

public boolean startFragment(Fragment caller, String fragmentClass, int titleRes, int requestCode, Bundle extras) {
    final Activity activity = getActivity();
    if (activity instanceof SettingsActivity) {
        SettingsActivity sa = (SettingsActivity) activity;
        sa.startPreferencePanel(fragmentClass, extras, titleRes, null, caller, requestCode);
        return true;
    } else {
        Log.w(TAG, "Parent isn't SettingsActivity nor PreferenceActivity, thus there's no way to " + "launch the given Fragment (name: " + fragmentClass + ", requestCode: " + requestCode + ")");
        return false;
    }
}
Also used : Activity(android.app.Activity)

Example 97 with Activity

use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ApnSettings method onCreate.

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    final Activity activity = getActivity();
    final int subId = activity.getIntent().getIntExtra(SUB_ID, SubscriptionManager.INVALID_SUBSCRIPTION_ID);
    fillOperatorIccidset();
    Log.d(TAG, "onCreate: subId = " + subId);
    mMobileStateFilter = new IntentFilter(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
    setIfOnlyAvailableForAdmins(true);
    mSubscriptionInfo = SubscriptionManager.from(activity).getActiveSubscriptionInfo(subId);
    mUiccController = UiccController.getInstance();
    CarrierConfigManager configManager = (CarrierConfigManager) getSystemService(Context.CARRIER_CONFIG_SERVICE);
    PersistableBundle b = configManager.getConfig();
    mHideImsApn = b.getBoolean(CarrierConfigManager.KEY_HIDE_IMS_APN_BOOL);
    mAllowAddingApns = b.getBoolean(CarrierConfigManager.KEY_ALLOW_ADDING_APNS_BOOL);
    mUserManager = UserManager.get(activity);
}
Also used : CarrierConfigManager(android.telephony.CarrierConfigManager) IntentFilter(android.content.IntentFilter) PersistableBundle(android.os.PersistableBundle) Activity(android.app.Activity)

Example 98 with Activity

use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class BluetoothSettings method resetBarSize.

private void resetBarSize(float titleTextSize, int actionBarHeight, int switchBarHeight) {
    Activity activity = getActivity();
    DisplayMetrics displayMetrics = Resources.getSystem().getDisplayMetrics();
    int titleId = Resources.getSystem().getIdentifier("action_bar", "id", "android");
    Toolbar toolbar = (Toolbar) activity.getWindow().findViewById(titleId);
    TextView title = null;
    if (toolbar != null) {
        LayoutParams layoutParams = toolbar.getLayoutParams();
        layoutParams.height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, actionBarHeight, displayMetrics);
        for (int i = 0; i < toolbar.getChildCount(); ++i) {
            if (toolbar.getChildAt(i) instanceof TextView) {
                title = (TextView) toolbar.getChildAt(i);
            }
            Toolbar.LayoutParams childLayoutParams = (Toolbar.LayoutParams) toolbar.getChildAt(i).getLayoutParams();
            childLayoutParams.gravity = Gravity.CENTER_VERTICAL;
        }
    }
    if (title != null)
        title.setTextSize(TypedValue.COMPLEX_UNIT_DIP, titleTextSize);
    if (mSwitchBar != null) {
        LayoutParams layoutParams = mSwitchBar.getLayoutParams();
        layoutParams.height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, switchBarHeight, displayMetrics);
    }
}
Also used : LayoutParams(android.view.ViewGroup.LayoutParams) SettingsActivity(com.android.settings.SettingsActivity) Activity(android.app.Activity) TextView(android.widget.TextView) DisplayMetrics(android.util.DisplayMetrics) Toolbar(android.widget.Toolbar)

Example 99 with Activity

use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SetupSkipDialog method onClick.

@Override
public void onClick(DialogInterface dialog, int button) {
    switch(button) {
        case DialogInterface.BUTTON_POSITIVE:
            Activity activity = getActivity();
            activity.setResult(RESULT_SKIP);
            activity.finish();
            break;
    }
}
Also used : Activity(android.app.Activity)

Example 100 with Activity

use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DevelopmentSettings method onPreferenceClick.

@Override
public boolean onPreferenceClick(Preference preference) {
    if (preference == mRootAppops) {
        Activity mActivity = getActivity();
        Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.putExtra("appops_tab", getString(R.string.app_ops_categories_su));
        intent.setClass(mActivity, AppOpsSummaryActivity.class);
        mActivity.startActivity(intent);
        return true;
    }
    if (preference == mWindowAnimationScale || preference == mTransitionAnimationScale || preference == mAnimatorDurationScale) {
        ((AnimationScalePreference) preference).click();
    }
    return false;
}
Also used : AppOpsSummaryActivity(com.android.settings.Settings.AppOpsSummaryActivity) Activity(android.app.Activity) Intent(android.content.Intent)

Aggregations

Activity (android.app.Activity)3220 Intent (android.content.Intent)612 View (android.view.View)535 Test (org.junit.Test)456 TextView (android.widget.TextView)263 Context (android.content.Context)220 ArrayList (java.util.ArrayList)201 Bundle (android.os.Bundle)197 DialogInterface (android.content.DialogInterface)167 SettingsActivity (com.android.settings.SettingsActivity)167 ViewGroup (android.view.ViewGroup)133 ImageView (android.widget.ImageView)116 AlertDialog (android.app.AlertDialog)109 LayoutInflater (android.view.LayoutInflater)109 Preference (android.support.v7.preference.Preference)83 PackageManager (android.content.pm.PackageManager)76 Uri (android.net.Uri)76 EditText (android.widget.EditText)72 ComponentName (android.content.ComponentName)71 Handler (android.os.Handler)71