Skip to content
Snippets Groups Projects
Unverified Commit fb691eff authored by harambasicluka's avatar harambasicluka Committed by GitHub
Browse files

Feature: Adapt all colors to latest designs (#221)

* grey background & removed light button elevation

* light theme

* dark & stable colors

* fix
parent c2f50141
No related branches found
No related tags found
No related merge requests found
Showing
with 60 additions and 53 deletions
...@@ -80,18 +80,19 @@ class CircleProgress @JvmOverloads constructor( ...@@ -80,18 +80,19 @@ class CircleProgress @JvmOverloads constructor(
setWillNotDraw(false) setWillNotDraw(false)
binding = ViewCircleProgressBinding.inflate(LayoutInflater.from(context), this) binding = ViewCircleProgressBinding.inflate(LayoutInflater.from(context), this)
val styleAttrs = context.obtainStyledAttributes(attrs, R.styleable.CircleProgress) val styleAttrs = context.obtainStyledAttributes(attrs, R.styleable.CircleProgress)
// attribute circleColor; default = colorGreyLight
val circleColor = styleAttrs.getColor( val circleColor = styleAttrs.getColor(
R.styleable.CircleProgress_circleColor, R.styleable.CircleProgress_circleColor,
ContextCompat.getColor(context, R.color.colorGreyLight) ContextCompat.getColor(context, R.color.colorSurface2)
) )
// attribute progressColor; default = colorPrimary // attribute progressColor; default = colorAccentTintIcon
val progressColor = styleAttrs.getColor(R.styleable.CircleProgress_progressColor, val progressColor = styleAttrs.getColor(
ContextCompat.getColor(context, R.color.colorPrimary)) R.styleable.CircleProgress_progressColor,
// attribute textColor; default = colorGrey ContextCompat.getColor(context, R.color.colorAccentTintIcon)
)
// attribute textColor; default = colorTextPrimary2
val textColor = styleAttrs.getColor( val textColor = styleAttrs.getColor(
R.styleable.CircleProgress_textColor, R.styleable.CircleProgress_textColor,
ContextCompat.getColor(context, R.color.textColorGrey) ContextCompat.getColor(context, R.color.colorTextPrimary2)
) )
// attribute disableText; default = true // attribute disableText; default = true
disableText = styleAttrs.getBoolean(R.styleable.CircleProgress_disableText, false) disableText = styleAttrs.getBoolean(R.styleable.CircleProgress_disableText, false)
......
...@@ -113,5 +113,5 @@ fun formatText(value: Boolean?, stringTrue: Int, stringFalse: Int): String { ...@@ -113,5 +113,5 @@ fun formatText(value: Boolean?, stringTrue: Int, stringFalse: Int): String {
*/ */
fun formatColorIcon(color: Int?): Int { fun formatColorIcon(color: Int?): Int {
val appContext = CoronaWarnApplication.getAppContext() val appContext = CoronaWarnApplication.getAppContext()
return color ?: appContext.getColor(R.color.colorLight) return color ?: appContext.getColor(R.color.colorAccentTintIcon)
} }
...@@ -340,8 +340,8 @@ fun formatRiskShape(showDetails: Boolean): Drawable? = ...@@ -340,8 +340,8 @@ fun formatRiskShape(showDetails: Boolean): Drawable? =
fun formatStableIconColor(riskLevelScore: Int?): Int = fun formatStableIconColor(riskLevelScore: Int?): Int =
formatColor( formatColor(
!isTracingOffRiskLevel(riskLevelScore), !isTracingOffRiskLevel(riskLevelScore),
R.color.stableIconColor, R.color.colorStableLight,
R.color.iconColor R.color.colorTextPrimary1
) )
/** /**
...@@ -372,8 +372,8 @@ fun formatStableBackButtonColor(riskLevelScore: Int?): ColorStateList? { ...@@ -372,8 +372,8 @@ fun formatStableBackButtonColor(riskLevelScore: Int?): ColorStateList? {
fun formatStableTextColor(riskLevelScore: Int?): Int = fun formatStableTextColor(riskLevelScore: Int?): Int =
formatColor( formatColor(
!isTracingOffRiskLevel(riskLevelScore), !isTracingOffRiskLevel(riskLevelScore),
R.color.stableBackgroundColor, R.color.colorStableLight,
R.color.textColorPrimary R.color.colorTextPrimary1
) )
/** /**
...@@ -491,8 +491,8 @@ fun formatBehaviorIcon(riskLevelScore: Int?): Int { ...@@ -491,8 +491,8 @@ fun formatBehaviorIcon(riskLevelScore: Int?): Int {
val appContext = CoronaWarnApplication.getAppContext() val appContext = CoronaWarnApplication.getAppContext()
return when (riskLevelScore) { return when (riskLevelScore) {
RiskLevelConstants.NO_CALCULATION_POSSIBLE_TRACING_OFF, RiskLevelConstants.NO_CALCULATION_POSSIBLE_TRACING_OFF,
RiskLevelConstants.UNKNOWN_RISK_OUTDATED_RESULTS -> appContext.getColor(R.color.colorTextSemanticNeutral) RiskLevelConstants.UNKNOWN_RISK_OUTDATED_RESULTS -> appContext.getColor(R.color.colorAccentTintIcon)
else -> appContext.getColor(R.color.stableIconColor) else -> appContext.getColor(R.color.colorStableLight)
} }
} }
...@@ -505,10 +505,10 @@ fun formatBehaviorIcon(riskLevelScore: Int?): Int { ...@@ -505,10 +505,10 @@ fun formatBehaviorIcon(riskLevelScore: Int?): Int {
fun formatBehaviorIconBackground(riskLevelScore: Int?): Int { fun formatBehaviorIconBackground(riskLevelScore: Int?): Int {
val appContext = CoronaWarnApplication.getAppContext() val appContext = CoronaWarnApplication.getAppContext()
return when (riskLevelScore) { return when (riskLevelScore) {
RiskLevelConstants.INCREASED_RISK -> appContext.getColor(R.color.colorRiskCardIncreasedRisk) RiskLevelConstants.INCREASED_RISK -> appContext.getColor(R.color.colorSemanticHighRisk)
RiskLevelConstants.LOW_LEVEL_RISK -> appContext.getColor(R.color.colorRiskCardLowRisk) RiskLevelConstants.LOW_LEVEL_RISK -> appContext.getColor(R.color.colorSemanticLowRisk)
RiskLevelConstants.UNKNOWN_RISK_INITIAL -> appContext.getColor(R.color.colorRiskCardUnknownRisk) RiskLevelConstants.UNKNOWN_RISK_INITIAL -> appContext.getColor(R.color.colorSemanticNeutralRisk)
else -> appContext.getColor(R.color.riskCardGrey) else -> appContext.getColor(R.color.colorSurface2)
} }
} }
......
...@@ -158,6 +158,14 @@ fun formatTracingIllustrationText( ...@@ -158,6 +158,14 @@ fun formatTracingIllustrationText(
} }
/*Styler*/ /*Styler*/
/**
* Formats the settings icon color depending on flag provided
*
* @param active
* @return Int
*/
fun formatIconColor(active: Boolean): Int =
formatColor(active, R.color.colorAccentTintIcon, R.color.colorTextPrimary3)
/** /**
* Formats the settings icon color for notifications depending on notification values * Formats the settings icon color for notifications depending on notification values
...@@ -174,8 +182,8 @@ fun formatNotificationIconColor( ...@@ -174,8 +182,8 @@ fun formatNotificationIconColor(
): Int = ): Int =
formatColor( formatColor(
(notifications && (notificationsRisk || notificationsTest)), (notifications && (notificationsRisk || notificationsTest)),
R.color.tracingIconActive, R.color.colorAccentTintIcon,
R.color.tracingIconInactive R.color.colorTextSemanticRed
) )
/** /**
...@@ -222,12 +230,12 @@ fun formatSettingsTracingIconColor(tracing: Boolean, bluetooth: Boolean, connect ...@@ -222,12 +230,12 @@ fun formatSettingsTracingIconColor(tracing: Boolean, bluetooth: Boolean, connect
val appContext = CoronaWarnApplication.getAppContext() val appContext = CoronaWarnApplication.getAppContext()
return when (tracingStatusHelper(tracing, bluetooth, connection)) { return when (tracingStatusHelper(tracing, bluetooth, connection)) {
TracingStatusHelper.CONNECTION, TracingStatusHelper.BLUETOOTH -> TracingStatusHelper.CONNECTION, TracingStatusHelper.BLUETOOTH ->
appContext.getColor(R.color.settingsIconInactive) appContext.getColor(R.color.colorTextSemanticRed)
TracingStatusHelper.TRACING_ACTIVE -> TracingStatusHelper.TRACING_ACTIVE ->
appContext.getColor(R.color.tracingIconActive) appContext.getColor(R.color.colorAccentTintIcon)
TracingStatusHelper.TRACING_INACTIVE -> TracingStatusHelper.TRACING_INACTIVE ->
appContext.getColor(R.color.tracingIconInactive) appContext.getColor(R.color.colorTextSemanticRed)
else -> appContext.getColor(R.color.tracingIconInactive) else -> appContext.getColor(R.color.colorTextSemanticRed)
} }
} }
...@@ -320,9 +328,9 @@ fun formatTracingIconColor(tracing: Boolean, bluetooth: Boolean, connection: Boo ...@@ -320,9 +328,9 @@ fun formatTracingIconColor(tracing: Boolean, bluetooth: Boolean, connection: Boo
val appContext = CoronaWarnApplication.getAppContext() val appContext = CoronaWarnApplication.getAppContext()
return when (tracingStatusHelper(tracing, bluetooth, connection)) { return when (tracingStatusHelper(tracing, bluetooth, connection)) {
TracingStatusHelper.TRACING_ACTIVE -> TracingStatusHelper.TRACING_ACTIVE ->
appContext.getColor(R.color.tracingIconActive) appContext.getColor(R.color.colorAccentTintIcon)
else -> else ->
appContext.getColor(R.color.tracingIconInactive) appContext.getColor(R.color.colorTextSemanticRed)
} }
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorGreyLight" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorSurface1Pressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorTransparent" /> <!-- default --> <item android:color="@color/colorTransparent" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/stableHighlightColor" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorStableMedium" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorTransparent" /> <!-- default --> <item android:color="@color/colorTransparent" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorGreyLight" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorSurface1Pressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorLight" /> <!-- default --> <item android:color="@color/colorSurface1" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorGreyLight" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorSurface1Pressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorTransparent" /> <!-- default --> <item android:color="@color/colorTransparent" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorPrimaryDark" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorAccentTintButtonPressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorSurface2" android:state_enabled="false" /> <!-- disabled --> <item android:color="@color/colorSurface2" android:state_enabled="false" /> <!-- disabled -->
<item android:color="@color/colorAccentTintButton" /> <!-- default --> <item android:color="@color/colorAccentTintButton" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorRiskCardIncreasedRiskPressed" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorSemanticHighRiskPressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorRiskCardIncreasedRisk" /> <!-- default --> <item android:color="@color/colorSemanticHighRisk" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorRiskCardIncreasedRiskPressed" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorSemanticHighRiskPressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorRiskCardIncreasedRisk" /> <!-- default --> <item android:color="@color/colorSemanticHighRisk" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorRiskCardNoCalculationPossiblePressed" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorSurface1Pressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorRiskCardNoCalculationPossible" /> <!-- default --> <item android:color="@color/colorSurface1" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorRiskCardLowRiskPressed" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorSemanticLowRiskPressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorRiskCardLowRisk" /> <!-- default --> <item android:color="@color/colorSemanticLowRisk" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorRiskCardNoCalculationPossiblePressed" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorSemanticUnknownRiskPressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorRiskCardNoCalculationPossible" /> <!-- default --> <item android:color="@color/colorSemanticUnknownRisk" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorRiskCardOutdatedRiskPressed" android:state_pressed="true" /> pressed --> <item android:color="@color/colorSemanticUnknownRiskPressed" android:state_pressed="true" /> <!-- pressed -->
<!--<item android:color="@color/colorRiskCardOutdatedRisk" /> default --> <item android:color="@color/colorSemanticUnknownRisk" /> <!-- default -->
<item android:color="@color/colorRiskCardNoCalculationPossiblePressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorRiskCardNoCalculationPossible" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorRiskCardUnknownRiskPressed" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorSemanticNeutralRiskPressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorRiskCardUnknownRisk" /> <!-- default --> <item android:color="@color/colorSemanticNeutralRisk" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorGreyLight" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/colorSurface1Pressed" android:state_pressed="true" /> <!-- pressed -->
<item android:color="@color/colorTransparent" /> <!-- default --> <item android:color="@color/colorTransparent" /> <!-- default -->
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"> android:shape="oval">
<solid android:color="@color/colorPrimary" /> <solid android:color="@color/colorAccentTintIcon" />
</shape> </shape>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/colorLight" /> <solid android:color="@color/colorSurface1" />
</shape> </shape>
</item> </item>
</selector> </selector>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- background with solid color --> <!-- background with solid color -->
<item android:drawable="@color/appTheme" /> <item android:drawable="@color/colorBackground" />
<!-- logo --> <!-- logo -->
<item <item
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment