Skip to content

Commit

Permalink
修改多选模式下标题显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
luyousheng committed Dec 13, 2018
1 parent 9876f33 commit fc2f704
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ protected void onCreate(Bundle savedInstanceState) {
FilterTabView ftb_filter = findViewById(R.id.ftb_filter);
ftb_filter.removeViews();
FilterInfoBean bean1 = new FilterInfoBean("区域", FilterTabConfig.FILTER_TYPE_AREA, filterEntity.getArea());
FilterInfoBean bean2 = new FilterInfoBean("总价", FilterTabConfig.FILTER_TYPE_PRICE, filterEntity.getPrice());
// FilterInfoBean bean2 = new FilterInfoBean("总价", FilterTabConfig.FILTER_TYPE_PRICE, filterEntity.getPrice());
FilterInfoBean bean3 = new FilterInfoBean("户型", FilterTabConfig.FILTER_TYPE_SINGLE_SELECT, filterEntity.getHouseType());
FilterInfoBean bean4 = new FilterInfoBean("筛选", FilterTabConfig.FILTER_TYPE_MUL_SELECT, filterEntity.getMulSelect());
FilterInfoBean bean5 = new FilterInfoBean("几室", FilterTabConfig.FILTER_TYPE_SINGLE_GIRD, filterEntity.getHouseType());
// FilterInfoBean bean4 = new FilterInfoBean("筛选", FilterTabConfig.FILTER_TYPE_MUL_SELECT, filterEntity.getMulSelect());
// FilterInfoBean bean5 = new FilterInfoBean("几室", FilterTabConfig.FILTER_TYPE_SINGLE_GIRD, filterEntity.getHouseType());
FilterInfoBean bean6 = new FilterInfoBean("几室", FilterTabConfig.FILTER_TYPE_SINGLE_GIRD, filterEntity.getPrice());


ftb_filter.addFilterItem(bean1.getTabName(), bean1.getFilterData(), bean1.getPopupType(), 0);
ftb_filter.addFilterItem(bean2.getTabName(), bean2.getFilterData(), bean2.getPopupType(), 1);
ftb_filter.addFilterItem(bean3.getTabName(), bean3.getFilterData(), bean3.getPopupType(), 2);
ftb_filter.addFilterItem(bean4.getTabName(), bean4.getFilterData(), bean4.getPopupType(), 3);
ftb_filter.addFilterItem(bean5.getTabName(), bean5.getFilterData(), bean5.getPopupType(), 4);
ftb_filter.addFilterItem(bean6.getTabName(), bean6.getFilterData(), bean6.getPopupType(), 5);
// ftb_filter.addFilterItem(bean2.getTabName(), bean2.getFilterData(), bean2.getPopupType(), 1);
ftb_filter.addFilterItem(bean3.getTabName(), bean3.getFilterData(), bean3.getPopupType(), 1);
// ftb_filter.addFilterItem(bean4.getTabName(), bean4.getFilterData(), bean4.getPopupType(), 3);
// ftb_filter.addFilterItem(bean5.getTabName(), bean5.getFilterData(), bean5.getPopupType(), 4);
ftb_filter.addFilterItem(bean6.getTabName(), bean6.getFilterData(), bean6.getPopupType(), 2);



Expand Down
17 changes: 13 additions & 4 deletions filtertab/src/main/java/com/samluys/filtertab/FilterTabView.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public FilterTabView addFilterItem(String tabName, List<BaseFilterBean> data, fi
mPopupLoader = new PopupEntityLoaderImp();
}

BasePopupWindow basePopupWindow =
final BasePopupWindow basePopupWindow =
(BasePopupWindow) mPopupLoader.getPopupEntity(mContext, data, filterType, popupIndex, this, this);
mPopupWs.add(basePopupWindow);

Expand All @@ -200,9 +200,18 @@ public boolean onTouch(View view, MotionEvent motionEvent) {
basePopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
setArrowDirection(tv_tab_name, false);
if (onPopupDismissListener != null) {
onPopupDismissListener.onDismiss();
try {
int filterType = basePopupWindow.getFilterType();
int position = basePopupWindow.getPosition();

resetSelectData(position,filterType);

setArrowDirection(tv_tab_name, false);
if (onPopupDismissListener != null) {
onPopupDismissListener.onDismiss();
}
} catch (Exception e) {

}
}
});
Expand Down

0 comments on commit fc2f704

Please sign in to comment.