

WhatsApp Clone Compose uses Material Theme for styling the overall UI elements, and defining custom color schemes with lightColorSceme and darkColorSceme methods:Īlso, WhatsApp Clone Compose defines its own theme, WhatsAppCloneComposeTheme like the below:Ĭolor themes apply to different color schemes and background colors depending on whether the user device is in dark mode or not.īy wrapping your UI elements with WhatsAppCloneComposeTheme like the example below, you can see the result of the UI elements being colored according to the defined color scheme. Theming is one of the most essential parts of the app design, and you can achieve this easily in Jetpack Compose.

For more information, check out Material Design 3 Color system.īy wrapping UI elements with WhatsAppCloneBackground composable like the example below, descendants of the composable content will have the same background color. Surfaces at elevation levels +1 to +5 are tinted via color overlays based on the primary color, such as app bars or menus. Tonal Elevation: The surface tonal elevation highlights the components depending on the elevation levels.Color: This property decides the background color of the Surface.The BackgroundTheme includes two properties below: To make UI elements have a consistent background color, WhatsApp Clone Compose implemented its own background composable, which is called WhatsAppCloneBackground: Styling background is a primary part of application design. In this post, you’ll learn how WhatsApp Clone Compose styles the background and theme for overall UI elements. The module includes reusable components that are used in UI feature modules, and theme definitions, such as Theme, Background, and Typography. WhatsApp Clone Compose has theming components in the core-designsystem module. As a result, you can achieve loose coupling between modules and high cohesion, which means each module has clearly defined responsibilities for its own domain logic. Modularization allows you to build your feature and write test code independently without any dependencies on other features. Parallel Building: Each module can be run in parallel and it reduces the build time.ĭecentralize Team Focusing: Each developer team can assign their dedicated module and they can focus on their own modules. Reusability: Modularizing reusable code properly enable opportunities for code sharing and restrict code access from other modules.
