Home

Awesome

PrettyStateView

Android Arsenal

PrettyStateView is a light library to set view states such as Loading , Error , Empty or even Custom views you make with just one line without using any XMLs

<img src="https://github.com/Tripl3Dev/PrettyStateView/blob/master/states.gif">

Installation

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
	dependencies {
           implementation 'com.github.Rohyme:PrettyStateView:3.0.0'	
   	}

Usage

You must use one of them after intializing StateConfigFactory

  var stateView =  SetState(StateConstantType : Integer) : View
  stateView.setOnClickListener{
   Toast.makeText(this,"On Whole view clicked do ....",Toast.LENGTH_SHORT).show()
  }
  
  // Or find specific view and do action on it 
  stateView.findViewById<TextView>(R.id.textError).apply {
           text = "Error Message"		 // Set Your error text 
           // set on click listener to the view
       setOnClickListener {
               Toast.makeText(this@MainActivity, "view error state clicked", Toast.LENGTH_SHORT).show()
           }
       }

Contributors

Mahmoud Abdelaal Mahmoud

Applications using prettyStateView

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.