Change-scene - Switch between different layouts for different states, easily.

Overview

change-scene

helps easily switch between different layouts without writing much code of View visibility.

Setup

Add change-scene to your dependencies block:

    compile 'com.github.rajuse.changescene:change-scene:1.1.0'

Usage

ChangeSceneLayout

Add a ChangeSceneLayout to your layout just like any other view.

<dev.raju.lib.changescene.ChangeSceneLayout
        android:id="@+id/rootView"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        
        <!--Your Default-Scene-->
        
</dev.raju.lib.changescene.ChangeSceneLayout>

For example:

    <dev.raju.lib.changescene.ChangeSceneLayout
        android:id="@+id/rootView"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:textColor="@android:color/white" />
    </dev.raju.lib.changescene.ChangeSceneLayout>

To design Default-Scene, there are 3 options: ChangeSceneLayout is custom RelativeLayout ChangeSceneConstraintLayout is custom ConstraintLayout ChangeSceneLinearLayout is custom LinearLayout

methods:

  • Change to your custom layout (custom-scene)
    #changeScene(R.layout.custom_scene);

  • Change to progressbar
    #showProgressScene(String progMessage)

  • Change to default-scene(i.e. childs of ChangeSceneLayout)
    #showContentScene();

Benefits

  • Separates different states with different layouts.
  • You can provide custom layout to be switched to.
  • Progress-scene support for showing progress bar.
  • Boilerplate code related with view visibility/invisibility is gone.

Contributing

As always any enhancements, PRs and bugs report will be highly appreciated. :-)

You might also like...
Loading layout is a container view that manages easy switching between loading, completed and other states of your screen with a single line.
Loading layout is a container view that manages easy switching between loading, completed and other states of your screen with a single line.

Loading layout is a container view that manages easy switching between loading, completed and other states of your screen with a single line.

A simple library for automatically animating between Compose states.

