Change the color of the application footer

Asked

Viewed 224 times

0

I would like to change the color, the footer of the application, where is the button "back" android. Image below:

Imagem

XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    tools:context=".activity.MainActivity"
    android:background="#1C1C1C">

    <!-- progress -->
    <ProgressBar
        android:id="@+id/form_Local_progress"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:visibility="gone" />

    <ScrollView
        android:id="@+id/form_Local"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:id="@+id/form_Novo_Local"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/StyledTilEditText">

                <EditText
                    android:id="@+id/edt_Nome_Local"
                    android:hint="Nome do Local"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:focusableInTouchMode="true"
                    android:inputType="text"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textColor="#D3D3D3"
                    android:fontFamily="sans-serif-condensed"
                    android:textSize="12dp"/>

            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/StyledTilEditText">

                <AutoCompleteTextView
                    android:id="@+id/edt_Endereco_Local"
                    android:hint="Endereço"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textColor="#D3D3D3"
                    android:fontFamily="sans-serif-condensed"
                    android:textSize="12dp"/>

            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/StyledTilEditText">

                <EditText
                    android:id="@+id/edt_Numero_Local"
                    android:hint="Número"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textColor="#D3D3D3"
                    android:fontFamily="sans-serif-condensed"
                    android:textSize="12dp"/>

            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/StyledTilEditText">

                <EditText
                    android:id="@+id/edt_UF_Local"
                    android:hint="UF"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textColor="#D3D3D3"
                    android:fontFamily="sans-serif-condensed"
                    android:textSize="12dp"/>

            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/StyledTilEditText">

                <EditText
                    android:id="@+id/edt_Pais_Local"
                    android:hint="País"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textColor="#D3D3D3"
                    android:fontFamily="sans-serif-condensed"
                    android:textSize="12dp"/>

            </android.support.design.widget.TextInputLayout>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="#D3D3D3"
                android:fontFamily="sans-serif-condensed"
                android:textSize="12dp"
                android:text="Bebida"/>
            <Spinner
                android:id="@+id/spn_Bebida_Local"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:drawSelectorOnTop="true"
                android:fontFamily="sans-serif-condensed" />

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/StyledTilEditText">

                <EditText
                    android:id="@+id/edt_Long_Local"
                    android:hint="Longitude"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:layout_marginRight="3dp"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textColor="#D3D3D3"
                    android:fontFamily="sans-serif-condensed"
                    android:textSize="12dp"/>

            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/StyledTilEditText">

                <EditText
                    android:id="@+id/edt_Lati_Local"
                    android:hint="Latitude"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textColor="#D3D3D3"
                    android:fontFamily="sans-serif-condensed"
                    android:textSize="12dp"/>

            </android.support.design.widget.TextInputLayout>

            <Button
                android:id="@+id/btn_Salvar_Local"
                android:layout_width="match_parent"
                android:layout_height="35dp"
                android:layout_marginRight="15dp"
                android:layout_marginLeft="15dp"
                android:layout_gravity="center_horizontal"
                android:layout_marginBottom="7dp"
                android:text="Salvar Local"
                android:textStyle="bold"
                android:textSize="11dp"
                android:fontFamily="sans-serif-condensed" />
        </LinearLayout>


    </ScrollView>

</RelativeLayout>

STYLE:

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">#FFB300</item>
        <item name="colorPrimaryDark">#FFC107</item>
        <item name="colorAccent">#E8F5E9</item>
    </style>

    <!-- Define estilo do edittext -->
    <style name="StyledTilEditTextTheme">
        // Cor padrão da linha
        <item name="colorControlNormal">#e6ffffff</item>
        // Cor linha e texto quando recebe foco
        <item name="colorControlActivated">#faffffff</item>
    </style>

    <style name="StyledTilEditText">
        <item name="android:theme">@style/StyledTilEditTextTheme</item>
        <item name="android:paddingTop">4dp</item>
        <item name="android:textColorHint">#c8ffffff</item> // Cor texto(hint) sem foco
    </style>

</resources>

1 answer

2


Fala Henrique,

According to this image, this is the coloring order of your application:

inserir a descrição da imagem aqui

There in his xml style. where you declare the colors, just add:

<item name="android:navigationBarColor">@color/theme_color</item>

Note: Note that this change is only valid from Lollipop (API 20) onwards.

Hugs.

  • Thank you very much!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.