There are a lot of wrong ways to do theming in Android. Joanne Kao's Medium article however, brillantly showcases the right way. Android essentially allows you to set a number of colors in a theme that then are automatically applied to all widgets app wide for you.
Alongside the article, Kao provided a complimentary repo. This repo is an exact copy of that plus updates to better support certain widgets. Too added is a catalog of widgets to futher showcase themes in action. Included themes are:
While Android AppCompat is no longer preferred in usage, and Material is, many projects still use AppCompat. An equivalent Material repo that show cases themes & widgets in action would be Google's Material Components for Android & its theme builder.