pull/433/head
gedoor 4 years ago
parent 3ec4ce4524
commit 34fea0ce5d
  1. 22
      app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt
  2. 5
      app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt
  3. 6
      app/src/main/java/io/legado/app/ui/widget/image/CircleImageView.kt

@ -18,9 +18,13 @@ import io.legado.app.utils.dp
* Created by Victor on 2015/4/28.
*/
@Suppress("MemberVisibilityCanBePrivate")
class RotateLoading : View {
class RotateLoading @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : View(context, attrs, defStyleAttr) {
private lateinit var mPaint: Paint
private var mPaint: Paint
private var loadingRectF: RectF? = null
private var shadowRectF: RectF? = null
@ -55,19 +59,7 @@ class RotateLoading : View {
private val hidden = Runnable { this.stopInternal() }
constructor(context: Context) : super(context) {
initView(context, null)
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
initView(context, attrs)
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
initView(context, attrs)
}
private fun initView(context: Context, attrs: AttributeSet?) {
init {
loadingColor = context.accentColor
thisWidth = DEFAULT_WIDTH.dp
shadowPosition = DEFAULT_SHADOW_POSITION.dp

@ -13,7 +13,10 @@ import io.legado.app.R
import kotlinx.android.synthetic.main.view_dynamic.view.*
@Suppress("unused")
class DynamicFrameLayout(context: Context, attrs: AttributeSet?) : FrameLayout(context, attrs), ViewSwitcher {
class DynamicFrameLayout @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : FrameLayout(context, attrs), ViewSwitcher {
private var errorView: View? = null
private var errorImage: AppCompatImageView? = null

@ -25,8 +25,10 @@ import kotlin.math.min
import kotlin.math.pow
@Suppress("unused", "MemberVisibilityCanBePrivate")
class CircleImageView(context: Context, attrs: AttributeSet) :
AppCompatImageView(context, attrs) {
class CircleImageView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : AppCompatImageView(context, attrs) {
private val mDrawableRect = RectF()
private val mBorderRect = RectF()

Loading…
Cancel
Save