Git Product home page Git Product logo

change-scene's Introduction

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. :-)

change-scene's People

Contributors

raju-android avatar rajuse avatar swapnilmusale avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.