Advertisement

Responsive Advertisement

Swipe To Refresh Loading layout [May Try When It doesn't allow in activity_main file]

  •  Implement below code in gradle module in dependency section👇and sync now.
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
  •  <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
    android:id="@+id/progress"
    android:visibility="visible"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <LinearLayout
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="wrap_content">

    // Here you can add more views.
    </LinearLayout>
    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
  • If You Want On Click you may write code in main java or particular layout java file
ab.progress.setRefreshing(true); //Here ab is mainactivity binding object

Post a Comment

0 Comments