lmw
2024-07-09 b13afc751dbbce24753d008f1f87d2c5e133a4ad
app/src/main/java/com/dollearn/student/ui/shop/ShopFragment.kt
@@ -1,5 +1,8 @@
package com.dollearn.student.ui.shop
import android.content.Context
import android.view.inputmethod.InputMethodManager
import androidx.core.content.ContextCompat.getSystemService
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import cn.sinata.xldutils.fragment.BaseFragment
@@ -56,6 +59,8 @@
        }
        tv_search.setOnClickListener {
            (requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager)
                .hideSoftInputFromWindow(requireActivity().currentFocus!!.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
            if (refreshLayout.isRefreshing)
                return@setOnClickListener
            search = et_search.text.toString()
@@ -78,7 +83,7 @@
    }
    private fun getGoods(){
        HttpManager.goodListStudy(page,search,goodsTypes.filter { it.checked }.map { it.name }).requestByF(this,success = {_,data->
        HttpManager.goodListStudy(page,search,goodsTypes.filter { it.checked }.map { it.id.toString() }).requestByF(this,success = {_,data->
            if (page == 1)
                goods.clear()
            goods.addAll(data ?.records?: arrayListOf())