OmniControl: Drop our overlay style feature
Swithced to AOSP ThemePicker
Change-Id: I4d3f2803328881ef503804dbfe64e56f6908160e
Signed-off-by: micky387 <mickaelsaibi@free.fr>
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a17efa3..cd5a37c 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -6,17 +6,11 @@
android:versionName="1.0">
<uses-permission
- android:name="android.permission.QUERY_ALL_PACKAGES"
- tools:ignore="QueryAllPackagesPermission" />
- <uses-permission
android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<uses-permission
android:name="android.permission.WRITE_SECURE_SETTINGS"
tools:ignore="ProtectedPermissions" />
- <uses-permission
- android:name="android.permission.CHANGE_OVERLAY_PACKAGES"
- tools:ignore="ProtectedPermissions" />
<!-- Devices running Android 13 (API level 33) or higher -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
diff --git a/app/src/main/java/org/omnirom/control/GridViewFragment.kt b/app/src/main/java/org/omnirom/control/GridViewFragment.kt
index 8aea5ed..5914e60 100644
--- a/app/src/main/java/org/omnirom/control/GridViewFragment.kt
+++ b/app/src/main/java/org/omnirom/control/GridViewFragment.kt
@@ -149,14 +149,6 @@
)
gridItems.add(
FragmentGridItem(
- R.string.overlays_settings_title,
- R.string.overlays_settings_summary,
- R.drawable.ic_settings_overlays,
- OverlaysFragment()
- )
- )
- gridItems.add(
- FragmentGridItem(
R.string.qs_settings_title,
R.string.qs_settings_summary,
R.drawable.ic_qs_tile,
diff --git a/app/src/main/java/org/omnirom/control/OverlaysFragment.kt b/app/src/main/java/org/omnirom/control/OverlaysFragment.kt
deleted file mode 100644
index a13b44c..0000000
--- a/app/src/main/java/org/omnirom/control/OverlaysFragment.kt
+++ /dev/null
@@ -1,864 +0,0 @@
-/*
- * Copyright (C) 2021 The OmniROM Project
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.omnirom.control
-
-import android.app.Activity
-import android.content.Context
-import android.content.Intent
-import android.content.res.Resources.NotFoundException
-import android.graphics.Bitmap
-import android.graphics.Canvas
-import android.graphics.Color
-import android.graphics.Path
-import android.graphics.drawable.AdaptiveIconDrawable
-import android.graphics.drawable.ColorDrawable
-import android.graphics.drawable.Drawable
-import android.graphics.drawable.ShapeDrawable
-import android.graphics.drawable.shapes.PathShape
-import android.net.Uri
-import android.os.AsyncTask
-import android.os.Bundle
-import android.provider.MediaStore
-import android.provider.Settings
-import android.view.*
-import android.widget.ImageView
-import android.widget.LinearLayout
-import android.widget.Switch
-import androidx.activity.result.ActivityResult
-import androidx.activity.result.ActivityResultCallback
-import androidx.activity.result.ActivityResultLauncher
-import androidx.activity.result.contract.ActivityResultContract
-import androidx.activity.result.contract.ActivityResultContracts
-import androidx.appcompat.app.AlertDialog
-import androidx.appcompat.app.AppCompatActivity
-import androidx.core.graphics.PathParser
-import androidx.fragment.app.Fragment
-import androidx.recyclerview.widget.LinearLayoutManager
-import androidx.recyclerview.widget.RecyclerView
-import com.google.android.material.snackbar.Snackbar
-import org.json.JSONArray
-import org.json.JSONObject
-import org.omnirom.omnilib.utils.OmniSettings
-import org.omnirom.control.widget.DynamicAdaptiveIconDrawable
-import java.io.IOException
-
-
-class OverlaysFragment : Fragment() {
- private lateinit var overlayProvider: OverlaysProvider
- private lateinit var iconShapeListView: RecyclerView
- private lateinit var primaryColorsListView: RecyclerView
- private lateinit var accentColorsListView: RecyclerView
- private lateinit var overlayItemListView: RecyclerView
-
- private val iconShapeGridItems = ArrayList<IconShapeGridItem>()
- private val primaryColorsGridItems = ArrayList<ColorsGridItem>()
- private val accentColorsGridItems = ArrayList<AccentColorsGridItem>()
- private val overlayItemList = ArrayList<View>()
- private val customAccentColors = ArrayList<CustomAccentColor>()
-
- private val TAG = "OverlaysFragment"
-
- val COLORS_NEUTRAL1 = arrayOf(
- "system_neutral1_50",
- "system_neutral1_100",
- "system_neutral1_200",
- "system_neutral1_300",
- "system_neutral1_400",
- "system_neutral1_500",
- "system_neutral1_600",
- "system_neutral1_700",
- "system_neutral1_800",
- "system_neutral1_900"
- )
-
- val COLORS_ACCENT1 = arrayOf(
- "system_accent1_100",
- "system_accent1_600"
- )
-
- abstract class GridItem(
- packageName: String,
- isEnabled: Boolean,
- isSystem: Boolean,
- category: String
- ) {
- val packageName: String = packageName
- val isEnabled: Boolean = isEnabled
- val isSystem: Boolean = isSystem
- val category: String = category
- }
-
- class IconShapeGridItem(
- packageName: String,
- iconShape: String,
- isEnabled: Boolean,
- isSystem: Boolean,
- category: String
- ) : GridItem(packageName, isEnabled, isSystem, category) {
- val iconShape: String = iconShape
- }
-
- open class ColorsGridItem(
- packageName: String,
- colorList: ArrayList<Int>,
- isEnabled: Boolean,
- isSystem: Boolean,
- category: String
- ) : GridItem(packageName, isEnabled, isSystem, category) {
- val colorList: ArrayList<Int> = colorList
- }
-
- open class AccentColorsGridItem(
- packageName: String,
- colorList: ArrayList<Int>,
- isEnabled: Boolean,
- isSystem: Boolean,
- category: String
- ) : ColorsGridItem(packageName, colorList, isEnabled, isSystem, category) {
- }
-
- class FabricatedAccentColorsGridItem(
- packageName: String,
- colorList: ArrayList<Int>,
- isEnabled: Boolean,
- isSystem: Boolean,
- category: String,
- customAccentColor: CustomAccentColor
- ) : AccentColorsGridItem(packageName, colorList, isEnabled, isSystem, category) {
- val customAccentColor = customAccentColor
- }
-
- class AddAccentColorsGridItem(
- ) : AccentColorsGridItem("", ArrayList(), false, false, "") {
- }
-
- class CustomAccentColor(var identifier: String, var darkColor: Int, var lightColor: Int) {
- fun toJSONObject(): JSONObject {
- val color = JSONObject()
- color.put("identifier", identifier)
- color.put("system_accent1_100", darkColor)
- color.put("system_accent1_600", lightColor)
- return color
- }
- }
-
- inner class IconShapeListViewAdapter(
- val context: Context,
- val gridItems: ArrayList<IconShapeGridItem>
- ) :
- RecyclerView.Adapter<RecyclerView.ViewHolder>() {
- private val iconShapeSize = context.resources.getDimensionPixelSize(R.dimen.icon_shape_size)
- private val PATH_SIZE = 100f
-
- inner class IconShapeListItem(view: View) : RecyclerView.ViewHolder(view) {
- val shapeImage: ImageView = view.findViewById(R.id.icon_shape_icon)!!
- val enabledImage: ImageView = view.findViewById(R.id.icon_shape_icon_enabled)!!
-
- }
-
- override fun getItemCount(): Int {
- return gridItems.size
- }
-
- override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
- return IconShapeListItem(
- LayoutInflater.from(context).inflate(R.layout.icon_shape_item, parent, false)
- )
- }
-
- override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
- if (holder is IconShapeListItem) {
- val gridItem: IconShapeGridItem = gridItems[position]
- holder.shapeImage.setImageDrawable(
- createShapeIconDrawable(
- PathParser.createPathFromPathData(
- gridItem.iconShape
- ), context.resources.getDrawable(R.mipmap.ic_launcher, null)
- )
- )
- if (gridItem.isEnabled || (gridItem.isSystem && !isOverlayEnabled())) {
- holder.enabledImage.visibility =
- View.VISIBLE
- } else {
- holder.enabledImage.visibility =
- View.GONE
- }
- holder.itemView.setOnClickListener {
- if (gridItem.isSystem) {
- overlayProvider.disableAllInCategory(gridItem.category)
- overlayProvider.saveIconShapeOverlayToSettings("")
- } else if (!gridItem.isEnabled) {
- overlayProvider.enableOverlayExclusive(gridItem.packageName)
- overlayProvider.saveIconShapeOverlayToSettings(gridItem.packageName)
- }
- loadIconShapeOverlays()
- notifyDataSetChanged()
- }
- }
- }
-
- private fun createShapeDrawable(path: Path): ShapeDrawable {
- val shape = PathShape(path, PATH_SIZE, PATH_SIZE)
- val shapeDrawable = ShapeDrawable(shape)
- shapeDrawable.intrinsicHeight = iconShapeSize
- shapeDrawable.intrinsicWidth = iconShapeSize
- return shapeDrawable
- }
-
- private fun createShapeIconDrawable(path: Path, appIcon: Drawable): Drawable {
- if (appIcon is AdaptiveIconDrawable) {
- return DynamicAdaptiveIconDrawable(
- appIcon.background,
- appIcon.foreground, path
- )
- }
- return createShapeDrawable(path)
- }
-
- private fun isOverlayEnabled(): Boolean {
- return gridItems.any { it.isEnabled }
- }
- }
-
- inner class PrimaryColorsListViewAdapter(
- val context: Context,
- private val gridItems: ArrayList<ColorsGridItem>
- ) :
- RecyclerView.Adapter<RecyclerView.ViewHolder>() {
-
- inner class ColorsListItem(view: View) : RecyclerView.ViewHolder(view) {
- val colorList: LinearLayout = view.findViewById(R.id.colors_item_list)!!
- val enabledImage: ImageView = view.findViewById(R.id.colors_enabled)!!
- }
-
- override fun getItemCount(): Int {
- return gridItems.size
- }
-
- override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
- return ColorsListItem(
- LayoutInflater.from(context).inflate(R.layout.primary_colors_item, parent, false)
- )
- }
-
- override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
- if (holder is ColorsListItem) {
- val gridItem: ColorsGridItem = gridItems[position]
- holder.colorList.removeAllViews()
-
- for (color in gridItem.colorList) {
- val colorItem: ImageView =
- LayoutInflater.from(context).inflate(R.layout.color_item, null) as ImageView
- colorItem.setImageDrawable(createColorDrawable(color))
- holder.colorList.addView(
- colorItem,
- context.resources.getDimensionPixelSize(R.dimen.color_item_width),
- context.resources.getDimensionPixelSize(R.dimen.color_item_height)
- )
- }
-
- if (gridItem.isEnabled || (gridItem.isSystem && !isOverlayEnabled())) {
- holder.enabledImage.visibility =
- View.VISIBLE
- } else {
- holder.enabledImage.visibility =
- View.GONE
- }
- holder.colorList.setOnClickListener {
- if (gridItem.isSystem) {
- overlayProvider.disableAllInCategory(gridItem.category)
- } else if (!gridItem.isEnabled) {
- overlayProvider.enableOverlayExclusive(gridItem.packageName)
- }
- // will trigger onResume()
- //loadPrimaryColorsOverlays()
- //notifyDataSetChanged()
- }
- }
- }
-
- private fun createColorDrawable(color: Int): ColorDrawable {
- return ColorDrawable(color)
- }
-
- private fun isOverlayEnabled(): Boolean {
- return gridItems.any { it.isEnabled }
- }
- }
-
- inner class AccentColorsListViewAdapter(
- val context: Context,
- private val gridItems: ArrayList<AccentColorsGridItem>
- ) :
- RecyclerView.Adapter<RecyclerView.ViewHolder>() {
-
- open inner class AccentColorsListItem(view: View) : RecyclerView.ViewHolder(view) {
- val colorList: LinearLayout = view.findViewById(R.id.colors_item_list)!!
- val enabledImage: ImageView = view.findViewById(R.id.colors_enabled)!!
- }
-
- inner class FabricatedAccentColorsListItem(view: View) : AccentColorsListItem(view) {
- var accentColorDarkBackground: ImageView? = null
- var accentColorLightBackground: ImageView? = null
- }
-
- inner class AddAccentColorsListItem(view: View) : RecyclerView.ViewHolder(view) {
- }
-
- override fun getItemCount(): Int {
- return gridItems.size
- }
-
- override fun getItemViewType(position: Int): Int {
- if (position == gridItems.size - 1)
- return 0
- else if (gridItems[position] is FabricatedAccentColorsGridItem)
- return 1
- return 2
- }
-
- override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
- return if (viewType == 0) {
- AddAccentColorsListItem(
- LayoutInflater.from(context)
- .inflate(R.layout.add_accent_colors_item, parent, false)
- )
- } else if (viewType == 1) {
- FabricatedAccentColorsListItem(
- LayoutInflater.from(context).inflate(R.layout.accent_colors_item, parent, false)
- )
- } else {
- AccentColorsListItem(
- LayoutInflater.from(context).inflate(R.layout.accent_colors_item, parent, false)
- )
- }
- }
-
- override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
- val gridItem: AccentColorsGridItem = gridItems[position]
-
- if (holder is AddAccentColorsListItem) {
- holder.itemView.setOnClickListener {
- addNewCustomAccentColor()
- loadAccentColorsOverlays()
- notifyDataSetChanged()
- }
- } else if (holder is AccentColorsListItem) {
- holder.colorList.removeAllViews()
- if (holder is FabricatedAccentColorsListItem) {
- val v = LayoutInflater.from(context)
- .inflate(R.layout.edit_dark_accent_colors_item, null) as ImageView
- holder.colorList.addView(
- v,
- context.resources.getDimensionPixelSize(R.dimen.color_item_width),
- context.resources.getDimensionPixelSize(R.dimen.edit_accent_color_item_height)
- )
- holder.accentColorDarkBackground = v
- }
- for (color in gridItem.colorList) {
- val colorItem: ImageView =
- LayoutInflater.from(context).inflate(R.layout.color_item, null) as ImageView
- colorItem.setImageDrawable(createColorDrawable(color))
- holder.colorList.addView(
- colorItem,
- context.resources.getDimensionPixelSize(R.dimen.color_item_width),
- context.resources.getDimensionPixelSize(R.dimen.accent_color_item_height)
- )
- }
- if (holder is FabricatedAccentColorsListItem) {
- val v = LayoutInflater.from(context)
- .inflate(R.layout.edit_light_accent_colors_item, null) as ImageView
- holder.colorList.addView(
- v,
- context.resources.getDimensionPixelSize(R.dimen.color_item_width),
- context.resources.getDimensionPixelSize(R.dimen.edit_accent_color_item_height)
- )
- holder.accentColorLightBackground = v
- }
-
- if (gridItem.isEnabled || (gridItem.isSystem && !isOverlayEnabled())) {
- holder.enabledImage.visibility =
- View.VISIBLE
- } else {
- holder.enabledImage.visibility =
- View.GONE
- }
-
- if (holder is FabricatedAccentColorsListItem) {
- holder.colorList.setOnClickListener {
- if (!gridItem.isEnabled) {
- overlayProvider.enableFabricatedAccentOverlayTransaction((gridItem as FabricatedAccentColorsGridItem).customAccentColor)
- }
- }
- //registerForContextMenu(holder.colorList)
- holder.colorList.setOnLongClickListener {
- doDeleteCustomAccentColor(gridItem as FabricatedAccentColorsGridItem)
- true
- }
- if (holder.accentColorDarkBackground != null) {
- holder.accentColorDarkBackground!!.setOnClickListener {
- setCustomAccentColor(gridItem as FabricatedAccentColorsGridItem, true)
- }
- }
- if (holder.accentColorLightBackground != null) {
- holder.accentColorLightBackground!!.setOnClickListener {
- setCustomAccentColor(gridItem as FabricatedAccentColorsGridItem, false)
- }
- }
- } else {
- holder.colorList.setOnClickListener {
- if (gridItem.isSystem) {
- overlayProvider.enableAccentOverlayTransaction(null)
- } else if (!gridItem.isEnabled) {
- overlayProvider.enableAccentOverlayTransaction(gridItem.packageName)
- }
- // will trigger onResume()
- //loadAccentColorsOverlays()
- //notifyDataSetChanged()
- }
- }
- }
- }
-
- private fun createColorDrawable(color: Int): ColorDrawable {
- return ColorDrawable(color)
- }
-
- private fun isOverlayEnabled(): Boolean {
- return gridItems.any { it.isEnabled }
- }
- }
-
- inner class OverlayItemListViewAdapter(
- val context: Context,
- val overlayItems: ArrayList<View>
- ) :
- RecyclerView.Adapter<RecyclerView.ViewHolder>() {
-
- inner class OverlayListItem(view: View) : RecyclerView.ViewHolder(view) {
- }
-
- override fun getItemCount(): Int {
- return overlayItems.size
- }
-
- override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
- return OverlayListItem(overlayItems[0])
- }
-
- override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
- }
- }
-
- private val mBrowseColor: ActivityResultLauncher<Intent> =
- registerForActivityResult<Intent, ActivityResult>(
- ActivityResultContracts.StartActivityForResult(),
- ActivityResultCallback<ActivityResult> { result: ActivityResult ->
- if (result.resultCode == AppCompatActivity.RESULT_OK) {
- val data = result.data
- if (data != null && data.hasExtra(ColorBrowseActivity.DATA_SELECT_COLOR_EXTRA)) {
- val selectedColor =
- data.getIntExtra(ColorBrowseActivity.DATA_SELECT_COLOR_EXTRA, 0)
- if (mChangeColor != null && mChangeAccentColor!= null) {
- if (mChangeDark) mChangeColor!!.darkColor = selectedColor
- else mChangeColor!!.lightColor = selectedColor
- saveCustomAccentColors()
-
- if (mChangeAccentColor!!.isEnabled) {
- overlayProvider.enableFabricatedAccentOverlayTransaction(
- mChangeColor!!
- )
- } else {
- loadAccentColorsOverlays()
- accentColorsListView.adapter!!.notifyDataSetChanged()
- }
- }
- }
- }
- })
-
- private var mChangeAccentColor: FabricatedAccentColorsGridItem? = null
- private var mChangeColor: CustomAccentColor? = null
- private var mChangeDark: Boolean = false
-
- fun getFragmentTitle(): String {
- return resources.getString(R.string.overlays_settings_title)
- }
-
- fun getFragmentSummary(): String {
- return resources.getString(R.string.overlays_settings_summary)
- }
-
- fun getFragmentIcon(): Int {
- return R.drawable.ic_settings_overlays
- }
-
- override fun onResume() {
- super.onResume()
- (activity as SettingsActivity).let {
- it.showToolbar()
- it.updateFragmentTitle(
- getFragmentTitle(),
- getFragmentSummary(),
- getFragmentIcon(),
- false
- )
- }
- }
-
- override fun onCreateView(
- inflater: LayoutInflater,
- container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View? {
- overlayProvider = OverlaysProvider(requireContext())
- overlayProvider.init()
- return inflater.inflate(R.layout.overlays_fragment, container, false)
- }
-
- private fun loadIconShapeOverlays() {
- iconShapeGridItems.clear();
- iconShapeGridItems.add(
- IconShapeGridItem(
- "android",
- overlayProvider.getSystemIconMask(),
- false,
- true,
- overlayProvider.getIconShapeCategory()
- )
- )
- for (packageName in overlayProvider.getIconShapeOverlays().sorted()) {
- try {
- val iconMask = overlayProvider.loadString("config_icon_mask", packageName)
- iconShapeGridItems.add(
- IconShapeGridItem(
- packageName,
- iconMask,
- overlayProvider.isOverlayEnabled(packageName),
- false,
- overlayProvider.getIconShapeCategory()
-
- )
- )
- } catch (e: NotFoundException) {
- }
- }
- }
-
- private fun loadPrimaryColorsOverlays() {
- primaryColorsGridItems.clear();
- val colorList = ArrayList<Int>()
- for (color in COLORS_NEUTRAL1) {
- colorList.add(overlayProvider.getSystemColor(color))
- }
- primaryColorsGridItems.add(
- ColorsGridItem(
- "android",
- colorList,
- false,
- true,
- overlayProvider.getPrimaryColorCategory()
- )
- )
- for (packageName in overlayProvider.getPrimaryColorOverlays().sorted()) {
- try {
- val overlayColorList = ArrayList<Int>()
- for (color in COLORS_NEUTRAL1) {
- overlayColorList.add(overlayProvider.loadColor(color, packageName))
- }
-
- primaryColorsGridItems.add(
- ColorsGridItem(
- packageName,
- overlayColorList,
- overlayProvider.isOverlayEnabled(packageName),
- false,
- overlayProvider.getPrimaryColorCategory()
- )
- )
- } catch (e: NotFoundException) {
- }
- }
- }
-
- private fun loadAccentColorsOverlays() {
- accentColorsGridItems.clear();
- val colorList = ArrayList<Int>()
- for (color in COLORS_ACCENT1) {
- colorList.add(overlayProvider.getSystemColor(color))
- }
- accentColorsGridItems.add(
- AccentColorsGridItem(
- "android",
- colorList,
- false,
- true,
- overlayProvider.getAccentColorCategory()
- )
- )
- for (packageName in overlayProvider.getAccentColorOverlays().sorted()) {
- try {
- val overlayColorList = ArrayList<Int>()
- for (color in COLORS_ACCENT1) {
- overlayColorList.add(overlayProvider.loadColor(color, packageName))
- }
-
- accentColorsGridItems.add(
- AccentColorsGridItem(
- packageName,
- overlayColorList,
- overlayProvider.isOverlayEnabled(packageName),
- false,
- overlayProvider.getAccentColorCategory()
- )
- )
- } catch (e: NotFoundException) {
- }
- }
- // add all custom colors
- for (customColor in customAccentColors) {
- val customColorList = ArrayList<Int>()
- customColorList.add(customColor.darkColor)
- customColorList.add(customColor.lightColor)
- accentColorsGridItems.add(
- FabricatedAccentColorsGridItem(
- overlayProvider.getFabricatedOverlayIdentifier(customColor.identifier),
- customColorList,
- overlayProvider.isOverlayEnabled(
- overlayProvider.getFabricatedOverlayIdentifier(
- customColor.identifier
- )
- ),
- false,
- overlayProvider.getAccentColorCategory(),
- customColor
- )
- )
- }
- accentColorsGridItems.add(AddAccentColorsGridItem())
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
-
- loadCustomAccentColors()
- loadIconShapeOverlays()
- loadPrimaryColorsOverlays()
- loadAccentColorsOverlays()
-
- overlayItemList.clear()
- val overlayItemView =
- LayoutInflater.from(context).inflate(R.layout.overlays_item, null, false)
- overlayItemList.add(overlayItemView)
-
- iconShapeListView = overlayItemView.findViewById(R.id.icon_shape_list_view)!!
- iconShapeListView.layoutManager =
- LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
- iconShapeListView.adapter = IconShapeListViewAdapter(requireContext(), iconShapeGridItems)
-
- primaryColorsListView = overlayItemView.findViewById(R.id.primary_color_list_view)!!
- primaryColorsListView.layoutManager =
- LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
- primaryColorsListView.adapter =
- PrimaryColorsListViewAdapter(requireContext(), primaryColorsGridItems)
-
- accentColorsListView = overlayItemView.findViewById(R.id.accent_color_list_view)!!
- accentColorsListView.layoutManager =
- LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
- accentColorsListView.adapter =
- AccentColorsListViewAdapter(requireContext(), accentColorsGridItems)
-
- overlayItemListView = view.findViewById(R.id.overlay_item_list)!!
- overlayItemListView.adapter = OverlayItemListViewAdapter(requireContext(), overlayItemList)
- overlayItemListView.layoutManager =
- LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
-
- val monetEnableSwitch: Switch = overlayItemView.findViewById(R.id.monet_overlay_enable)!!
- val monetEnabled = overlayProvider.isMonetOverlayEnabled()
- monetEnableSwitch.isChecked = monetEnabled
- enableOverlaySelect(overlayItemView, !monetEnabled)
-
- monetEnableSwitch.setOnClickListener {
- val checked = monetEnableSwitch.isChecked()
- Settings.System.putInt(
- requireContext().contentResolver,
- OmniSettings.OMNI_MONET_DISABLE,
- if (checked) 0 else 1
- )
- enableOverlaySelect(overlayItemView, !checked)
- AsyncTask.execute(Runnable { overlayProvider.enableMonetOverlays(checked) })
- }
- }
-
- private fun setCustomAccentColor(
- accentColor: FabricatedAccentColorsGridItem,
- changeDark: Boolean
- ) {
- val color = accentColor.customAccentColor
- val oldColor = if (changeDark) color.darkColor else color.lightColor
- mChangeAccentColor = accentColor
- mChangeColor = color
- mChangeDark = changeDark
-
- val intent = Intent(context, ColorBrowseActivity::class.java)
- intent.putExtra(ColorBrowseActivity.DATA_SELECT_COLOR_EXTRA, oldColor)
- mBrowseColor.launch(intent)
- }
-
- private fun doDeleteCustomAccentColor(accentColor: FabricatedAccentColorsGridItem) {
- val dialog = AlertDialog.Builder(requireContext())
- dialog.setMessage(getString(R.string.dialog_delete_accent_color_message))
- dialog.setPositiveButton(
- resources.getString(android.R.string.ok)
- ) { _, _ ->
- deleteCustomAccentColor(accentColor)
- loadAccentColorsOverlays()
- accentColorsListView.adapter!!.notifyDataSetChanged()
- }
- dialog.setNegativeButton(resources.getString(android.R.string.cancel), null)
-
- dialog.show()
- }
-
- private fun loadCustomAccentColors() {
- val prefs = requireContext().getSharedPreferences("overlays", Context.MODE_PRIVATE)
- val colorsString = prefs.getString("colors", "")
- val deletedColor = prefs.getString("deletedAccentColor", "")
-
- if (colorsString != null && colorsString.isNotEmpty()) {
- val colorArray = JSONArray(colorsString)
- for (i in 0..colorArray.length()) {
- try {
- val color = colorArray[i] as JSONObject
- if (!deletedColor.isNullOrEmpty() && color["identifier"] == deletedColor) {
- prefs.edit().remove("deletedAccentColor").commit()
- continue
- }
- customAccentColors.add(
- CustomAccentColor(
- color["identifier"] as String,
- color["system_accent1_100"] as Int,
- color["system_accent1_600"] as Int
- )
- )
- } catch (e: Exception) {
- }
- }
- }
- }
-
- private fun saveCustomAccentColors() {
- val prefs = requireContext().getSharedPreferences("overlays", Context.MODE_PRIVATE)
- val colorArray = JSONArray()
- for (color in customAccentColors) {
- colorArray.put(color.toJSONObject())
- }
- prefs.edit().putString("colors", colorArray.toString()).commit()
- }
-
- private fun addNewCustomAccentColor() {
- val customColor = getDefaultCustomAccentColor()
- customAccentColors.add(customColor)
- saveCustomAccentColors()
- loadAccentColorsOverlays()
- accentColorsListView.adapter!!.notifyDataSetChanged()
-
- val prefs = requireContext().getSharedPreferences("overlays", Context.MODE_PRIVATE)
- val firstTime = prefs.getBoolean("firstTimeAdd", true)
- if (firstTime) {
- Snackbar.make(
- requireView(),
- getString(R.string.delete_accent_color_info_message),
- Snackbar.LENGTH_LONG
- ).setAction(
- android.R.string.ok,
- { prefs.edit().putBoolean("firstTimeAdd", false).commit() }).show()
- }
- }
-
- private fun getDefaultCustomAccentColor(): CustomAccentColor {
- val customColor = CustomAccentColor(
- "",
- resources.getColor(android.R.color.system_accent1_100, null),
- resources.getColor(android.R.color.system_accent1_600, null)
- )
- customColor.identifier = "accent_color_" + customColor.hashCode()
- return customColor
- }
-
- private fun deleteCustomAccentColor(accentColor: AccentColorsGridItem) {
- if (accentColor !is FabricatedAccentColorsGridItem) return
-
- if (accentColor.isEnabled) {
- val prefs = requireContext().getSharedPreferences("overlays", Context.MODE_PRIVATE)
- prefs.edit().putString("deletedAccentColor", accentColor.customAccentColor.identifier)
- .commit()
- // set to system default this will trigger a complete reload anyway
- overlayProvider.enableAccentOverlayTransaction(null)
- } else {
- customAccentColors.remove(accentColor.customAccentColor)
- saveCustomAccentColors()
- loadAccentColorsOverlays()
- accentColorsListView.adapter!!.notifyDataSetChanged()
- }
- }
-
- override fun onCreateContextMenu(
- menu: ContextMenu,
- v: View,
- menuInfo: ContextMenu.ContextMenuInfo?
- ) {
- super.onCreateContextMenu(menu, v, menuInfo)
- menu.setHeaderTitle(resources.getString(R.string.accent_color_title));
- menu.add(0, 0, 0, "Delete");
- }
-
- override fun onContextItemSelected(item: MenuItem): Boolean {
- if (item.itemId == 0) {
- /*deleteCustomAccentColor(gridItem)
- loadAccentColorsOverlays()
- accentColorsListView.adapter!!.notifyDataSetChanged()*/
- }
- return super.onContextItemSelected(item)
- }
-
- fun isMonetEnabled(): Boolean {
- return Settings.System.getInt(
- requireContext().contentResolver, OmniSettings.OMNI_MONET_DISABLE, 0
- ) == 0
- }
-
- private fun enableOverlaySelect(overlayItemView: View, enable: Boolean) {
- val neutralBlocker: View =
- overlayItemView.findViewById(R.id.primary_color_list_view_blocker)!!
- val accentBlocker: View = overlayItemView.findViewById(R.id.accent_color_list_view_blocker)!!
- if (enable) {
- neutralBlocker.visibility = View.GONE
- accentBlocker.visibility = View.GONE
- } else {
- neutralBlocker.visibility = View.VISIBLE
- accentBlocker.visibility = View.VISIBLE
- neutralBlocker.setOnTouchListener { _, _ ->
- true
- }
- accentBlocker.setOnTouchListener { _, _ ->
- true
- }
- }
- }
-}
diff --git a/app/src/main/java/org/omnirom/control/OverlaysProvider.kt b/app/src/main/java/org/omnirom/control/OverlaysProvider.kt
deleted file mode 100644
index 242ed31..0000000
--- a/app/src/main/java/org/omnirom/control/OverlaysProvider.kt
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Copyright (C) 2021 The OmniROM Project
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.omnirom.control
-
-import android.content.Context
-import android.content.om.FabricatedOverlay
-import android.content.om.IOverlayManager
-import android.content.om.OverlayIdentifier
-import android.content.om.OverlayInfo
-import android.content.om.OverlayManager
-import android.content.om.OverlayManagerTransaction
-import android.content.res.Resources
-import android.os.ServiceManager
-import android.os.UserHandle
-import android.provider.Settings
-import android.util.TypedValue
-import org.json.JSONObject
-import org.json.JSONTokener
-
-
-class OverlaysProvider(context: Context) {
- private val overlaysMap = HashMap<String, OverlayInfo>()
- private val TAG = "OverlayProvider"
- private val context = context
- private var om: OverlayManager? = null
- private var iOm: IOverlayManager? = null;
- private lateinit var user: UserHandle
- private val monetNeutral = OverlayIdentifier("com.android.systemui", "neutral")
- private val monetDynamic = OverlayIdentifier("com.android.systemui", "dynamic")
- private val monetAccent = OverlayIdentifier("com.android.systemui", "accent")
-
- fun init() {
- user = UserHandle.of(UserHandle.myUserId())
- om = context.getSystemService(OverlayManager::class.java)
- iOm = IOverlayManager.Stub.asInterface(
- ServiceManager.getService(Context.OVERLAY_SERVICE)
- )
- loadOverlayInfo()
- }
-
- private fun loadOverlayInfo() {
- if (om != null) {
- overlaysMap.clear()
- om!!.getOverlayInfosForTarget("android", user).forEach { overlayInfo ->
- overlaysMap.put(overlayInfo.getOverlayIdentifier().toString(), overlayInfo)
- }
- }
- }
-
- fun getIconShapeOverlays(): ArrayList<String> {
- return getCategoryOverlays(getIconShapeCategory())
- }
-
- fun getAccentColorOverlays(): ArrayList<String> {
- return getCategoryOverlays(getAccentColorCategory())
- }
-
- fun getPrimaryColorOverlays(): ArrayList<String> {
- return getCategoryOverlays(getPrimaryColorCategory())
- }
-
- fun getIconShapeCategory(): String {
- return "android.theme.customization.adaptive_icon_shape"
- }
-
- fun getAccentColorCategory(): String {
- return "android.theme.customization.accent_color"
- }
-
- fun getPrimaryColorCategory(): String {
- return "android.theme.customization.system_palette"
- }
-
- private fun getCategoryOverlays(category: String): ArrayList<String> {
- val packageList = ArrayList<String>()
- overlaysMap.values.filter { it.getCategory() == category }
- .forEach { packageList.add(it.getPackageName()) }
- return packageList
- }
-
- private fun getCategoryOverlaysRaw(category: String): ArrayList<OverlayInfo> {
- val overlayList = ArrayList<OverlayInfo>()
- overlaysMap.values.filter { it.getCategory() == category }
- .forEach { overlayList.add(it) }
- return overlayList
- }
-
- fun enableMonetOverlays(enable: Boolean) {
- val transaction = OverlayManagerTransaction.Builder()
- transaction.setEnabled(
- monetAccent,
- enable,
- UserHandle.myUserId()
- )
- transaction.setEnabled(
- monetDynamic,
- enable,
- UserHandle.myUserId()
- )
- transaction.setEnabled(
- monetNeutral,
- enable,
- UserHandle.myUserId()
- )
- om!!.commit(transaction.build())
- }
-
- fun isMonetOverlayEnabled(): Boolean {
- return isOverlayEnabled(monetNeutral)
- }
-
- @Throws(Resources.NotFoundException::class)
- fun loadString(stringName: String, packageName: String): String {
- val overlayRes: Resources = context.packageManager.getResourcesForApplication(
- packageName
- )
- return overlayRes.getString(overlayRes.getIdentifier(stringName, "string", packageName))
- }
-
- @Throws(Resources.NotFoundException::class)
- fun loadColor(colorName: String, packageName: String): Int {
- val overlayRes: Resources = context.packageManager
- .getResourcesForApplication(packageName)
- return overlayRes.getColor(
- overlayRes.getIdentifier(colorName, "color", packageName),
- null
- )
- }
-
- fun getSystemIconMask(): String {
- val system: Resources = Resources.getSystem()
- return system.getString(
- system.getIdentifier(
- "config_icon_mask",
- "string", "android"
- )
- )
- }
-
- fun getSystemColor(colorName: String): Int {
- val system: Resources = Resources.getSystem()
- return system.getColor(
- system.getIdentifier(
- colorName,
- "color", "android"
- ), null
- )
- }
-
- fun isOverlayEnabled(identifier: String): Boolean {
- val overlayInfo = overlaysMap.get(OverlayIdentifier.fromString(identifier).toString())
- if (overlayInfo != null) {
- return overlayInfo.isEnabled()
- }
- return false
- }
-
- fun isOverlayEnabled(identifier: OverlayIdentifier): Boolean {
- val overlayInfo = overlaysMap.get(identifier.toString())
- if (overlayInfo != null) {
- return overlayInfo.isEnabled()
- }
- return false
- }
-
- fun enableOverlayExclusive(packageName: String) {
- if (om != null) {
- om!!.setEnabledExclusiveInCategory(packageName, user)
- }
- }
-
- private fun disableOverlay(packageName: String, reload: Boolean) {
- if (om != null) {
- om!!.setEnabled(packageName, false, user)
- if (reload) loadOverlayInfo()
- }
- }
-
- fun disableAllInCategory(category: String) {
- getCategoryOverlays(category).forEach { disableOverlay(it, false) }
- loadOverlayInfo()
- }
-
- fun enableAccentOverlayTransaction(
- overlay: String?
- ) {
- if (om != null) {
- val transaction = OverlayManagerTransaction.Builder()
- // disable farbricated
- om!!.getOverlayInfosForTarget("android", user)
- .forEach { info ->
- if (info.isFabricated() && info.getPackageName() == context.packageName) {
- transaction.unregisterFabricatedOverlay(info.getOverlayIdentifier())
- }
- }
- // disable enabled
- getCategoryOverlaysRaw(getAccentColorCategory()).filter { it.isEnabled() }
- .forEach {
- transaction.setEnabled(
- it.getOverlayIdentifier(),
- false,
- UserHandle.myUserId()
- )
- }
- // enable new if provided
- if (overlay != null && overlaysMap.containsKey(
- OverlayIdentifier.fromString(overlay).toString()
- )
- ) {
- transaction.setEnabled(
- OverlayIdentifier.fromString(overlay),
- true,
- UserHandle.myUserId()
- )
- }
- om!!.commit(transaction.build())
- }
- }
-
- fun enableFabricatedAccentOverlayTransaction(
- accentColor: OverlaysFragment.CustomAccentColor
- ) {
- if (om != null) {
- val transaction = OverlayManagerTransaction.Builder()
- // disable farbricated
- om!!.getOverlayInfosForTarget("android", user)
- .forEach { info ->
- if (info.isFabricated() && info.getPackageName() == context.packageName) {
- transaction.unregisterFabricatedOverlay(info.getOverlayIdentifier())
- }
- }
- // disable enabled
- getCategoryOverlaysRaw(getAccentColorCategory()).filter { it.isEnabled() }
- .forEach {
- transaction.setEnabled(
- it.getOverlayIdentifier(),
- false,
- UserHandle.myUserId()
- )
- }
- // enable fabricated
- val accentColorOverlay = FabricatedOverlay.Builder(
- context.packageName, accentColor.identifier, "android"
- )
- .setResourceValue(
- "@android:color/system_accent1_100",
- TypedValue.TYPE_INT_COLOR_ARGB8,
- accentColor.darkColor
- )
- .setResourceValue(
- "@android:color/system_accent1_200",
- TypedValue.TYPE_INT_COLOR_ARGB8,
- accentColor.darkColor
- )
- .setResourceValue(
- "@android:color/system_accent1_600",
- TypedValue.TYPE_INT_COLOR_ARGB8,
- accentColor.lightColor
- )
- .build()
-
-
- transaction.registerFabricatedOverlay(accentColorOverlay)
- .setEnabled(accentColorOverlay!!.getIdentifier(), true, UserHandle.myUserId())
- om!!.commit(transaction.build())
- }
- }
-
- fun getFabricatedOverlayIdentifier(overlayName: String): String {
- return OverlayIdentifier(context.packageName, overlayName).toString()
- }
-
- fun saveIconShapeOverlayToSettings(iconShapePackage: String) {
- val overlayPackageJson: String? = Settings.Secure.getString(
- context.contentResolver,
- "theme_customization_overlay_packages"
- )
- var json = JSONObject()
- if (!overlayPackageJson.isNullOrEmpty()) {
- json = JSONTokener(overlayPackageJson).nextValue() as JSONObject
- }
- if (iconShapePackage.isNullOrEmpty()) {
- json.remove(getIconShapeCategory())
- } else {
- json.put(getIconShapeCategory(), iconShapePackage)
- }
- Settings.Secure.putString(
- context.contentResolver, "theme_customization_overlay_packages",
- json.toString()
- )
- }
-}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/add_accent_color_item_background.xml b/app/src/main/res/drawable/add_accent_color_item_background.xml
deleted file mode 100644
index a3a0177..0000000
--- a/app/src/main/res/drawable/add_accent_color_item_background.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright (C) 2021 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
- android:shape="rectangle">
- <stroke
- android:width="2dp"
- android:color="?attr/colorControlNormal"
- android:dashWidth="8dp"
- android:dashGap="4dp"/>
-
-</shape>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/check_circle.xml b/app/src/main/res/drawable/check_circle.xml
deleted file mode 100644
index 0ae55df..0000000
--- a/app/src/main/res/drawable/check_circle.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:tint="?attr/colorAccent"
- android:viewportWidth="24"
- android:viewportHeight="24">
- <path
- android:fillColor="@android:color/white"
- android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z"/>
-</vector>
diff --git a/app/src/main/res/drawable/check_circle_shape.xml b/app/src/main/res/drawable/check_circle_shape.xml
deleted file mode 100644
index 1589fad..0000000
--- a/app/src/main/res/drawable/check_circle_shape.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:tint="?attr/colorOnPrimary"
- android:viewportWidth="24"
- android:viewportHeight="24">
- <path
- android:fillColor="@android:color/white"
- android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2z" />
-</vector>
diff --git a/app/src/main/res/drawable/ic_settings_overlays.xml b/app/src/main/res/drawable/ic_settings_overlays.xml
deleted file mode 100644
index ff59963..0000000
--- a/app/src/main/res/drawable/ic_settings_overlays.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:tint="?android:textColorPrimary"
- android:viewportWidth="24"
- android:viewportHeight="24">
- <path
- android:fillColor="@android:color/white"
- android:pathData="M12,2C6.49,2 2,6.49 2,12s4.49,10 10,10c1.38,0 2.5,-1.12 2.5,-2.5c0,-0.61 -0.23,-1.2 -0.64,-1.67c-0.08,-0.1 -0.13,-0.21 -0.13,-0.33c0,-0.28 0.22,-0.5 0.5,-0.5H16c3.31,0 6,-2.69 6,-6C22,6.04 17.51,2 12,2zM17.5,13c-0.83,0 -1.5,-0.67 -1.5,-1.5c0,-0.83 0.67,-1.5 1.5,-1.5s1.5,0.67 1.5,1.5C19,12.33 18.33,13 17.5,13zM14.5,9C13.67,9 13,8.33 13,7.5C13,6.67 13.67,6 14.5,6S16,6.67 16,7.5C16,8.33 15.33,9 14.5,9zM5,11.5C5,10.67 5.67,10 6.5,10S8,10.67 8,11.5C8,12.33 7.33,13 6.5,13S5,12.33 5,11.5zM11,7.5C11,8.33 10.33,9 9.5,9S8,8.33 8,7.5C8,6.67 8.67,6 9.5,6S11,6.67 11,7.5z" />
-</vector>
diff --git a/app/src/main/res/drawable/overlay_item_background.xml b/app/src/main/res/drawable/overlay_item_background.xml
deleted file mode 100644
index 161d450..0000000
--- a/app/src/main/res/drawable/overlay_item_background.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2021 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<ripple xmlns:android="http://schemas.android.com/apk/res/android"
- android:color="?android:attr/colorControlHighlight">
- <item android:id="@android:id/mask"
- android:drawable="@drawable/overlay_item_background_shape" />
- <item android:id="@+id/background"
- android:drawable="@drawable/overlay_item_background_shape"/>
-</ripple>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/overlay_item_background_shape.xml b/app/src/main/res/drawable/overlay_item_background_shape.xml
deleted file mode 100644
index 57a6481..0000000
--- a/app/src/main/res/drawable/overlay_item_background_shape.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2021 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
- <corners android:radius="@dimen/grid_item_corner_radius" />
- <solid android:color="@color/overlay_item_background" />
-</shape>
\ No newline at end of file
diff --git a/app/src/main/res/layout/accent_colors_item.xml b/app/src/main/res/layout/accent_colors_item.xml
deleted file mode 100644
index 71068c4..0000000
--- a/app/src/main/res/layout/accent_colors_item.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="@dimen/color_item_column_width"
- android:layout_height="@dimen/color_item_column_height"
- android:layout_margin="2dp"
- android:background="@drawable/overlay_item_background">
-
- <FrameLayout
- android:layout_width="@dimen/color_item_container_width"
- android:layout_height="@dimen/color_item_container_height"
- android:layout_gravity="center">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <ImageView
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_gravity="center_vertical"
- android:layout_weight="1"
- android:src="@android:color/system_neutral1_900" />
-
- <ImageView
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_gravity="center_vertical"
- android:layout_weight="1"
- android:src="@android:color/system_neutral1_50" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/colors_item_list"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:orientation="vertical" />
-
- <ImageView
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:layout_gravity="center_vertical"
- android:src="@android:color/system_neutral1_100" />
-
- <ImageView
- android:id="@+id/colors_enabled"
- android:layout_width="@dimen/check_circle_size"
- android:layout_height="@dimen/check_circle_size"
- android:layout_gravity="bottom|end"
- android:background="@drawable/check_circle_shape"
- android:src="@drawable/check_circle"
- android:visibility="gone" />
- </FrameLayout>
-</FrameLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/add_accent_colors_item.xml b/app/src/main/res/layout/add_accent_colors_item.xml
deleted file mode 100644
index bd29b03..0000000
--- a/app/src/main/res/layout/add_accent_colors_item.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="@dimen/color_item_column_width"
- android:layout_height="@dimen/color_item_column_height"
- android:layout_margin="2dp"
- android:background="@drawable/overlay_item_background">
-
- <FrameLayout
- android:layout_width="@dimen/color_item_container_width"
- android:layout_height="@dimen/color_item_container_height"
- android:layout_gravity="center"
- android:background="@drawable/add_accent_color_item_background">
-
- <ImageView
- android:layout_width="32dp"
- android:layout_height="32dp"
- android:layout_gravity="center"
- android:src="@drawable/ic_add"/>
-
- </FrameLayout>
-</FrameLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/icon_shape_item.xml b/app/src/main/res/layout/icon_shape_item.xml
deleted file mode 100644
index 08f1c58..0000000
--- a/app/src/main/res/layout/icon_shape_item.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="@dimen/icon_shape_column_size"
- android:layout_height="@dimen/icon_shape_column_size"
- android:layout_margin="2dp"
- android:background="@drawable/overlay_item_background">
-
- <FrameLayout
- android:layout_width="@dimen/icon_shape_container_size"
- android:layout_height="@dimen/icon_shape_container_size"
- android:layout_gravity="center" >
-
- <ImageView
- android:id="@+id/icon_shape_icon"
- android:layout_width="@dimen/icon_shape_size"
- android:layout_height="@dimen/icon_shape_size"
- android:layout_gravity="center" />
-
- <ImageView
- android:id="@+id/icon_shape_icon_enabled"
- android:layout_width="@dimen/check_circle_size"
- android:layout_height="@dimen/check_circle_size"
- android:layout_gravity="bottom|end"
- android:src="@drawable/check_circle"
- android:background="@drawable/check_circle_shape"
- android:visibility="gone" />
- </FrameLayout>
-</FrameLayout>
diff --git a/app/src/main/res/layout/overlays_fragment.xml b/app/src/main/res/layout/overlays_fragment.xml
deleted file mode 100644
index 179a970..0000000
--- a/app/src/main/res/layout/overlays_fragment.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/overlay_item_list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginStart="@dimen/overlay_fragment_side_margin"
- android:layout_marginEnd="@dimen/overlay_fragment_side_margin"/>
diff --git a/app/src/main/res/layout/overlays_item.xml b/app/src/main/res/layout/overlays_item.xml
deleted file mode 100644
index 685d049..0000000
--- a/app/src/main/res/layout/overlays_item.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="10dp"
- android:layout_marginBottom="10dp"
- android:gravity="center_vertical"
- android:text="@string/icon_shape_title"
- android:textAppearance="@style/Theme.OmniControl.GridItem.TitleTextStyle" />
-
- <androidx.recyclerview.widget.RecyclerView
- android:id="@+id/icon_shape_list_view"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:layout_marginBottom="10dp"
- android:gravity="center_vertical"
- android:text="@string/system_colors_title"
- android:textAppearance="@style/Theme.OmniControl.GridItem.TitleTextStyle" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
-
- <Switch
- android:id="@+id/monet_overlay_enable"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:paddingEnd="10dp"
- android:paddingStart="5dp"/>
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingStart="10dp"
- android:text="@string/monet_overlay_enable_title" />
- </LinearLayout>
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:layout_marginBottom="10dp"
- android:gravity="center_vertical"
- android:text="@string/primary_color_title"
- android:textAppearance="@style/Theme.OmniControl.GridItem.TitleTextStyle" />
-
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <androidx.recyclerview.widget.RecyclerView
- android:id="@+id/primary_color_list_view"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
-
- <View
- android:id="@+id/primary_color_list_view_blocker"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/overlay_blocker_color"
- android:visibility="gone" />
- </FrameLayout>
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:layout_marginBottom="10dp"
- android:gravity="center_vertical"
- android:text="@string/accent_color_title"
- android:textAppearance="@style/Theme.OmniControl.GridItem.TitleTextStyle" />
-
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <androidx.recyclerview.widget.RecyclerView
- android:id="@+id/accent_color_list_view"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
-
- <View
- android:id="@+id/accent_color_list_view_blocker"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/overlay_blocker_color"
- android:visibility="gone" />
- </FrameLayout>
-
- <Space
- android:layout_width="match_parent"
- android:layout_height="100dp" />
-</LinearLayout>
diff --git a/app/src/main/res/layout/primary_colors_item.xml b/app/src/main/res/layout/primary_colors_item.xml
deleted file mode 100644
index b3d0a7b..0000000
--- a/app/src/main/res/layout/primary_colors_item.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="@dimen/color_item_column_width"
- android:layout_height="@dimen/color_item_column_height"
- android:layout_margin="2dp"
- android:background="@drawable/overlay_item_background">
-
- <FrameLayout
- android:layout_width="@dimen/color_item_container_width"
- android:layout_height="@dimen/color_item_container_height"
- android:layout_gravity="center">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:id="@+id/colors_item_list"
- android:orientation="vertical"
- android:layout_gravity="center_vertical">
- </LinearLayout>
-
- <ImageView
- android:id="@+id/colors_enabled"
- android:layout_width="@dimen/check_circle_size"
- android:layout_height="@dimen/check_circle_size"
- android:layout_gravity="bottom|end"
- android:src="@drawable/check_circle"
- android:background="@drawable/check_circle_shape"
- android:visibility="gone" />
- </FrameLayout>
-</FrameLayout>
\ No newline at end of file
diff --git a/app/src/main/res/values-land/dimens.xml b/app/src/main/res/values-land/dimens.xml
index 9185fd8..6b3446f 100644
--- a/app/src/main/res/values-land/dimens.xml
+++ b/app/src/main/res/values-land/dimens.xml
@@ -2,8 +2,6 @@
<resources>
<dimen name="fragment_side_margin">30dp</dimen>
<dimen name="grid_icon_margin_start">10dp</dimen>
- <dimen name="color_item_column_width">@dimen/color_item_column_height</dimen>
- <dimen name="color_item_container_width">@dimen/color_item_container_height</dimen>
<dimen name="overlay_fragment_side_margin">20dp</dimen>
<dimen name="toolbar_placeholder_height">60dp</dimen>
<dimen name="color_select_side_margin">20dp</dimen>
diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml
index 1b87c64..f1b6396 100644
--- a/app/src/main/res/values-night/colors.xml
+++ b/app/src/main/res/values-night/colors.xml
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">@android:color/system_accent1_200</color>
- <color name="overlay_item_background">@android:color/system_neutral1_800</color>
- <color name="overlay_blocker_color">#10ffffff</color>
</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values-sw600dp-land/dimens.xml b/app/src/main/res/values-sw600dp-land/dimens.xml
index 993d22c..7ae6751 100644
--- a/app/src/main/res/values-sw600dp-land/dimens.xml
+++ b/app/src/main/res/values-sw600dp-land/dimens.xml
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <dimen name="color_item_column_width">@dimen/color_item_column_height</dimen>
- <dimen name="color_item_container_width">@dimen/color_item_container_height</dimen>
<dimen name="color_select_side_margin">100dp</dimen>
<dimen name="color_select_content_padding">64dp</dimen>
<dimen name="color_select_picker_width">400dp</dimen>
diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml
index 1ed609d..e6707c6 100644
--- a/app/src/main/res/values-sw600dp/dimens.xml
+++ b/app/src/main/res/values-sw600dp/dimens.xml
@@ -1,16 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <dimen name="icon_shape_size">64dp</dimen>
- <dimen name="icon_shape_container_size">72dp</dimen>
- <dimen name="icon_shape_column_size">80dp</dimen>
- <dimen name="color_item_height">16dp</dimen>
- <dimen name="color_item_container_width">130dp</dimen>
- <dimen name="color_item_container_height">160dp</dimen>
- <dimen name="accent_color_item_height">30dp</dimen>
- <!-- color_item_container_height / 2 - accent_color_item_height -->
- <dimen name="edit_accent_color_item_height">50dp</dimen>
- <dimen name="color_item_column_width">150dp</dimen>
- <dimen name="color_item_column_height">180dp</dimen>
<dimen name="color_select_side_margin">150dp</dimen>
<dimen name="color_select_content_padding">64dp</dimen>
<dimen name="color_preset_item_size">52dp</dimen>
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index e09d1b9..80935d1 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">@android:color/system_accent1_600</color>
- <color name="overlay_item_background">@android:color/system_neutral1_0</color>
- <color name="overlay_blocker_color">#10000000</color>
</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/config.xml b/app/src/main/res/values/config.xml
index 5d674aa..00a90d2 100644
--- a/app/src/main/res/values/config.xml
+++ b/app/src/main/res/values/config.xml
@@ -2,7 +2,6 @@
<resources>
<integer name="grid_view_columns">1</integer>
<bool name="config_show_battery_options">true</bool>
- <integer name="icon_shape_view_columns">20</integer>
<!-- power button support. Some devices do not have a power button -->
<bool name="config_has_power_button">true</bool>
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index eb629ec..5216c9d 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -7,19 +7,6 @@
<dimen name="fragment_icon_margin_start">16dp</dimen>
<dimen name="grid_item_icon_size">32dp</dimen>
<dimen name="grid_icon_margin_start">0dp</dimen>
- <dimen name="icon_shape_size">48dp</dimen>
- <dimen name="check_circle_size">24dp</dimen>
- <dimen name="icon_shape_container_size">56dp</dimen>
- <dimen name="icon_shape_column_size">64dp</dimen>
- <dimen name="color_item_height">12dp</dimen>
- <dimen name="color_item_width">@dimen/color_item_container_width</dimen>
- <dimen name="color_item_container_width">90dp</dimen>
- <dimen name="color_item_container_height">120dp</dimen>
- <dimen name="accent_color_item_height">20dp</dimen>
- <!-- color_item_container_height / 2 - accent_color_item_height -->
- <dimen name="edit_accent_color_item_height">40dp</dimen>
- <dimen name="color_item_column_width">110dp</dimen>
- <dimen name="color_item_column_height">140dp</dimen>
<dimen name="overlay_fragment_side_margin">10dp</dimen>
<dimen name="alert_dialog_padding_material">20dp</dimen>
<dimen name="color_preset_item_size">44dp</dimen>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 4c656d6..4cca5ed 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -50,12 +50,6 @@
<string name="device_settings_title">Device settings</string>
<string name="device_settings_summary">Advanced device specific options</string>
- <string name="overlays_settings_title">Styles</string>
- <string name="overlays_settings_summary">System default styles and colors</string>
- <string name="icon_shape_title">Icon shape</string>
- <string name="primary_color_title">Neutral color</string>
- <string name="accent_color_title">Primary color</string>
-
<!-- doze on charge -->
<string name="doze_on_charge_title">Show ambient display when charging</string>
<string name="doze_on_charge_summary">Wake screen when charging</string>
@@ -145,8 +139,6 @@
<string name="incall_vibrate_call_wait_summary">Device vibrate on call waiting</string>
<string name="incall_vibrate_disconnect_title">Vibrate on disconnect</string>
<string name="incall_vibrate_disconnect_summary">Device vibrate on call disconnect</string>
- <string name="monet_overlay_enable_title">Enable dynamic colors based on wallpaper - Monet</string>
- <string name="system_colors_title">System colors</string>
<!-- Fingerprint -->
<string name="fprint_title">Fingerprint</string>