fix: 修复看图出现双重进度条
This commit is contained in:
parent
d5590dabe0
commit
2ca8738ecc
|
@ -11,7 +11,6 @@ import android.os.Bundle
|
|||
import android.os.Handler
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
|
@ -37,8 +36,6 @@ import retrofit2.Response
|
|||
import java.util.*
|
||||
|
||||
class PhotoViewActivity : BaseActivity(), OnChangeBottomBarVisibilityListener, Toolbar.OnMenuItemClickListener {
|
||||
@BindView(R.id.progressBar)
|
||||
lateinit var progressBar: ProgressBar
|
||||
@BindView(R.id.counter)
|
||||
lateinit var mCounter: TextView
|
||||
@BindView(R.id.bottom_app_bar)
|
||||
|
@ -63,14 +60,12 @@ class PhotoViewActivity : BaseActivity(), OnChangeBottomBarVisibilityListener, T
|
|||
|
||||
private fun loadMore() {
|
||||
if (loadFinished) {
|
||||
progressBar.visibility = View.GONE
|
||||
return
|
||||
}
|
||||
if (mLoading) {
|
||||
return
|
||||
}
|
||||
mLoading = true
|
||||
progressBar.visibility = View.VISIBLE
|
||||
val lastBean = photoViewBeans[photoViewBeans.size - 1]
|
||||
getInstance().picPage(
|
||||
forumId!!,
|
||||
|
@ -84,7 +79,6 @@ class PhotoViewActivity : BaseActivity(), OnChangeBottomBarVisibilityListener, T
|
|||
override fun onResponse(call: Call<PicPageBean?>, response: Response<PicPageBean?>) {
|
||||
val data = response.body()!!
|
||||
mLoading = false
|
||||
progressBar.visibility = View.GONE
|
||||
amount = data.picAmount ?: "${photoViewBeans.size}"
|
||||
updateCounter(mViewPager.currentItem)
|
||||
val picBeans: MutableList<PicPageBean.PicBean> = ArrayList()
|
||||
|
@ -121,7 +115,6 @@ class PhotoViewActivity : BaseActivity(), OnChangeBottomBarVisibilityListener, T
|
|||
|
||||
override fun onFailure(call: Call<PicPageBean?>, t: Throwable) {
|
||||
mLoading = false
|
||||
progressBar.visibility = View.GONE
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -172,7 +165,6 @@ class PhotoViewActivity : BaseActivity(), OnChangeBottomBarVisibilityListener, T
|
|||
}
|
||||
})
|
||||
if (isFrs) {
|
||||
progressBar.visibility = View.VISIBLE
|
||||
loadFrs()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,14 +7,6 @@
|
|||
android:id="@+id/background"
|
||||
android:background="@color/black"
|
||||
tools:context=".activities.PhotoViewActivity">
|
||||
<com.huanchengfly.tieba.widgets.theme.TintProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="center"
|
||||
app:progressTint="@color/default_color_accent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.AppCompat.ProgressBar"/>
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:orientation="horizontal"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
|
|
Loading…
Reference in New Issue