|
|
@ -106,7 +106,7 @@ public class ContentFragment extends BaseLazyLoadFragment { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ContentFragment.OnFragmentInteractionListener mListener; |
|
|
|
private OnFragmentInteractionListener mListener; |
|
|
|
|
|
|
|
|
|
|
|
public interface OnFragmentInteractionListener { |
|
|
|
public interface OnFragmentInteractionListener { |
|
|
|
void onFragmentInteraction(Uri uri); |
|
|
|
void onFragmentInteraction(Uri uri); |
|
|
@ -128,8 +128,8 @@ public class ContentFragment extends BaseLazyLoadFragment { |
|
|
|
public void onAttach(@NonNull Context context) { |
|
|
|
public void onAttach(@NonNull Context context) { |
|
|
|
super.onAttach(context); |
|
|
|
super.onAttach(context); |
|
|
|
|
|
|
|
|
|
|
|
if (context instanceof ContentFragment.OnFragmentInteractionListener) { |
|
|
|
if (context instanceof OnFragmentInteractionListener) { |
|
|
|
mListener = (ContentFragment.OnFragmentInteractionListener) context; |
|
|
|
mListener = (OnFragmentInteractionListener) context; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw new RuntimeException(context.toString() |
|
|
|
throw new RuntimeException(context.toString() |
|
|
|
+ " must implement OnFragmentInteractionListener"); |
|
|
|
+ " must implement OnFragmentInteractionListener"); |
|
|
@ -226,21 +226,7 @@ public class ContentFragment extends BaseLazyLoadFragment { |
|
|
|
loadData(); |
|
|
|
loadData(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EasyHttp.post(this) |
|
|
|
|
|
|
|
.api(new GetNearDoctorApi("", "", "1", "100", "", |
|
|
|
|
|
|
|
"119.218118", "26.043799", "15", "2")) |
|
|
|
|
|
|
|
.request(new OnHttpListener<HttpData<ApiResponse<GetNearDoctorApi.DoctorInfo>>>() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onSucceed(HttpData<ApiResponse<GetNearDoctorApi.DoctorInfo>> stringHttpData) { |
|
|
|
|
|
|
|
LogUtils.e("成功:" + stringHttpData); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onFail(Exception e) { |
|
|
|
|
|
|
|
LogUtils.e("失败:" + e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -258,7 +244,32 @@ public class ContentFragment extends BaseLazyLoadFragment { |
|
|
|
} |
|
|
|
} |
|
|
|
switch (mCurrentTabCode) { |
|
|
|
switch (mCurrentTabCode) { |
|
|
|
case "c40248cac1f44c278f8bd23a0bba8b4f": |
|
|
|
case "c40248cac1f44c278f8bd23a0bba8b4f": |
|
|
|
json = LocalJsonResolutionUtil.getJson(activity, "My.json"); |
|
|
|
// json = LocalJsonResolutionUtil.getJson(activity, "My.json");
|
|
|
|
|
|
|
|
EasyHttp.post(getActivity()) |
|
|
|
|
|
|
|
.api(new GetNearDoctorApi("", "", "1", "100", "", |
|
|
|
|
|
|
|
"119.218118", "26.043799", "15", "2")) |
|
|
|
|
|
|
|
.request(new OnHttpListener<HttpData<ApiResponse<GetNearDoctorApi.DoctorInfo>>>() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onSucceed(HttpData<ApiResponse<GetNearDoctorApi.DoctorInfo>> stringHttpData) { |
|
|
|
|
|
|
|
LogUtils.e("成功:" + stringHttpData); |
|
|
|
|
|
|
|
if(stringHttpData.getCode()==200){ |
|
|
|
|
|
|
|
List<GetNearDoctorApi.DoctorInfo.MemberBean> doctorInfo = stringHttpData.getData().getData().getMember(); |
|
|
|
|
|
|
|
if (doctorInfo == null) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mAdapter.setItems(doctorInfo,null); |
|
|
|
|
|
|
|
mPbLoading.setVisibility(View.GONE); |
|
|
|
|
|
|
|
mVerticalGridView.setVisibility(View.VISIBLE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onFail(Exception e) { |
|
|
|
|
|
|
|
LogUtils.e("失败:" + e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "7359d189a049468d9d4e280fd1ec15c5": |
|
|
|
case "7359d189a049468d9d4e280fd1ec15c5": |
|
|
|
json = LocalJsonResolutionUtil.getJson(activity, "WatchTv.json"); |
|
|
|
json = LocalJsonResolutionUtil.getJson(activity, "WatchTv.json"); |
|
|
@ -295,17 +306,17 @@ public class ContentFragment extends BaseLazyLoadFragment { |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (json == null) { |
|
|
|
// if (json == null) {
|
|
|
|
return; |
|
|
|
// return;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
Content content = LocalJsonResolutionUtil.JsonToObject(json, Content.class); |
|
|
|
// Content content = LocalJsonResolutionUtil.JsonToObject(json, Content.class);
|
|
|
|
final Message msg = Message.obtain(); |
|
|
|
// final Message msg = Message.obtain();
|
|
|
|
msg.what = MSG_ADD_ITEM; |
|
|
|
// msg.what = MSG_ADD_ITEM;
|
|
|
|
Bundle b = new Bundle(); |
|
|
|
// Bundle b = new Bundle();
|
|
|
|
b.putParcelable(MSG_BUNDLE_KEY_ADD_ITEM, content); |
|
|
|
// b.putParcelable(MSG_BUNDLE_KEY_ADD_ITEM, content);
|
|
|
|
msg.setData(b); |
|
|
|
// msg.setData(b);
|
|
|
|
//延迟1秒模拟加载数据过程
|
|
|
|
// //延迟1秒模拟加载数据过程
|
|
|
|
mHandler.sendMessageDelayed(msg, 1000); |
|
|
|
// mHandler.sendMessageDelayed(msg, 1000);
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -384,16 +395,11 @@ 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; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mAdapter.setItems(listThree,null); |
|
|
|
mAdapter.setItems(listThree,null); |
|
|
|
// if (listThree.size() > 4) {
|
|
|
|
// if (listThree.size() > 4) {
|
|
|
|
// listThree = listThree.subList(0, 4);
|
|
|
|
// listThree = listThree.subList(0, 4);
|
|
|
|