Search⌘ K
AI Features

Custom Styles

Explore how to enhance an Android login screen by extending Material Design themes, creating styles and colors files, and applying custom colors to UI components for a refined user experience.

We'll cover the following...

Recap

The login screen is almost ready. It’s time to polish the user interface with some custom styles and colors.

Let’s see what we need to do before applying custom styles. First, we need to make sure that our activity extends AppCompatActivity.

Java
public class LoginActivity extends AppCompatActivity {
...
}

Next, we need to use one of the material component themes inside the activity or application tags in the AndroidManifest.xml file.

XML
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.travelblog">
<application
android:theme="@style/Theme.MaterialComponents.DayNight.NoActionBar"
android:label="Travel Blog">
...
</application>
</manifest>

Now, all the user interface components are going to use default styles declared in the ...