Loading packages/SettingsLib/Tile/src/com/android/settingslib/drawer/Tile.java +11 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ import android.os.UserHandle; import android.text.TextUtils; import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import java.util.ArrayList; Loading Loading @@ -326,6 +328,15 @@ public abstract class Tile implements Parcelable { return false; } /** Returns the icon color scheme. */ @Nullable public String getIconColorScheme(@NonNull Context context) { ensureMetadataNotStale(context); return mMetaData != null ? mMetaData.getString(TileUtils.META_DATA_PREFERENCE_ICON_COLOR_SCHEME, null) : null; } /** Whether the {@link Activity} should be launched in a separate task. */ public boolean isNewTask() { if (mMetaData != null && mMetaData.containsKey(META_DATA_NEW_TASK)) { Loading packages/SettingsLib/Tile/src/com/android/settingslib/drawer/TileUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,13 @@ public class TileUtils { */ public static final String META_DATA_PREFERENCE_ICON = "com.android.settings.icon"; /** * Name of the meta-data item that should be set in the AndroidManifest.xml to specify the icon * color scheme. Only available for preferences on the homepage. */ public static final String META_DATA_PREFERENCE_ICON_COLOR_SCHEME = "com.android.settings.icon_color_scheme"; /** * Name of the meta-data item that should be set in the AndroidManifest.xml * to specify the icon background color. The value may or may not be used by Settings app. Loading Loading
packages/SettingsLib/Tile/src/com/android/settingslib/drawer/Tile.java +11 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ import android.os.UserHandle; import android.text.TextUtils; import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import java.util.ArrayList; Loading Loading @@ -326,6 +328,15 @@ public abstract class Tile implements Parcelable { return false; } /** Returns the icon color scheme. */ @Nullable public String getIconColorScheme(@NonNull Context context) { ensureMetadataNotStale(context); return mMetaData != null ? mMetaData.getString(TileUtils.META_DATA_PREFERENCE_ICON_COLOR_SCHEME, null) : null; } /** Whether the {@link Activity} should be launched in a separate task. */ public boolean isNewTask() { if (mMetaData != null && mMetaData.containsKey(META_DATA_NEW_TASK)) { Loading
packages/SettingsLib/Tile/src/com/android/settingslib/drawer/TileUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,13 @@ public class TileUtils { */ public static final String META_DATA_PREFERENCE_ICON = "com.android.settings.icon"; /** * Name of the meta-data item that should be set in the AndroidManifest.xml to specify the icon * color scheme. Only available for preferences on the homepage. */ public static final String META_DATA_PREFERENCE_ICON_COLOR_SCHEME = "com.android.settings.icon_color_scheme"; /** * Name of the meta-data item that should be set in the AndroidManifest.xml * to specify the icon background color. The value may or may not be used by Settings app. Loading