如何使用rangeseekbar按价格范围过滤回收商列表视图?

时间:2019-04-15 07:15:21

标签: java android android-recyclerview filtering rangeseekbar

我在recyclerview中有一个项目列表。这些项目包含名称,价格等。我想过滤该列表,例如,如果用户通过rangeeekbar从1200到5000选择价格范围,它应该只显示该价格范围内的项目。已将bottomsheetfragment用于rangeeekbar

quill.getLeaf(index)

这是我在底页中创建的rangeeekbar

  price.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getContext());

            LayoutInflater factory1 = LayoutInflater.from(getContext());
            View view1 = factory1.inflate(R.layout.range_seekbar, null);
            final CrystalRangeSeekbar rangeseekbar = (CrystalRangeSeekbar) view1.findViewById(R.id.rangeSeekbarprice);
            rangeseekbar.setMinValue(0);
            rangeseekbar.setMaxValue(10000);

            final TextView tvMin = (TextView) view1.findViewById(R.id.pricetextmin);
            final TextView tvMax = (TextView) view1.findViewById(R.id.pricetextmax);
            final Button okBtn=(Button)view1.findViewById(R.id.ok_btn_seekbar);
            tvMin.setText("$ "+"0");
            tvMax.setText("$ "+"10000");


            alertDialogBuilder.setView(view1);
            rangeseekbar.setOnRangeSeekbarChangeListener(new OnRangeSeekbarChangeListener() {
                @Override
                public void valueChanged(Number minValue, Number maxValue) {
                    tvMin.setText("$ "+rangeseekbar.getSelectedMinValue());

                    tvMax.setText("$ "+rangeseekbar
                    .getSelectedMaxValue());


                }
            });

这是用于过滤,但不起作用

0 个答案:

没有答案