-2

I have a source code for an application. I try to change the colors in it.After i find the color background (i think it is) so i see this tag @color/material_grey_800 . Can you tell me how to change it? Thanks. Picture

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134

1 Answers1

0

You can change the color profile of a color by simply changing the value (color hex codes or color profiles that come packaged with Android) in-between the color tags. For instance:

<color name="colorBlack">#000000</color>

... or:

<color name="colorBlack">@android:color/black</color>

... and then a sample implementation of referencing a color profile in say, a View's background, is as follows:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/colorBlack"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    ...

</RelativeLayout>
DaveNOTDavid
  • 1,753
  • 5
  • 19
  • 37
  • @MouadAlsahel Yes, colors are ultimately represented by hex codes. I encourage you to test and reference a color profile from colors.xml in your app by say, setting a View's background (i.e. android:background="@color/colorBlack") to one of the colors in your layout file in order to notice the changes. – DaveNOTDavid Jul 08 '17 at 21:27
  • Thanks for the reply mate :) http://imgur.com/a/B1ghE any help? i cant find the background color – Mouad Alsahel Jul 09 '17 at 00:37
  • @MouadAlsahel Check out my updated answer. Well, you have to reference a color by its name as opposed to its value. Also, don't reference it by "colorBlack" as my answer is only a sample. Try referencing the background attribute by one of your color profiles in your colors.xml so say, "button_material_dark", so then it'd be `android:background="@color/button_material_dark"` – DaveNOTDavid Jul 09 '17 at 00:58