package com.quansu.heifengwuliu.activity

import android.os.Bundle
import android.view.ViewGroup
import com.qmuiteam.qmui.util.QMUIDisplayHelper
import com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView
import com.qmuiteam.qmui.widget.grouplist.QMUIGroupListView
import com.quansu.heifengwuliu.R
import com.quansu.heifengwuliu.base.MBActivity
import com.quansu.heifengwuliu.databinding.ActivityAboutBinding
import com.ysnows.base.base.BRepository
import com.ysnows.base.base.BViewModel
import com.ysnows.base.utils.B

open class AboutActivity : MBActivity<BViewModel<BRepository>, ActivityAboutBinding>() {

    override fun initCreate(savedInstanceState: Bundle?) {
        super.initCreate(savedInstanceState)

        val privatePolicyItem: QMUICommonListItemView = binding.layGroupList.createItemView(
                null,
                getString(R.string.private_policy),
                null,
                QMUICommonListItemView.HORIZONTAL,
                QMUICommonListItemView.ACCESSORY_TYPE_NONE)

        val userPolicyItem: QMUICommonListItemView = binding.layGroupList.createItemView(
                null,
                getString(R.string.user_policy),
                null,
                QMUICommonListItemView.HORIZONTAL,
                QMUICommonListItemView.ACCESSORY_TYPE_NONE)


        val size: /*@@dmnjhl@@*/Int = QMUIDisplayHelper.dp2px(context(), 20)
        QMUIGroupListView.newSection(context())
                .setLeftIconSize(size, ViewGroup.LayoutParams.WRAP_CONTENT)
                .addItemView(privatePolicyItem) {
                    bundle(WebViewActivity::class.java, B.with().putString("url", "http://www.baidu.com").ok())
                }
                .addItemView(userPolicyItem) {
                    bundle(WebViewActivity::class.java, B.with().putString("url", "http://www.baidu.com").ok())
                }
                .setMiddleSeparatorInset(QMUIDisplayHelper.dp2px(context(), 16), 0)
                .addTo(binding.layGroupList)
    }

    override fun title(): String? {
        return getString(R.string.about)

    }

    override fun binding(): ActivityAboutBinding {
        return ActivityAboutBinding.inflate(layoutInflater)
    }

}


