Rename colors

This commit is contained in:
Alex Sytnyk 2018-06-20 19:46:14 +03:00
parent 7827509e7a
commit a4e421892f
8 changed files with 49 additions and 44 deletions

View file

@ -3,19 +3,19 @@
<item android:state_pressed="true"> <item android:state_pressed="true">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/ctrl_active_color_light" /> <solid android:color="@color/ctrl_active_light" />
<corners android:radius="@dimen/dialog_button_radius" /> <corners android:radius="@dimen/dialog_button_radius" />
</shape> </shape>
</item> </item>
<item android:state_enabled="false"> <item android:state_enabled="false">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/ctrl_color_light" /> <solid android:color="@color/ctrl_light" />
<corners android:radius="@dimen/dialog_button_radius" /> <corners android:radius="@dimen/dialog_button_radius" />
</shape> </shape>
</item> </item>
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/ctrl_color_light" /> <solid android:color="@color/ctrl_light" />
<corners android:radius="@dimen/dialog_button_radius" /> <corners android:radius="@dimen/dialog_button_radius" />
</shape> </shape>
</item> </item>

View file

@ -3,19 +3,19 @@
<item android:state_pressed="true"> <item android:state_pressed="true">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/ctrl_active_color_light" /> <solid android:color="@color/ctrl_active_light" />
<corners android:radius="@dimen/dialog_button_radius" /> <corners android:radius="@dimen/dialog_button_radius" />
</shape> </shape>
</item> </item>
<item android:state_enabled="false"> <item android:state_enabled="false">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/ctrl_color_light" /> <solid android:color="@color/ctrl_light" />
<corners android:radius="@dimen/dialog_button_radius" /> <corners android:radius="@dimen/dialog_button_radius" />
</shape> </shape>
</item> </item>
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/ctrl_active_color_light" /> <solid android:color="@color/ctrl_active_light" />
<corners android:radius="@dimen/dialog_button_radius" /> <corners android:radius="@dimen/dialog_button_radius" />
</shape> </shape>
</item> </item>

View file

@ -39,7 +39,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="visible" android:visibility="visible"
app:itemBackground="?attr/bg_color" app:itemBackground="?attr/card_bg_color"
app:menu="@menu/bottom_navigation_menu"/> app:menu="@menu/bottom_navigation_menu"/>
</LinearLayout> </LinearLayout>

View file

@ -9,7 +9,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/bg_color" android:background="?attr/card_bg_color"
android:minHeight="@dimen/list_item_height_min" android:minHeight="@dimen/list_item_height_min"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingBottom="@dimen/content_padding_half" android:paddingBottom="@dimen/content_padding_half"

View file

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<declare-styleable name="AppTheme"> <declare-styleable name="AppTheme">
<attr name="bg_color" format="reference" /> <attr name="card_bg_color" format="reference" />
<attr name="screen_bg_color" format="reference" />
<attr name="icon_color" format="reference" /> <attr name="icon_color" format="reference" />
<attr name="ctrl_active_color" format="reference" /> <attr name="ctrl_active_color" format="reference" />
<attr name="ctrl_color" format="reference" /> <attr name="ctrl_color" format="reference" />

View file

@ -1,31 +1,34 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="white_color">#fff</color> <color name="white">#fff</color>
<color name="bg_color_light">#fff</color> <color name="card_bg_light">#fff</color>
<color name="bg_color_dark">#222526</color> <color name="card_bg_dark">#222526</color>
<color name="icon_color_light">#727272</color> <color name="screen_bg_light">#f0f0f0</color>
<color name="icon_color_dark">#727272</color> <color name="screen_bg_dark">#17191a</color>
<color name="icon_light">#727272</color>
<color name="icon_dark">#727272</color>
<color name="osmand_orange">#ff8f00</color> <color name="osmand_orange">#ff8f00</color>
<color name="ctrl_active_color_light">#237bff</color> <color name="ctrl_active_light">#237bff</color>
<color name="ctrl_active_color_dark">#d28521</color> <color name="ctrl_active_dark">#d28521</color>
<color name="ctrl_color_light">#f0f0f0</color> <color name="ctrl_light">#f0f0f0</color>
<color name="ctrl_color_dark">#17191a</color> <color name="ctrl_dark">#17191a</color>
<color name="primary_text_color_light">#212121</color> <color name="primary_text_light">#212121</color>
<color name="primary_text_color_dark">#cccccc</color> <color name="primary_text_dark">#cccccc</color>
<color name="secondary_text_color_light">#727272</color> <color name="secondary_text_light">#727272</color>
<color name="secondary_text_color_dark">#727272</color> <color name="secondary_text_dark">#727272</color>
<color name="description_text_color_light">#b3b3b3</color> <color name="description_text_light">#b3b3b3</color>
<color name="description_text_color_dark">#4d4d4d</color> <color name="description_text_dark">#4d4d4d</color>
<color name="divider_color_light">#f0f0f0</color> <color name="card_divider_light">#f0f0f0</color>
<color name="divider_color_dark">#2d3133</color> <color name="card_divider_dark">#2d3133</color>
</resources> </resources>

