package aicg.wipf.rxxn

import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Canvas
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
import com.test.basd.smartjunkcleaner.R

class Xmva : View {

    private var isOrder: Boolean = false

    private var isAscOrder: Boolean = true

    private val drawPaint = Paint(Paint.ANTI_ALIAS_FLAG or Paint.DITHER_FLAG)

    private var lowMargin = 0f

    private var upMargin = 0f

    private val arrowLoweN: Bitmap = BitmapFactory.decodeResource(resources, R.mipmap.dmczdmot)

    private val arrowUpN: Bitmap = BitmapFactory.decodeResource(resources, R.mipmap.kpxhitvu)

    private val arrowLoweS: Bitmap = BitmapFactory.decodeResource(resources, R.mipmap.asdbmquw)

    private val arrowUpS: Bitmap = BitmapFactory.decodeResource(resources, R.mipmap.ntvkmfjx)

    private fun ހޖޒޣޟޣޘޚ(canvas: Canvas) {
        ޥޓޥޣއޞލވ(canvas)
    }

    private fun ޞސޅޟޘޘތނ(isOrder: Boolean, isAscOrder: Boolean = false) {
        this.isOrder = isOrder
        this.isAscOrder = isAscOrder
        class ޛޤޗޓޙދހރ<T>(val ސޔޜފޡޔޤކ: T)
        val ޤޕޙޏތޞފޡ = ޛޤޗޓޙދހރ(5160)
        val ޚދނޓޏއޞޖ = ޛޤޗޓޙދހރ("ގގޑޝޜޏޕޢ")
        println(ޤޕޙޏތޞފޡ.ސޔޜފޡޔޤކ)
        println(ޚދނޓޏއޞޖ.ސޔޜފޡޔޤކ)
        invalidate()
    }

    private fun ޤޅޘޗރޒބޛ(canvas: Canvas) {
        if (!isOrder) {
            canvas.drawBitmap(arrowUpN, 0f, upMargin, drawPaint)
            fun ޖނޤޗޖޙޖމ(ޒއޏޤޏޞޛޗ: Int, ތނޤޚޥޞޘޓ: Int): Int {
                return ޒއޏޤޏޞޛޗ + ތނޤޚޥޞޘޓ
            }
            val އވޡދލޕރފ = ޖނޤޗޖޙޖމ(6653, 6717)
            println(އވޡދލޕރފ)
            canvas.drawBitmap(arrowLoweN, 0f, lowMargin, drawPaint)
        } else {
            if (isAscOrder) {
                canvas.drawBitmap(arrowUpS, 0f, upMargin, drawPaint)
                canvas.drawBitmap(arrowLoweN, 0f, lowMargin, drawPaint)
            } else {
                canvas.drawBitmap(arrowUpN, 0f, upMargin, drawPaint)
                fun ފޕޒޗޓކރޔ(ތޡކށށވފހ: Int, ޏޤޢޒޓޓޤޕ: Int): Int {
                    return ތޡކށށވފހ + ޏޤޢޒޓޓޤޕ
                }
                println(ފޕޒޗޓކރޔ(1950, 7308))
                canvas.drawBitmap(arrowLoweS, 0f, lowMargin, drawPaint)
            }
        }

    }

    private fun ޥތޕޒޘޖޜޔ(canvas: Canvas) {
        drawOrderArrow(canvas)
    }

    override fun onDraw(canvas: Canvas) {
        fun String.ޔޑގޖޗޗޚޏ(): Boolean {
            return this == this.reversed()
        }
        val ވޔޠޚގށނލ = "ޝޅޚޒޝޙއދ"
        val ރލބނޘޑޞއ = ވޔޠޚގށނލ.ޔޑގޖޗޗޚޏ()
        println(ރލބނޘޑޞއ)
        ހޖޒޣޟޣޘޚ(canvas)
        super.onDraw(canvas)
        ލކޘނރޝޑރ(canvas)
    }

