Migrate materialColor* attributes into colors

The new color were already introduces in a previous CL ag/30322786

This CL is about replacing the attribute usage by the new color resources, which should work the same but cannot be overwritten, or styled, guaranteeing consistency across the OS.

The old attributes will be removed in CL: ag/29910036

Bug: 374273611
Test: presubmit
Flag: EXEMPT Un-flaggable refactor of private color resources
Change-Id: I05b5261054bcb6de40e4e40d633025495f3dd01f
This commit is contained in:
Marcelo Arteiro
2024-10-18 11:51:49 +00:00
parent cfd023dc1f
commit 8577c10535
63 changed files with 125 additions and 127 deletions

View File

@@ -316,7 +316,6 @@ public class ModifierKeysPickerDialogFragment extends DialogFragment {
}
private int getColorOfMaterialColorPrimary() {
return Utils.getColorAttrDefaultColor(
mActivity, com.android.internal.R.attr.materialColorPrimary);
return mActivity.getColor(com.android.internal.R.color.materialColorPrimary);
}
}

View File

@@ -36,7 +36,6 @@ import androidx.preference.PreferenceScreen;
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.Utils;
import com.android.settingslib.widget.LayoutPreference;
import java.util.ArrayList;
@@ -202,8 +201,7 @@ public class ModifierKeysPreferenceController extends BasePreferenceController {
}
private int getColorOfMaterialColorPrimary() {
return Utils.getColorAttrDefaultColor(
mContext, com.android.internal.R.attr.materialColorPrimary);
return mContext.getColor(com.android.internal.R.color.materialColorPrimary);
}
private static boolean isCtrl(int keyCode) {

View File

@@ -28,7 +28,6 @@ import androidx.preference.PreferenceScreen;
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settingslib.Utils;
public class ModifierKeysRestorePreferenceController extends BasePreferenceController {
@@ -88,7 +87,6 @@ public class ModifierKeysRestorePreferenceController extends BasePreferenceContr
}
private int getColorOfMaterialColorPrimary() {
return Utils.getColorAttrDefaultColor(
mParent.getActivity(), com.android.internal.R.attr.materialColorPrimary);
return mParent.getActivity().getColor(com.android.internal.R.color.materialColorPrimary);
}
}