connect微调器和recycleview中的textview

1sbrub3j  于 2021-07-08  发布在  Java
关注(0)|答案(0)|浏览(214)

我有带微调器的循环视图(它显示对象的大小),但我想用textview(price)连接它,因此,如果我选择大小,我想更改price文本视图这是我的适配器:

public void onBindViewHolder(@NonNull sliderAdapterViewHolder holder, int position) {
        dialogSliderList currentItem = list.get(position);
        holder.title.setText(currentItem.getTitle());
        holder.desc.setText(currentItem.getDesc());
        holder.starSlider.setImageResource(currentItem.getStarSlider());
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(mContext,
                android.R.layout.simple_spinner_item, currentItem.getSize());
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        holder.spinner.setAdapter(adapter);
        holder.spinner.setOnItemSelectedListener(this);
        selectedItem = holder.spinner.getSelectedItem().toString();
        holder.price.setText(currentItem.getPrice()[holder.spinner.getSelectedItemPosition()]);

    }

List for adapter :
    String [] ss={"size 1","size 2"};
    String [] ss2={"size 3","size 4"};
    String [] ps1={"price 1","price2"};
    String [] ps2={"price 3","price4"};

 sliderList.add(new dialogSliderList("Каролина", "Доставка в течение 7 рабочих дней", R.drawable.empty_star
                , ps1, 0,ss));
        sliderList.add(new dialogSliderList("Тест", "Доставка в течение 7 рабочих дней", R.drawable.empty_star
                , ps2, 0,ss2));

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题