Crosslight Android Material introduces a wealth of pre-built view components and APIs that make it easy and simple for you to define views in Android projects. In a nutshell, there are two kind of view components in Crosslight Android Material: Activity and Fragment components. The following illustration overviews the concepts and major view components introduced in Crosslight Android Material.
Crosslight Android Material brings a better view design pattern that emphasizes clear role and separation-of-concern between Activity and Fragment. Activity is now designed to represent view containers while Fragment is used to represent view content. The improved design pattern eliminates the confusion of having multiple view contexts for a single screen, and more importantly, addressed the complexity in determining when to use Activity or Fragment.
This page provides a comprehensive overview of the Activity and Fragment components available in Crosslight Android Material.
Crosslight Android provides several Activity components that you can use depending on the type of your apps. Please refer to the following table to understand which Activity class to choose in your Android apps.
Provides a single view container. Learn more.
Provides a navigation drawer container. Learn more.
Provides search view and result container. Learn more.
You typically inherit from these activities for the main view and root views in your apps. In addition, Crosslight also includes a specialized activity such as SearchActivity which can be used to present a search screen that contains search view and its underlying result. In the case where your application has multiple root views such as in Login and Home (which shown after login), then you will need to use activities for Login and Home. For everything else, you can use fragments instead.
With the improved view pattern in Crosslight Android Material, it becomes clear that activities are used only for containers while all view content should be defined with fragments. Crosslight Android Material provides a comprehensive fragment classes that you can directly use, such as shown in the following list.
Fragment without predefined layout, provides comprehensive APIs for customization. Learn More.
Fragment with predefined list layout, inherits from FragmentBase. Learn more.
Fragment with predefined list layout with built-in search capability. Learn more.
Fragment with predefined grid layout and customizable rows. Learn more.
Fragment with predefined form builder, inherits from FragmentBase. Learn more.
Fragment with predefined detail layout, inherits from FragmentBase. Learn more.
Fragment with predefined view pager layout, inherits from FragmentBase.
Fragment with predefined image slider layout, inherits from FragmentBase.
Fragment with predefined tab layout, inherits from FragmentBase.
Fragment with predefined master detail layout featuring shared toolbar and automatic detail navigation, inherits from FragmentBase. Learn more.
Fragment with predefined master detail layout featuring independent toolbar and automatic detail navigation, inherits from FragmentBase. Learn more.
Fragment with predefined map layout, inherits from FragmentBase. Learn more.
Exploring working samples is often the fastest and most effective way to learn and get started with Crosslight Android Material. Please check out the following samples (recommended in order from top to bottom):