| | |
| | | import com.demo.lib.common.util.common.DimenUtils; |
| | | import com.jaeger.library.StatusBarUtil; |
| | | import com.yeshi.makemoney.video.R; |
| | | import com.yeshi.makemoney.video.app.utils.SettingUtil; |
| | | import com.yeshi.makemoney.video.app.utils.UserUtil; |
| | | import com.yeshi.makemoney.video.app.utils.api.BasicTextHttpResponseHandler; |
| | | import com.yeshi.makemoney.video.app.utils.api.HttpApiUtil; |
| | |
| | | |
| | | //最少的浏览时间 |
| | | private final Long MIN_SPACE_TIME = 1000 * 5L; |
| | | |
| | | private AQuery mAquery; |
| | | |
| | | private static final String TAG = "DYNewsFragment"; |
| | | private IDPWidget mIDPWidget; |
| | |
| | | if (mIDPWidget != null && mIDPWidget.getFragment() != null) { |
| | | mIDPWidget.getFragment().onHiddenChanged(hidden); |
| | | } |
| | | refreshNotify(); |
| | | } |
| | | |
| | | @Override |
| | | public void onCreateView(View contentView, Bundle savedInstanceState) { |
| | | Log.i(TAG, "onCreateView"); |
| | | StatusBarUtil.setDarkMode(getActivity()); |
| | | AQuery mAquery = new AQuery(contentView); |
| | | mAquery = new AQuery(contentView); |
| | | mAquery.id(R.id.view_status_bar).height(DimenUtils.px2dip(getContext(), DimenUtils.getStatusBarHeight(getContext()))); |
| | | |
| | | mAquery.id(R.id.iv_close).clicked(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | closeNotify(); |
| | | } |
| | | }); |
| | | refreshNotify(); |
| | | initNewsWidget(); |
| | | } |
| | | |
| | | private void refreshNotify() { |
| | | if (mAquery == null) { |
| | | return; |
| | | } |
| | | if (SettingUtil.getSetting(SettingUtil.SettingKey.showNewsNotify, getContext())) { |
| | | mAquery.id(R.id.fl_notify).visibility(View.VISIBLE); |
| | | } else { |
| | | mAquery.id(R.id.fl_notify).visibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | private void closeNotify() { |
| | | if (mAquery == null) { |
| | | return; |
| | | } |
| | | mAquery.id(R.id.fl_notify).visibility(View.GONE); |
| | | SettingUtil.saveSetting(SettingUtil.SettingKey.showNewsNotify, false, getContext()); |
| | | } |
| | | |
| | | private void initNewsWidget() { |
| | |
| | | //上传成功 |
| | | JSONObject data = jsonObject.optJSONObject("data"); |
| | | VideoGoldCornUtil.showInComeToast(data.optInt("goldCorn"), getContext()); |
| | | closeNotify(); |
| | | } |
| | | } |
| | | |