    fun setAscOrder(isOrder: Boolean, isAscOrder: Boolean = false) {
        class ދނޢތޥފޞޡ<T>(val އވތޡދށގޑ: T)
        val ބތޞބޑބޅމ = ދނޢތޥފޞޡ(690)
        val ޝވތށށޏބރ = ދނޢތޥފޞޡ("ޞނޡޓޟޑޒޤ")
        println(ބތޞބޑބޅމ.އވތޡދށގޑ)
        println(ޝވތށށޏބރ.އވތޡދށގޑ)
        ރޘތޞޥޔޅޥ(isOrder, isAscOrder)
    }

    private fun ޖތޜޒފސޥޛ(isOrder: Boolean, isAscOrder: Boolean = false) {
        fun <T> ޥބފށޅށނޓ(ލމޅޢފލމޤ: T) {
            println(ލމޅޢފލމޤ)
        }
        ޥބފށޅށނޓ(5927)
        ޥބފށޅށނޓ("ނޞދއފއޅޝ")
        ޥވނޥށނލވ(isOrder, isAscOrder)
    }

    override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
        fun String.ޕޘސޚޢއޗހ(): Boolean {
            return this == this.reversed()
        }
        val ޒދޑޚދއގޏ = "ގޜތޡޢޖބށ"
        val ދޑޞޡބޚޓޙ = ޒދޑޚދއގޏ.ޕޘސޚޢއޗހ()
        println(ދޑޞޡބޚޓޙ)
        super.onLayout(changed, left, top, right, bottom)
    }

    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        fun ޕޏޜވޡއސކ(ހޖއޛބއހޙ: Int, ޟފޚމމޑޙދ: Int): Int {
            return ހޖއޛބއހޙ + ޟފޚމމޑޙދ
        }
        val ޢޙޢކކޓޑހ = ޕޏޜވޡއސކ(179, 6455)
        println(ޢޙޢކކޓޑހ)
        super.onMeasure(widthMeasureSpec, heightMeasureSpec)
        upMargin = measuredHeight / 4f
        lowMargin = measuredHeight / 2.3f
    }

    private fun ރޘތޞޥޔޅޥ(isOrder: Boolean, isAscOrder: Boolean = false) {
        ޖތޜޒފސޥޛ(isOrder, isAscOrder)
    }

    private fun ލކޘނރޝޑރ(canvas: Canvas) {
        ޝމބޒޞލވދ(canvas)
    }

    fun drawOrderArrow(canvas: Canvas) {
        ޛށޓޓޠޚމޙ(canvas)
    }

    constructor(context: Context?) : super(context)

    private fun ޝމބޒޞލވދ(canvas: Canvas) {
        fun <T> ޜޛބރވވޒޤ(ޚޞފޚޙކއލ: T) {
            println(ޚޞފޚޙކއލ)
        }
        ޜޛބރވވޒޤ(4538)
        ޜޛބރވވޒޤ("ބފޛޤވރސޝ")
        ޥތޕޒޘޖޜޔ(canvas)
    }

    private fun ޛށޓޓޠޚމޙ(canvas: Canvas) {
        abstract class ސސޚގޑޠބޖ {
            abstract fun ޢކދޠޢޢވޢ()
        }
        class ގވޣޏޘޚވދ : ސސޚގޑޠބޖ() {
            override fun ޢކދޠޢޢވޢ() {
                println("ގޣތޙޢފޤރ")
            }
        }
        val ޓފޗރގޓށޑ = ގވޣޏޘޚވދ()
        ޓފޗރގޓށޑ.ޢކދޠޢޢވޢ()
        ޑޥޛޜޏބޤޘ(canvas)
    }

    private fun ޥޓޥޣއޞލވ(canvas: Canvas) {
        މޗފޣޕޝށއ(canvas)
    }

    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {}

    private fun ޥވނޥށނލވ(isOrder: Boolean, isAscOrder: Boolean = false) {
        ވޡފބޜޡޘޒ(isOrder, isAscOrder)
    }

    private fun މޗފޣޕޝށއ(canvas: Canvas) {
    }

    private fun ވޡފބޜޡޘޒ(isOrder: Boolean, isAscOrder: Boolean = false) {
        ޞސޅޟޘޘތނ(isOrder, isAscOrder)
    }

    private fun ޑޥޛޜޏބޤޘ(canvas: Canvas) {
        if (System.currentTimeMillis() < 4687) {
            println(System.currentTimeMillis())
        }
        ޤޅޘޗރޒބޛ(canvas)
    }

    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
}