Merge "Font size page support light theme in deferred setup" into qt-dev
This commit is contained in:
@@ -37,8 +37,11 @@ import android.widget.Toolbar;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SubSettings;
|
||||
import com.android.settings.dashboard.CategoryManager;
|
||||
|
||||
import com.google.android.setupcompat.util.WizardManagerHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -65,6 +68,10 @@ public class SettingsBaseActivity extends FragmentActivity {
|
||||
if (!theme.getBoolean(android.R.styleable.Theme_windowNoTitle, false)) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
}
|
||||
// Apply SetupWizard light theme during setup flow. This is for SubSettings pages.
|
||||
if (WizardManagerHelper.isAnySetupWizard(getIntent()) && this instanceof SubSettings) {
|
||||
setTheme(R.style.LightTheme_SubSettings_SetupWizard);
|
||||
}
|
||||
super.setContentView(R.layout.settings_base_layout);
|
||||
final View decorView = getWindow().getDecorView();
|
||||
|
||||
|
@@ -19,6 +19,7 @@ package com.android.settings.core;
|
||||
import android.annotation.StringRes;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.text.TextUtils;
|
||||
@@ -89,6 +90,11 @@ public class SubSettingLauncher {
|
||||
return this;
|
||||
}
|
||||
|
||||
public SubSettingLauncher setExtras(Bundle extras) {
|
||||
mLaunchRequest.extras = extras;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SubSettingLauncher setSourceMetricsCategory(int sourceMetricsCategory) {
|
||||
mLaunchRequest.sourceMetricsCategory = sourceMetricsCategory;
|
||||
return this;
|
||||
@@ -136,6 +142,7 @@ public class SubSettingLauncher {
|
||||
|
||||
public Intent toIntent() {
|
||||
final Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
copyExtras(intent);
|
||||
intent.setClass(mContext, SubSettings.class);
|
||||
if (TextUtils.isEmpty(mLaunchRequest.destinationName)) {
|
||||
throw new IllegalArgumentException("Destination fragment must be set");
|
||||
@@ -180,6 +187,11 @@ public class SubSettingLauncher {
|
||||
listener.startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
private void copyExtras(Intent intent) {
|
||||
if (mLaunchRequest.extras != null) {
|
||||
intent.replaceExtras(mLaunchRequest.extras);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Simple container that has information about how to launch a subsetting.
|
||||
*/
|
||||
@@ -194,5 +206,6 @@ public class SubSettingLauncher {
|
||||
int mRequestCode;
|
||||
UserHandle userHandle;
|
||||
Bundle arguments;
|
||||
Bundle extras;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user