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;
}
}
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);
}
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);
}
}
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;
}
}
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;
}
Aggregations