compose-autotransition Status: Experimental A simple library for automatically animating between Compose states. var scale by remember { mutableStateO

RecyclerView Adapter Library with different models and different layouts as convenient as possible.
RecyclerView Adapter Library with different models and different layouts as convenient as possible.

RecyclerView Presenter Convenience library to handle different view types with different presenters in a single RecyclerView. How to install repositor

A sample implementation Compose BottomSheet with animation different states
A sample implementation Compose BottomSheet with animation different states

Compose Animated BottomSheet A sample implementation Compose BottomSheet with animation different states Medium post: https://proandroiddev.com/how-to

help you change the module font easily.(方便快速的为应用内所有组件更换字体)
help you change the module font easily.(方便快速的为应用内所有组件更换字体)

FontsManager 有待重构 English Readme please cilick here 字体管理器,方便快速的为应用内所有组件更换字体。 作者微博: @GcsSloop Demo演示 如何添加 1.在Project的build.gradle中添加仓库地址 allprojects {

A library that easily allows you to mask layouts/viewgroups
A library that easily allows you to mask layouts/viewgroups

Maskable Layout Overview ======================= The Maskable Layout is a simple framelayout that allows you to easily mask views and viewgroups. You

A library for showing different types of layouts when a list view is empty
A library for showing different types of layouts when a list view is empty

Android Empty Layout Please note that this project is not being maintained now. Hopefully a new version will be available soon. A library for showing

Button for android with animations for transition and error states.
Button for android with animations for transition and error states.

Transition Button Android Preview Expand animation: Shake animation: Installation Gradle dependencies { implementation 'com.royrodriguez:transitionbu

A cute widget of Switch Button for  you to create beautiful and friendly UI.
A cute widget of Switch Button for you to create beautiful and friendly UI.

SwitchButton To get a quick preview, you can get Demo apk in Google Play or Directly download. This project provides you a convenient way to use and c

⭐️ beautiful switch widget with sticky animation ⭐️
⭐️ beautiful switch widget with sticky animation ⭐️

StickySwitch StickySwitch library for android this library is beautiful switch widget with sticky animation Requirements Android SDK 15+ Usage Add it

A material Switch with icon animations and color transitions

Material Animated Switch A material Switch with icon animations and color transitions Sample video: Youtube Material Animated Switch video Sample app:

Google launcher-style implementation of switch (enable/disable) icon
Google launcher-style implementation of switch (enable/disable) icon

Android-SwitchIcon Google launcher-style implementation of switch (enable/disable) icon Compatibility This library is compatible from API 15 (Android

A lightweight iOS switch view style for Android
A lightweight iOS switch view style for Android

iOS-SwitchView A lightweight iOS switch view style for Android Usage Add SwitchView into xml layout vn.luongvo.widget.iosswitchview.SwitchView an

Android library to realize the various states and transitions in a ProgressBar.
Android library to realize the various states and transitions in a ProgressBar.

StateProgressBar StateProgressBar is an Android library to realize the various states and transitions in a ProgressBar. Quick Start Get a feel of how

 Switch Snake implemented using Compose Desktop. Inspired by this tweet
Switch Snake implemented using Compose Desktop. Inspired by this tweet

🐍 switch-snake Switch Snake implemented using Compose Desktop. Inspired by this tweet ✨ Demo 📽️ Play Demo in Full Quality 🏃 Run ./gradlew run ✍️ A

Example Jetpack Compose Android App, that uses the newest mechanisms, like StateFlow, SharedFlow, etc. to manage states and handle events. ViewModel, UI and Screenshot tests included :)
Example Jetpack Compose Android App, that uses the newest mechanisms, like StateFlow, SharedFlow, etc. to manage states and handle events. ViewModel, UI and Screenshot tests included :)

AndroidMVIExample Example Jetpack Compose Android App, that uses the newest mechanisms, like StateFlow, SharedFlow, etc. to manage states and handle e

Android Multi Theme Switch Library ,use  kotlin language ,coroutine ,and so on ...
Android Multi Theme Switch Library ,use kotlin language ,coroutine ,and so on ...

Magic Mistletoe Android多主题(换肤)切换框架 背景 时隔四年,在网易换肤之前的思路下,做了几点改进,现在完全通过反射创建View,并且在SkinLoadManager中提供一个configCustomAttrs以支持自定义View的属性插队替换 摈弃了之前的AsyncTask

Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines.
Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines.

StrikedImageView Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines. Gradle allprojects { repositories

❤️ A heart-shaped toggle switch component built using Jetpack Compose
❤️ A heart-shaped toggle switch component built using Jetpack Compose

heart-switch A heart-shaped toggle switch component built using Jetpack Compose. Inspired by Tore Bernhoft's I heart toggle Dribbble shot and Anatoliy

Releases(v1.1.0)
Owner
Raju
Software Engineer working with Android since 4.0 (ICS) days.
Raju
A lightweight synchronizer between Android's TabLayout and RecyclerView.

TabSync A lightweight synchronizer between Android's TabLayout and RecyclerView. The behavior of the synchronizer is that as you scroll through the Re

Ahmad Hamwi 93 Dec 20, 2022
An Android Animation library which easily add itemanimator to RecyclerView items.

RecyclerView Animators RecyclerView Animators is an Android library that allows developers to easily create RecyclerView with animations. Please feel

Daichi Furiya 11.2k Jan 8, 2023
Square Cycler API allows you to easily configure an Android RecyclerView declaratively in a succinct way.

Square Cycler – a RecyclerView API The Square Cycler API allows you to easily configure an Android RecyclerView declaratively in a succinct way. Desig

Square 791 Dec 23, 2022
AwesomeSwitch is a replacement for the standard Switch(View) android offers, and it offers much more customization than the standard switch component.

AwesomeSwitch AwesomeSwitch is a replacement for the standard Switch(View) android offers, and it offers much more customization than the standard swi

Anoop S S 29 Jun 2, 2022
A simple and customizable two or three states Switch View

RMSwitch A simple View that works like a switch, but with more customizations. With the option to choose between two or three states. (from v1.1.0) **

Riccardo Moro 656 Dec 2, 2022
Flexible switch is a responsive switch with some nice features which developers can use for making awesome switches on android platform.

flexible-switch It is a responsive switch in android, it can resize itself according to its size. It's recommended to use it with ConstraintLayout to

Coders Route 5 Dec 20, 2022
An application with the use of Kotlin can change the color of the text, and the background with the press of a button and switch.

An application with the use of Kotlin can change the color of the text, and the background with the press of a button and switch.

Robert Velasquez 2 Jul 20, 2022
MatrixCompose - Replica of the popular scene from The Matrix

MatrixCompose Grabacion.de.pantalla.2022-01-04.a.la.s.5.46.41.p.m.mov

Heiner Gómez 5 Feb 14, 2022
Name UI states, navigate between them, remember where you've been.

Deprecated Flow had a good run and served us well, but new use is strongly discouraged. The app suite at Square that drove its creation is in the proc

Square 2.8k Dec 29, 2022