Rearrange System settings

- Fork system_dashboard_fragment_v2 for dev.
- Reorder the preference
- Remove summary

Bug: 174965365
Test: manual & robotest
Change-Id: Icc994f3b2e38ad54958deb5c9f80b6cd085029f0
This commit is contained in:
Edgar Wang
2021-01-29 03:01:28 +08:00
parent 3b414eb10b
commit bd0dd5d886
5 changed files with 99 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
import android.util.FeatureFlagUtils;
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
@@ -26,10 +27,10 @@ import androidx.preference.PreferenceGroup;
import androidx.preference.PreferenceScreen;
import com.android.settings.R;
import com.android.settings.core.FeatureFlags;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.Indexable;
import com.android.settingslib.search.SearchIndexable;
import java.util.Arrays;
@@ -40,8 +41,6 @@ public class SystemDashboardFragment extends DashboardFragment {
private static final String TAG = "SystemDashboardFrag";
private static final String KEY_RESET = "reset_dashboard";
public static final String EXTRA_SHOW_AWARE_DISABLED = "show_aware_dialog_disabled";
@Override
@@ -78,6 +77,9 @@ public class SystemDashboardFragment extends DashboardFragment {
@Override
protected int getPreferenceScreenResId() {
if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.SILKY_HOME)) {
return R.xml.system_dashboard_fragment_v2;
}
return R.xml.system_dashboard_fragment;
}
@@ -108,7 +110,8 @@ public class SystemDashboardFragment extends DashboardFragment {
public List<SearchIndexableResource> getXmlResourcesToIndex(
Context context, boolean enabled) {
final SearchIndexableResource sir = new SearchIndexableResource(context);
sir.xmlResId = R.xml.system_dashboard_fragment;
sir.xmlResId = FeatureFlagUtils.isEnabled(context, FeatureFlags.SILKY_HOME)
? R.xml.system_dashboard_fragment_v2 : R.xml.system_dashboard_fragment;
return Arrays.asList(sir);
}
};