error界面
This commit is contained in:
@@ -32,7 +32,8 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
private static final String TAG = "ShareEventsFragment";
|
||||
private RecyclerView recyclerView;
|
||||
private V2XShareEventAdapter adapter;
|
||||
private ArrayList dataArrayList;
|
||||
private ArrayList dataArrayList = new ArrayList();
|
||||
;
|
||||
private int pageNum = 1;
|
||||
private V2XShareNetworkModel v2XShareNetworkModel;
|
||||
|
||||
@@ -77,19 +78,6 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
* 获取热心指数,分享列表等分享内容
|
||||
* */
|
||||
private void getShareEventResponse() {
|
||||
animatioonAcction(View.VISIBLE);
|
||||
dataArrayList = new ArrayList();
|
||||
|
||||
// if (CheckUtils.isNetworkConnected(getContext()) == false) {
|
||||
// loadingView.networkError("获取失败");
|
||||
// loadingView.refresButton.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// getShareEventResponse();
|
||||
// }
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
|
||||
v2XShareNetworkModel.getShareEventResponse(pageNum, 10, new V2XRefreshCallback() {
|
||||
@Override
|
||||
@@ -109,10 +97,15 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
|
||||
@Override
|
||||
public void onFail(String msg) {
|
||||
|
||||
loadingView.stopWithError(msg);
|
||||
loadingView.refresButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
getShareEventResponse();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -50,6 +50,13 @@ public class V2XAnimationManager implements Animation {
|
||||
}
|
||||
}
|
||||
|
||||
public void soptWithError(){
|
||||
if (delegate != null && isStarted) {
|
||||
isStarted = false;
|
||||
delegate.stop();
|
||||
}
|
||||
}
|
||||
|
||||
public void release() {
|
||||
delegate = null;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ public class V2XNetworkLoadingView extends RelativeLayout {
|
||||
private TextView textView;
|
||||
private V2XAnimationManager v2XAnimationManager;
|
||||
public Button refresButton;
|
||||
private String loadingText = "正在获取信息…";
|
||||
|
||||
public V2XNetworkLoadingView(Context context) {
|
||||
|
||||
@@ -63,6 +64,9 @@ public class V2XNetworkLoadingView extends RelativeLayout {
|
||||
if (refresButton != null) {
|
||||
refresButton.setVisibility(GONE);
|
||||
}
|
||||
if (textView != null) {
|
||||
textView.setText(loadingText);
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
@@ -72,9 +76,9 @@ public class V2XNetworkLoadingView extends RelativeLayout {
|
||||
}
|
||||
}
|
||||
|
||||
public void networkError(String errormsg) {
|
||||
public void stopWithError(String errormsg) {
|
||||
if (v2XAnimationManager != null) {
|
||||
v2XAnimationManager.stop();
|
||||
v2XAnimationManager.soptWithError();
|
||||
}
|
||||
if (textView != null) {
|
||||
textView.setText(errormsg);
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
android:id="@+id/loading_imageview"
|
||||
android:layout_width="200px"
|
||||
android:layout_height="200px"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="133px"
|
||||
android:layout_marginTop="100px"
|
||||
android:background="@drawable/v_to_x_loading_car0000" />
|
||||
|
||||
<TextView
|
||||
|
||||
Reference in New Issue
Block a user