View file

@ -2,23 +2,24 @@
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowBackground">@color/bg_color_light</item> <item name="android:windowBackground">@color/card_bg_light</item>
<item name="android:colorBackground">@color/bg_color_light</item> <item name="android:colorBackground">@color/card_bg_light</item>
<item name="colorControlNormal">@color/primary_text_color_light</item> <item name="colorControlNormal">@color/primary_text_light</item>
<item name="colorControlActivated">@color/ctrl_active_color_light</item> <item name="colorControlActivated">@color/ctrl_active_light</item>
<item name="android:windowLightStatusBar">true</item> <item name="android:windowLightStatusBar">true</item>
<item name="colorPrimary">@color/ctrl_active_color_light</item> <item name="colorPrimary">@color/ctrl_active_light</item>
<item name="colorPrimaryDark">@color/bg_color_light</item> <item name="colorPrimaryDark">@color/card_bg_light</item>
<item name="colorAccent">@color/ctrl_active_color_light</item> <item name="colorAccent">@color/ctrl_active_light</item>
<item name="android:textColorPrimary">@color/primary_text_color_light</item> <item name="android:textColorPrimary">@color/primary_text_light</item>
<item name="android:textColorSecondary">@color/secondary_text_color_light</item> <item name="android:textColorSecondary">@color/secondary_text_light</item>
<item name="android:textColorTertiary">@color/description_text_color_light</item> <item name="android:textColorTertiary">@color/description_text_light</item>
<item name="bg_color">@color/bg_color_light</item> <item name="card_bg_color">@color/card_bg_light</item>
<item name="icon_color">@color/icon_color_light</item> <item name="screen_bg_color">@color/screen_bg_light</item>
<item name="ctrl_active_color">@color/ctrl_active_color_light</item> <item name="icon_color">@color/icon_light</item>
<item name="ctrl_color">@color/ctrl_color_light</item> <item name="ctrl_active_color">@color/ctrl_active_light</item>
<item name="ctrl_color">@color/ctrl_light</item>
<item name="bottom_nav_shadow">@drawable/bg_bottom_bar_shadow_with_line_day</item> <item name="bottom_nav_shadow">@drawable/bg_bottom_bar_shadow_with_line_day</item>
</style> </style>
@ -36,7 +37,7 @@
<item name="android:paddingRight">16dp</item> <item name="android:paddingRight">16dp</item>
<item name="android:paddingTop">8dp</item> <item name="android:paddingTop">8dp</item>
<item name="android:paddingBottom">8dp</item> <item name="android:paddingBottom">8dp</item>
<item name="android:textColor">@color/white_color</item> <item name="android:textColor">@color/white</item>
<item name="android:textAllCaps">false</item> <item name="android:textAllCaps">false</item>
<item name="android:background">@drawable/btn_round_blue</item> <item name="android:background">@drawable/btn_round_blue</item>
</style> </style>
@ -49,7 +50,7 @@
<item name="android:paddingRight">16dp</item> <item name="android:paddingRight">16dp</item>
<item name="android:paddingTop">8dp</item> <item name="android:paddingTop">8dp</item>
<item name="android:paddingBottom">8dp</item> <item name="android:paddingBottom">8dp</item>
<item name="android:textColor">@color/secondary_text_color_light</item> <item name="android:textColor">@color/secondary_text_light</item>
<item name="android:textAllCaps">false</item> <item name="android:textAllCaps">false</item>
<item name="android:background">@drawable/btn_round</item> <item name="android:background">@drawable/btn_round</item>
</style> </style>

View file

@ -82,7 +82,7 @@ class UiUtils(private val app: TelegramApplication) {
} }
fun getThemedIcon(@DrawableRes id: Int): Drawable? { fun getThemedIcon(@DrawableRes id: Int): Drawable? {
return getDrawable(id, if (isLightContent) R.color.icon_color_light else 0) return getDrawable(id, if (isLightContent) R.color.icon_light else 0)
} }
fun getIcon(@DrawableRes id: Int): Drawable? { fun getIcon(@DrawableRes id: Int): Drawable? {
@ -90,7 +90,7 @@ class UiUtils(private val app: TelegramApplication) {
} }
fun getIcon(@DrawableRes id: Int, light: Boolean): Drawable? { fun getIcon(@DrawableRes id: Int, light: Boolean): Drawable? {
return getDrawable(id, if (light) R.color.icon_color_light else 0) return getDrawable(id, if (light) R.color.icon_light else 0)
} }
private fun createCircleBitmap(source: Bitmap, recycleSource: Boolean = false): Bitmap { private fun createCircleBitmap(source: Bitmap, recycleSource: Boolean = false): Bitmap {