Remove obsolete code
parent
f38ff55aea
commit
b1a94c0f34
@ -1,25 +0,0 @@
|
|||||||
package org.koitharu.kotatsu.utils.ext
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import android.widget.ProgressBar
|
|
||||||
import androidx.core.view.isVisible
|
|
||||||
import androidx.core.widget.ContentLoadingProgressBar
|
|
||||||
import com.google.android.material.progressindicator.BaseProgressIndicator
|
|
||||||
|
|
||||||
fun ProgressBar.setProgressCompat(progress: Int, animate: Boolean) = when {
|
|
||||||
this is BaseProgressIndicator<*> -> setProgressCompat(progress, animate)
|
|
||||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.N -> setProgress(progress, animate)
|
|
||||||
else -> setProgress(progress)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun ProgressBar.showCompat() = when (this) {
|
|
||||||
is BaseProgressIndicator<*> -> show()
|
|
||||||
is ContentLoadingProgressBar -> show()
|
|
||||||
else -> isVisible = true
|
|
||||||
}
|
|
||||||
|
|
||||||
fun ProgressBar.hideCompat() = when (this) {
|
|
||||||
is BaseProgressIndicator<*> -> hide()
|
|
||||||
is ContentLoadingProgressBar -> hide()
|
|
||||||
else -> isVisible = false
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<FrameLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/list_footer_height_outer">
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
|
||||||
android:id="@+id/progressBar"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:indeterminate="true"
|
|
||||||
app:indicatorSize="24dp"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<FrameLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:paddingBottom="?actionBarSize">
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:indeterminate="true" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
@ -1,15 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/list_footer_height_outer">
|
android:layout_height="@dimen/list_footer_height_outer">
|
||||||
|
|
||||||
<ProgressBar
|
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
android:layout_width="@dimen/list_footer_height_inner"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/list_footer_height_inner"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:padding="8dp"/>
|
app:indicatorSize="24dp" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|||||||
Loading…
Reference in New Issue