|
|
@ -92,7 +92,7 @@ public class ContentFragment extends BaseLazyLoadFragment { |
|
|
|
Content.DataBean dataBean = dataBeans.get(i); |
|
|
|
Content.DataBean dataBean = dataBeans.get(i); |
|
|
|
addItem(dataBean); |
|
|
|
addItem(dataBean); |
|
|
|
} |
|
|
|
} |
|
|
|
addFooter(); |
|
|
|
// addFooter();
|
|
|
|
mPbLoading.setVisibility(View.GONE); |
|
|
|
mPbLoading.setVisibility(View.GONE); |
|
|
|
mVerticalGridView.setVisibility(View.VISIBLE); |
|
|
|
mVerticalGridView.setVisibility(View.VISIBLE); |
|
|
|
break; |
|
|
|
break; |
|
|
@ -178,11 +178,16 @@ public class ContentFragment extends BaseLazyLoadFragment { |
|
|
|
mVerticalGridView = mRootView.findViewById(R.id.hg_content); |
|
|
|
mVerticalGridView = mRootView.findViewById(R.id.hg_content); |
|
|
|
mVerticalGridView.setTabView(mActivity.getHorizontalGridView()); |
|
|
|
mVerticalGridView.setTabView(mActivity.getHorizontalGridView()); |
|
|
|
mVerticalGridView.setGroup(mActivity.getGroup()); |
|
|
|
mVerticalGridView.setGroup(mActivity.getGroup()); |
|
|
|
|
|
|
|
mVerticalGridView.setNumColumns(4); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mVerticalGridView.setVerticalSpacing(FontDisplayUtil.dip2px(mActivity, 24)); |
|
|
|
mVerticalGridView.setVerticalSpacing(FontDisplayUtil.dip2px(mActivity, 24)); |
|
|
|
|
|
|
|
|
|
|
|
ContentPresenterSelector presenterSelector = new ContentPresenterSelector(); |
|
|
|
ContentPresenterSelector presenterSelector = new ContentPresenterSelector(); |
|
|
|
mAdapter = new ArrayObjectAdapter(presenterSelector); |
|
|
|
|
|
|
|
|
|
|
|
mAdapter = new ArrayObjectAdapter(new TypeDoctorPresenter()); |
|
|
|
|
|
|
|
|
|
|
|
ItemBridgeAdapter itemBridgeAdapter = new ItemBridgeAdapter(mAdapter); |
|
|
|
ItemBridgeAdapter itemBridgeAdapter = new ItemBridgeAdapter(mAdapter); |
|
|
|
mVerticalGridView.setAdapter(itemBridgeAdapter); |
|
|
|
mVerticalGridView.setAdapter(itemBridgeAdapter); |
|
|
|
|
|
|
|
|
|
|
@ -228,6 +233,7 @@ public class ContentFragment extends BaseLazyLoadFragment { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onSucceed(HttpData<ApiResponse<GetNearDoctorApi.DoctorInfo>> stringHttpData) { |
|
|
|
public void onSucceed(HttpData<ApiResponse<GetNearDoctorApi.DoctorInfo>> stringHttpData) { |
|
|
|
LogUtils.e("成功:" + stringHttpData); |
|
|
|
LogUtils.e("成功:" + stringHttpData); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -378,21 +384,27 @@ public class ContentFragment extends BaseLazyLoadFragment { |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case Constants.TYPE_THREE://附近医生
|
|
|
|
case Constants.TYPE_THREE://附近医生
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ArrayObjectAdapter arrayObjectAdapterThree = new ArrayObjectAdapter(new TypeDoctorPresenter()); |
|
|
|
ArrayObjectAdapter arrayObjectAdapterThree = new ArrayObjectAdapter(new TypeDoctorPresenter()); |
|
|
|
List<Content.DataBean.WidgetsBean> listThree = dataBean.getWidgets(); |
|
|
|
List<Content.DataBean.WidgetsBean> listThree = dataBean.getWidgets(); |
|
|
|
if (listThree == null) { |
|
|
|
if (listThree == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (listThree.size() > 4) { |
|
|
|
|
|
|
|
listThree = listThree.subList(0, 4); |
|
|
|
mAdapter.setItems(listThree,null); |
|
|
|
} |
|
|
|
// if (listThree.size() > 4) {
|
|
|
|
arrayObjectAdapterThree.addAll(0, listThree); |
|
|
|
// listThree = listThree.subList(0, 4);
|
|
|
|
HeaderItem headerItemThree = null; |
|
|
|
// }
|
|
|
|
if (dataBean.getShowTitle()) { |
|
|
|
// arrayObjectAdapterThree.addAll(0, listThree);
|
|
|
|
headerItemThree = new HeaderItem(dataBean.getTitle()); |
|
|
|
// HeaderItem headerItemThree = null;
|
|
|
|
} |
|
|
|
// if (dataBean.getShowTitle()) {
|
|
|
|
ListRow listRowThree = new ListRow(headerItemThree, arrayObjectAdapterThree); |
|
|
|
// headerItemThree = new HeaderItem(dataBean.getTitle());
|
|
|
|
addWithTryCatch(listRowThree); |
|
|
|
// }
|
|
|
|
|
|
|
|
// ListRow listRowThree = new ListRow(headerItemThree, arrayObjectAdapterThree);
|
|
|
|
|
|
|
|
// addWithTryCatch(listRowThree);
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case Constants.TYPE_FOUR: |
|
|
|
case Constants.TYPE_FOUR: |
|
|
|