Java Code Examples for com.socks.jiandan.model.NetWorkEvent#getType()
The following examples show how to use
com.socks.jiandan.model.NetWorkEvent#getType() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PictureFragment.java From JianDan_OkHttpWithVolley with Apache License 2.0 | 6 votes |
public void onEventMainThread(NetWorkEvent event) { if (event.getType() == NetWorkEvent.AVAILABLE) { if (NetWorkUtil.isWifiConnected(getActivity())) { mAdapter.setIsWifi(true); if (!isFirstChange && (System.currentTimeMillis() - lastShowTime) > 3000) { ShowToast.Short("已切换为WIFI模式,自动加载GIF图片"); lastShowTime = System.currentTimeMillis(); } } else { mAdapter.setIsWifi(false); if (!isFirstChange && (System.currentTimeMillis() - lastShowTime) > 3000) { ShowToast.Short("已切换为省流量模式,只加载GIF缩略图"); lastShowTime = System.currentTimeMillis(); } } isFirstChange = false; } }
Example 2
Source File: PictureFragment.java From JianDan with Apache License 2.0 | 6 votes |
public void onEventMainThread(NetWorkEvent event) { if (event.getType() == NetWorkEvent.AVAILABLE) { if (NetWorkUtil.isWifiConnected(getActivity())) { mAdapter.setIsWifi(true); if (!isFirstChange && (System.currentTimeMillis() - lastShowTime) > 3000) { ShowToast.Short("已切换为WIFI模式,自动加载GIF图片"); lastShowTime = System.currentTimeMillis(); } } else { mAdapter.setIsWifi(false); if (!isFirstChange && (System.currentTimeMillis() - lastShowTime) > 3000) { ShowToast.Short("已切换为省流量模式,只加载GIF缩略图"); lastShowTime = System.currentTimeMillis(); } } isFirstChange = false; } }
Example 3
Source File: PictureFragment.java From JianDan_OkHttp with Apache License 2.0 | 6 votes |
public void onEventMainThread(NetWorkEvent event) { if (event.getType() == NetWorkEvent.AVAILABLE) { if (NetWorkUtil.isWifiConnected(getActivity())) { mAdapter.setIsWifi(true); if (!isFirstChange && (System.currentTimeMillis() - lastShowTime) > 3000) { ShowToast.Short("已切换为WIFI模式,自动加载GIF图片"); lastShowTime = System.currentTimeMillis(); } } else { mAdapter.setIsWifi(false); if (!isFirstChange && (System.currentTimeMillis() - lastShowTime) > 3000) { ShowToast.Short("已切换为省流量模式,只加载GIF缩略图"); lastShowTime = System.currentTimeMillis(); } } isFirstChange = false; } }