// 日涨跌幅,0为降序,1为升序 public void clickRange(View v) { if (rangeType == 1) { ivRange.setImageResource(R.drawable.down); rangeType = 0; } else { ivRange.setImageResource(R.drawable.up); rangeType = 1; } MyAdapter myAdapter = null; fundList = Tools.findFundByRangeType(fundList, rangeType); if ("All".equals(typeName)) { myAdapter = new MyAdapter(MainActivity.this, R.layout.my_base_item, fundList, netValueType); } else { fundList2 = Tools.findFundByTypeName(fundList, typeName); fundList2 = Tools.findFundByRangeType(fundList2, rangeType); myAdapter = new MyAdapter(MainActivity.this, R.layout.my_base_item, fundList2, netValueType); } lv_fundinfo.setAdapter(myAdapter); }
public void clickTypeName(String typeName) { this.typeName = typeName; fundList2 = fundList; if (!typeName.equals("All")) { fundList2 = Tools.findFundByTypeName(fundList2, typeName); } MyAdapter myAdapter = new MyAdapter(MainActivity.this, R.layout.my_base_item, fundList2, netValueType); lv_fundinfo.setAdapter(myAdapter); }
// 最新净值/累计净值 public void clickNet(View v) { if (netValueType == 1) { btNetValue.setText("最新净值 "); ivNetValue.setImageResource(R.drawable.left2); netValueType = 0; } else { btNetValue.setText("累计净值 "); ivNetValue.setImageResource(R.drawable.right2); netValueType = 1; } MyAdapter myAdapter = null; if ("All".equals(typeName)) { myAdapter = new MyAdapter(MainActivity.this, R.layout.my_base_item, fundList, netValueType); } else { fundList2 = Tools.findFundByTypeName(fundList, typeName); myAdapter = new MyAdapter(MainActivity.this, R.layout.my_base_item, fundList2, netValueType); } lv_fundinfo.setAdapter(myAdapter); }