//package com.mime.dualscreenview.dialog
//
//import android.app.Dialog
//import android.content.Context
//import android.content.DialogInterface
//import android.graphics.Color
//import android.os.Bundle
//import android.view.LayoutInflater
//import android.view.View
//import android.view.ViewGroup
//import android.view.Window
//import android.widget.TextView
//import androidx.recyclerview.widget.GridLayoutManager
//import androidx.recyclerview.widget.RecyclerView
//import com.mime.dualscreenview.R
//import kotlin.random.Random
//
//interface StyleSelectInterface {
//    fun onSelectStyle(bgColor : String, textColor : String)
//}
//class Stylez : Dialog {
//    constructor(context: Context) : super(context) {initView(context)}
//    constructor(context: Context, themeResId: Int) : super(context, themeResId) {initView(context)}
//    constructor(
//        context: Context,
//        cancelable: Boolean,
//        cancelListener: DialogInterface.OnCancelListener?
//    ) : super(context, cancelable, cancelListener) {initView(context)}
//
//    var styleSelectInterface : StyleSelectInterface? = null
//
//    fun initView(context: Context) {
//
//    }
//
//    override fun onCreate(savedInstanceState: Bundle?) {
//        super.onCreate(savedInstanceState)
//        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//        setCancelable(true)
//        setContentView(R.layout.dialog_stylesz)
//        val recyclerView: RecyclerView = findViewById(R.id.stylez_recyclerview)
//        val adapterRe = AdapterRe(context, colorz)
//        recyclerView.adapter = adapterRe
//        recyclerView.layoutManager =
//            GridLayoutManager(context, 2, GridLayoutManager.VERTICAL, false)
//    }
//
//    inner class AdapterRe(ctx: Context, myImageNameList: Array<Array<String>>) :
//        RecyclerView.Adapter<StylezViewHolder>() {
//        private val inflater: LayoutInflater
//        private val myImageNameList: Array<Array<String>>
//        private val ctx : Context
//        init {
//            inflater = LayoutInflater.from(ctx)
//            this.ctx = ctx
//            this.myImageNameList = myImageNameList
//        }
//
//        override fun onCreateViewHolder (
//            parent: ViewGroup,
//            viewType: Int
//        ): StylezViewHolder {
//            val view: View = inflater.inflate(R.layout.item_colorz, parent, false)
//            return StylezViewHolder(view)
//        }
//
//        override fun onBindViewHolder(holder: StylezViewHolder, position: Int) {
//            var colorz = myImageNameList.get(position)
//            var sampleTextz = ctx.resources.getStringArray(R.array.sample_textz)
//            holder?.setStyle(bgColor = colorz.get(1), textColor = colorz.get(0),sampleTextz.get(Random.nextInt(9876) % sampleTextz.size))
//        }
//
//
//        override fun getItemCount(): Int {
//            return myImageNameList.size
//        }
//
//    }
//
//    inner class StylezViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
//        var textView: TextView
//        var bg : View
//        init {
//            textView = itemView.findViewById(R.id.textview_sample)
//            bg = itemView.findViewById(R.id.bg_sample)
//        }
//        fun setStyle(bgColor : String, textColor : String, sampleText : String ) {
//            bg.setBackgroundColor(Color.parseColor(bgColor))
//            textView.setTextColor(Color.parseColor(textColor))
//            textView.text = sampleText
//            itemView?.setOnClickListener { v ->
//                styleSelectInterface?.onSelectStyle(bgColor,textColor)
//                dismiss()
//            }
//        }
//    }
//}