Skip to content

Latest commit

 

History

History
324 lines (182 loc) · 16.9 KB

Components.md

File metadata and controls

324 lines (182 loc) · 16.9 KB

Components

Explore the various UI components available in Jetpack Compose and how to use them in your applications.

App Bar Bottom Navigation Button

App Bar

App bar provides a consistent layout for the top of the screen, typically used for branding, navigation, and actions. Find examples of how app bar can be implemented with different styles.

Bottom Navigation

A navigation component placed at the bottom of the screen, allowing users to quickly switch between primary destinations in an app.

Button

Checkbox Dialog Dropdown

Checkbox

A component that allows users to make a binary choice, typically used in forms and lists.

Dialog

This example demonstrates implementing two types of dialogs in Jetpack Compose: a standard AlertDialog and a customizable dialog. The DialogActivity manages dialog states, such as whether the dialog can be dismissed with a back press or outside click. The UI provides options to open these dialogs and showcases how to customize them, including setting titles, content, and buttons.

Dropdown

This code demonstrates various dropdown menu implementations in Jetpack Compose. It includes simple dropdowns, dropdowns with custom background colors, dropdowns with icons, and disabled dropdowns. The DropDownMenuActivity manages the state of these dropdowns and displays them with different configurations, offering examples of how to customize their appearance and behavior.

FAB Modal Drawer Bottom Drawer

FAB

The code showcases different styles of Floating Action Buttons (FABs) in Jetpack Compose, including simple, custom-colored, square-shaped, and extended FABs with or without icons. It uses a Scaffold layout in FloatingActionButtonActivity to manage these FABs and demonstrates customization and user interaction handling in the FabButtons composable.

Modal Drawer

A drawer that slides in from the side and overlays the content, typically used for navigation.

Bottom Drawer

A drawer that slides up from the bottom of the screen, providing additional content or actions.

Radio Button Slider Text

Radio Button

Slider

The SliderActivity demonstrates various types of sliders in Jetpack Compose, including continuous, discrete, and range sliders with custom styling. It uses remember and mutableStateOf to manage slider states within a themed UI.

Text

The Text Styles showcases different text styles in Jetpack Compose, featuring various font sizes, weights, and colors. Dive into expressive typography with headers, captions, and body text, all styled dynamically to enhance readability and visual appeal.

Textfield Theme ZoomView

Textfield

A text field that enables users to input and edit text, offering a versatile component for various forms and data entry tasks.

Theme

ThemeActivity allows users to select a color theme for the screen. It features a grid of color options that update the app's theme on selection, providing a visual preview with a checkmark to indicate the current selection.

ZoomView

ZoomViewActivity provides an interactive zoomable image view. Users can pinch to zoom and drag to pan across the image, with changes in scale and position reflected in real-time.

MagnifierView TabBar DatePicker

MagnifierView

The MagnifierViewActivity demonstrates an image with a magnifier effect that adjusts based on user touch. It uses pointerInteropFilter to update the magnifier's size and position, with a zoom factor of 2x. The magnifier follows the user's touch, enlarging the image in the touched area and disappearing when the touch is lifted.

TabBar

This code demonstrates various implementations of tab bars using Jetpack Compose, including simple text tabs, icon tabs with indicators, and more complex layouts with text, icons, indicators, and dividers. It includes both fixed and scrollable tab bars with customizable appearance and behavior.

DatePicker

A component that lets users select a date from a calendar view.

TimePicker ImagePicker ParallaxEffect

TimePicker

A component that allows users to select a specific time.

ImagePicker

A component for selecting images from the device's gallery or camera.

ParallaxEffect

A visual effect where background content moves at a different speed than foreground content, creating a sense of depth.

Compose views in Xml XML views in Compose

Compose views in Xml

We might need to migrate from XML to Jetpack Compose, but doing so all at once may not be feasible. We can achieve this gradually by embedding Compose components within XML layouts and XML views within Compose, allowing for a seamless transition.

XML views in Compose

Similar to Compose in XML we can use XML views in Compose.

Other References

Checkout some other cool stuff for components of Jetpack Compose.