-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: AA: Allow to configure color of buttons of virtual screens
- Loading branch information
1 parent
d330d89
commit cdf9f4e
Showing
7 changed files
with
71 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.obd.graphs.aa | ||
|
||
import android.graphics.Color | ||
import androidx.car.app.model.CarColor | ||
import org.obd.graphs.ui.common.COLOR_WHITE | ||
|
||
internal fun mapColor(color: Int): CarColor { | ||
return when (color) { | ||
-1 -> CarColor.PRIMARY | ||
-48060 -> CarColor.RED | ||
-6697984 -> CarColor.GREEN | ||
-17613 -> CarColor.YELLOW | ||
-16737844 -> CarColor.BLUE | ||
|
||
COLOR_WHITE -> CarColor.PRIMARY | ||
Color.RED -> CarColor.RED | ||
Color.BLUE -> CarColor.BLUE | ||
Color.GREEN -> CarColor.GREEN | ||
Color.YELLOW -> CarColor.YELLOW | ||
else -> CarColor.PRIMARY | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters