IndexableRecyclerView icon indicating copy to clipboard operation
IndexableRecyclerView copied to clipboard

热门和 定位顺序问题

Open 643063150 opened this issue 7 years ago • 0 comments

` for (int i = 0; i < hotCityEnerty.getList().size(); i++) { CityEntity cityEntity=new CityEntity(); cityEntity.setName(hotCityEnerty.getList().get(i).getCityName()); cityEntity.setId(hotCityEnerty.getList().get(i).getCityID()); list.add(cityEntity); } mHotCityAdapter = new SimpleHeaderAdapter<>(adapter, "热", "热门城市", list); // 热门城市 indexableLayout.addHeaderAdapter(mHotCityAdapter); } else { Toast.makeText(CityListActivity.this, cityListEnerty.getMsg(), Toast.LENGTH_LONG).show(); } } }); }

/**
 * 定位
 */
private void setLoaction(){
    // 定位
    final List<CityEntity> gpsCity = iniyGPSCityDatas();
    final SimpleHeaderAdapter gpsHeaderAdapter = new SimpleHeaderAdapter<>(adapter, "定", "当前城市", gpsCity);
    indexableLayout.addHeaderAdapter(gpsHeaderAdapter);

    // 显示真实索引

// indexableLayout.showAllLetter(false);

    // 模拟定位
    indexableLayout.postDelayed(new Runnable() {
        @Override
        public void run() {
            gpsCity.get(0).setName("杭州市");
            gpsHeaderAdapter.notifyDataSetChanged();
        }
    }, 3000);
}`

我这样写跟作者的一样 但是运行后 热门在定位上边 不知道为什么

643063150 avatar Oct 20 '18 07:10 643063150