mirror of
https://github.com/home-assistant/android
synced 2024-09-06 17:23:32 +00:00
parent
7eced552ea
commit
b137f656d1
|
@ -34,7 +34,6 @@ import androidx.compose.ui.unit.dp
|
|||
import androidx.compose.ui.unit.sp
|
||||
import com.mikepenz.iconics.compose.Image
|
||||
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
|
||||
import io.homeassistant.companion.android.R
|
||||
import io.homeassistant.companion.android.util.IntervalToString
|
||||
import io.homeassistant.companion.android.common.R as commonR
|
||||
|
||||
|
@ -58,7 +57,7 @@ fun SettingsWearTemplateTile(
|
|||
) {
|
||||
Image(
|
||||
asset = CommunityMaterial.Icon.cmd_arrow_left,
|
||||
colorFilter = ColorFilter.tint(colorResource(R.color.colorIcon))
|
||||
colorFilter = ColorFilter.tint(colorResource(commonR.color.colorIcon))
|
||||
)
|
||||
}
|
||||
},
|
||||
|
@ -80,7 +79,7 @@ fun SettingsWearTemplateTile(
|
|||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Image(
|
||||
asset = CommunityMaterial.Icon3.cmd_timer_cog,
|
||||
colorFilter = ColorFilter.tint(colorResource(R.color.colorPrimary)),
|
||||
colorFilter = ColorFilter.tint(colorResource(commonR.color.colorPrimary)),
|
||||
modifier = Modifier
|
||||
.height(24.dp)
|
||||
.width(24.dp)
|
||||
|
|
|
@ -909,7 +909,7 @@ class MessagingManager @Inject constructor(
|
|||
) {
|
||||
|
||||
val colorString = data["color"]
|
||||
val color = parseColor(colorString, R.color.colorPrimary)
|
||||
val color = parseColor(colorString, commonR.color.colorPrimary)
|
||||
builder.color = color
|
||||
}
|
||||
|
||||
|
@ -930,7 +930,7 @@ class MessagingManager @Inject constructor(
|
|||
) {
|
||||
val ledColor = data[LED_COLOR]
|
||||
if (!ledColor.isNullOrBlank()) {
|
||||
builder.setLights(parseColor(ledColor, R.color.colorPrimary), 3000, 3000)
|
||||
builder.setLights(parseColor(ledColor, commonR.color.colorPrimary), 3000, 3000)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1255,7 +1255,7 @@ class MessagingManager @Inject constructor(
|
|||
val ledColor = data[LED_COLOR]
|
||||
if (!ledColor.isNullOrBlank()) {
|
||||
channel.enableLights(true)
|
||||
channel.lightColor = parseColor(ledColor, R.color.colorPrimary)
|
||||
channel.lightColor = parseColor(ledColor, commonR.color.colorPrimary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -339,7 +339,7 @@ class SettingsFragment constructor(
|
|||
try {
|
||||
val unwrappedDrawable =
|
||||
AppCompatResources.getDrawable(requireContext(), R.drawable.ic_computer)
|
||||
unwrappedDrawable?.setTint(resources.getColor(R.color.colorAccent))
|
||||
unwrappedDrawable?.setTint(resources.getColor(commonR.color.colorAccent))
|
||||
it.icon = unwrappedDrawable
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to set the icon tint", e)
|
||||
|
@ -351,7 +351,7 @@ class SettingsFragment constructor(
|
|||
try {
|
||||
val unwrappedDrawable =
|
||||
AppCompatResources.getDrawable(requireContext(), commonR.drawable.ic_priority)
|
||||
unwrappedDrawable?.setTint(resources.getColor(R.color.colorAccent))
|
||||
unwrappedDrawable?.setTint(resources.getColor(commonR.color.colorAccent))
|
||||
it.icon = unwrappedDrawable
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to set the icon tint", e)
|
||||
|
|
|
@ -86,7 +86,7 @@ class ManageTilesViewModel @Inject constructor(
|
|||
val iconDrawable = selectedIcon.value?.let { iconPack.getIcon(it)?.drawable }
|
||||
if (iconDrawable != null) {
|
||||
val icon = DrawableCompat.wrap(iconDrawable)
|
||||
icon.setColorFilter(getApplication<HomeAssistantApplication>().resources.getColor(io.homeassistant.companion.android.R.color.colorAccent), PorterDuff.Mode.SRC_IN)
|
||||
icon.setColorFilter(getApplication<HomeAssistantApplication>().resources.getColor(R.color.colorAccent), PorterDuff.Mode.SRC_IN)
|
||||
drawableIcon.value = icon
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ fun ManageTilesView(
|
|||
Image(
|
||||
it,
|
||||
contentDescription = stringResource(id = R.string.tile_icon),
|
||||
colorFilter = ColorFilter.tint(colorResource(io.homeassistant.companion.android.R.color.colorAccent))
|
||||
colorFilter = ColorFilter.tint(colorResource(R.color.colorAccent))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ class ManageShortcutsSettingsFragment : Fragment(), IconDialog.Callback {
|
|||
val iconDrawable = selectedIcon.drawable
|
||||
if (iconDrawable != null) {
|
||||
val icon = DrawableCompat.wrap(iconDrawable)
|
||||
icon.setColorFilter(resources.getColor(R.color.colorAccent), PorterDuff.Mode.SRC_IN)
|
||||
icon.setColorFilter(resources.getColor(commonR.color.colorAccent), PorterDuff.Mode.SRC_IN)
|
||||
when (dialog.tag) {
|
||||
"shortcut_1" -> {
|
||||
viewModel.shortcuts[0].selectedIcon.value = selectedIcon.id
|
||||
|
|
|
@ -202,7 +202,7 @@ class ManageShortcutsViewModel @Inject constructor(
|
|||
val iconDrawable = iconPack.icons[tileIconId]?.drawable
|
||||
if (iconDrawable != null) {
|
||||
val icon = DrawableCompat.wrap(iconDrawable)
|
||||
icon.setColorFilter(app.resources.getColor(io.homeassistant.companion.android.R.color.colorAccent), PorterDuff.Mode.SRC_IN)
|
||||
icon.setColorFilter(app.resources.getColor(R.color.colorAccent), PorterDuff.Mode.SRC_IN)
|
||||
return icon
|
||||
}
|
||||
return null
|
||||
|
|
|
@ -88,7 +88,7 @@ private fun CreateShortcutView(i: Int, viewModel: ManageShortcutsViewModel, icon
|
|||
id = R.string.shortcut_pinned
|
||||
),
|
||||
fontSize = 20.sp,
|
||||
color = colorResource(id = io.homeassistant.companion.android.R.color.colorAccent),
|
||||
color = colorResource(id = R.color.colorAccent),
|
||||
modifier = Modifier.padding(top = 20.dp)
|
||||
)
|
||||
|
||||
|
@ -157,7 +157,7 @@ private fun CreateShortcutView(i: Int, viewModel: ManageShortcutsViewModel, icon
|
|||
Image(
|
||||
it,
|
||||
contentDescription = stringResource(id = R.string.shortcut_icon),
|
||||
colorFilter = ColorFilter.tint(colorResource(io.homeassistant.companion.android.R.color.colorAccent))
|
||||
colorFilter = ColorFilter.tint(colorResource(R.color.colorAccent))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -207,7 +207,7 @@ class WebViewActivity : BaseActivity(), io.homeassistant.companion.android.webvi
|
|||
windowInsetsController = WindowInsetsControllerCompat(window, window.decorView)
|
||||
|
||||
// Initially set status and navigation bar color to colorLaunchScreenBackground to match the launch screen until the web frontend is loaded
|
||||
val colorLaunchScreenBackground = ResourcesCompat.getColor(resources, R.color.colorLaunchScreenBackground, theme)
|
||||
val colorLaunchScreenBackground = ResourcesCompat.getColor(resources, commonR.color.colorLaunchScreenBackground, theme)
|
||||
setStatusBarAndNavigationBarColor(colorLaunchScreenBackground, colorLaunchScreenBackground)
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
|
|
|
@ -354,7 +354,7 @@ class ButtonWidgetConfigureActivity : BaseActivity(), IconDialog.Callback {
|
|||
if (iconDrawable != null) {
|
||||
val icon = DrawableCompat.wrap(iconDrawable)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
DrawableCompat.setTint(icon, resources.getColor(R.color.colorIcon, theme))
|
||||
DrawableCompat.setTint(icon, resources.getColor(commonR.color.colorIcon, theme))
|
||||
}
|
||||
binding.widgetConfigIconSelector.setImageBitmap(icon.toBitmap())
|
||||
}
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorDialogBackground">#111111</color>
|
||||
<color name="colorDialogMessage">@android:color/white</color>
|
||||
<color name="colorDialogTitle">@android:color/white</color>
|
||||
<color name="colorBackground">#1c1c1c</color>
|
||||
<color name="colorPrimary">#03A9F4</color>
|
||||
<color name="colorPrimaryDark">#111111</color>
|
||||
<color name="colorAccent">#03A9F4</color>
|
||||
<color name="colorOnPrimary">@android:color/white</color>
|
||||
<color name="colorWarning">#D32F2F</color>
|
||||
<color name="colorHeadline1">@android:color/white</color>
|
||||
<color name="colorHeadline2">@android:color/white</color>
|
||||
<color name="colorActionBar">#1c1c1c</color>
|
||||
<color name="colorIcon">@android:color/white</color>
|
||||
<color name="colorWidgetButtonBackground">#1c1c1c</color>
|
||||
<color name="colorWidgetButtonLabel">#E6E6E6</color>
|
||||
<color name="colorActionBarPopupBackground">#2B2B2B</color>
|
||||
<color name="colorLaunchScreenBackground">#111111</color>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorDialogBackground">#111111</color>
|
||||
<color name="colorDialogMessage">@android:color/white</color>
|
||||
<color name="colorDialogTitle">@android:color/white</color>
|
||||
<color name="colorBackground">#1c1c1c</color>
|
||||
<color name="colorPrimary">#03A9F4</color>
|
||||
<color name="colorPrimaryDark">#111111</color>
|
||||
<color name="colorAccent">#03A9F4</color>
|
||||
<color name="colorOnPrimary">@android:color/white</color>
|
||||
<color name="colorWarning">#D32F2F</color>
|
||||
<color name="colorHeadline1">@android:color/white</color>
|
||||
<color name="colorHeadline2">@android:color/white</color>
|
||||
<color name="colorActionBar">#1c1c1c</color>
|
||||
<color name="colorIcon">@android:color/white</color>
|
||||
<color name="colorWidgetButtonBackground">#1c1c1c</color>
|
||||
<color name="colorWidgetButtonLabel">#E6E6E6</color>
|
||||
<color name="colorActionBarPopupBackground">#2B2B2B</color>
|
||||
<color name="colorLaunchScreenBackground">#111111</color>
|
||||
</resources>
|
Loading…
Reference in a new issue