Notification Bar Take on app background color using Delphi

Asked

Viewed 1,522 times

3

How to make the notification bar take on a preset color such as whattsup, gmail etc.

Using the Delphi Firemonkey programming IDE.

In my apps the slider always takes the color black, follow example.

Esse é meu aplicativo

1 answer

2

Following the documentation, you need to change the colorPrimaryDark there are several ways to do, you can create your own theme or modify the existing one, you can implement in XML or in auto-creation form.

Following are examples:

values/themes.xml:

<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
    <!-- Here we setting appcompat’s actionBarStyle -->
    <item name="actionBarStyle">@style/MyActionBarStyle</item>

    <!-- ...and here we setting appcompat’s color theming attrs -->
    <item name="colorPrimary">@color/my_awesome_red</item>
    <item name="colorPrimaryDark">@color/my_awesome_darker_red</item>

    <!-- The rest of your attributes -->
</style>

or in Layout

<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimaryDark"/>

Here a good material study.

  • 1

    Thank you for the reply but I need to make these changes using Delphi, there is some way to do via programming ?

Browser other questions tagged

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