package com.yidian.shenghuoquan.newscontent.ui

import android.os.Bundle
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
import com.yidian.common.XRouterPathConstants.Companion.STORE_MANAGEMENT
import com.yidian.common.base.BaseActivity
import com.yidian.shenghuoquan.newscontent.adapter.StoreAdapter
import com.yidian.shenghuoquan.newscontent.bean.StoreDataList
import com.yidian.shenghuoquan.newscontent.databinding.ActivityStoreManagementBinding

/**
 * Author: sym
 * Date: 2021/6/22 10:25 AM
 * Describe:
 */
class StoreManagementActivity : BaseActivity<ActivityStoreManagementBinding>() {
  override fun createViewBinding(): ActivityStoreManagementBinding {
    return ActivityStoreManagementBinding.inflate(layoutInflater)
  }

  override fun getXPageName(): String {
    return STORE_MANAGEMENT
  }

  override fun init(savedInstanceState: Bundle?) {
    super.init(savedInstanceState)
    val layoutManager = LinearLayoutManager(this)
    layoutManager.orientation = LinearLayoutManager.VERTICAL
    viewBind.storeList.layoutManager = layoutManager

    val adapter = StoreAdapter(this, StoreDataList.data)
    viewBind.storeList.adapter = adapter

    viewBind.addStoreBtn.setOnClickListener {
      Toast.makeText(this@StoreManagementActivity, "StoreManagementActivity", Toast.LENGTH_SHORT).show()
    }

  }
}
