This library provides an easier way to manage your progress,content and error layouts so you dont have to nest layouts under layouts
implementation โcom.klepto:easynetworkviews:1.0.0โ
Add the xml to your root layout
<com.klepto.easynetworkviews.EasyNetworkViews android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/easyViews"/>
Now in your class file use
easyViews.setContentLayout(R.layout.content) easyViews.showProgress(true) Thread { Thread.sleep(2000) runOnUiThread { easyViews.showContent() } }.start()
It will throw an error if you have not set your content layout. It has a default error layout that just shows a toast message and a basic progress layout.