Skip to content

Theme setup

In order to setup the theme, follow these steps.

Step 1

1.Add the following lines to your AndroidManifest file:

1
2
xmlns:tools="http://schemas.android.com/tools
tools:replace="android:theme"

Example:

1
2
3
4
5
6
7
8
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/Theme.ClientTheme"
    tools:replace="android:theme">


Step 2

2.Apply the theme in your activity by adding this line:

1
theme.applyStyle(R.style.Theme_Commerce_DayNight, true)

Example:

1
2
3
4
5
override fun onCreate(savedInstanceState: Bundle?) {
    theme.applyStyle(R.style.Theme_Commerce_DayNight, true)
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
}