| | |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | | import com.weikou.beibeivideo.ui.dialog.FloatADDialog; |
| | | import com.weikou.beibeivideo.ui.dialog.UserProtocolDialog; |
| | | import com.weikou.beibeivideo.ui.recommend.NovelJNZFragment; |
| | | import com.weikou.beibeivideo.ui.recommend.RecommendFragment; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | |
| | | public void onCreate(@Nullable Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | if (!BeibeiConstant.IS_TEST) |
| | | showProtocol(); |
| | | } |
| | | |
| | | |
| | | private void showProtocol() { |
| | | String data = "感谢您对" + getResources().getString(R.string.app_name) + "一直以来的信任!<br>"; |
| | | data += "我们依照新的监管要求条例更新了"; |
| | | data += String.format("<a href='%s'>《隐私政策》</a>和", BeibeiConstant.PRIVACY_POLICY); |
| | | data += String.format("<a href='%s'>《用户协议》</a>", BeibeiConstant.USER_AGREEMENT); |
| | | data += "为采取相应安全保护措施,尽力保护您的个人信息安全可控,特向你说明如下:<br>" + |
| | | "1、您在使用" + getResources().getString(R.string.app_name) + "各项产品或服务时,将会提供与具体功能相关的个人信息(可能涉及帐号、位置、存储等信息)。<br>" + |
| | | "2、您可以随时查询、更正、删除您的个人信息,我们也提供账户注销的渠道。<br>" + |
| | | "3、未经您的再次同意,我们不会将上述信息用于您未授权的其他用途或目的。<br>" + |
| | | "4、未经监护人同意,我们不会收集使用14周岁以下(含14周岁)未成年人个人信息,且不会利用其信息推送新闻、时政信息、广告等定向推送活动。"; |
| | | |
| | | if (!UserUtil.isAgreeUserProtocol(getContext())) { |
| | | new UserProtocolDialog.Builder(getActivity()).setNegativeButton("不同意", new DialogInterface.OnClickListener() { |
| | | @Override |
| | | public void onClick(DialogInterface dialog, int which) { |
| | | getActivity().finish(); |
| | | } |
| | | }).setPositiveButton("同意", new DialogInterface.OnClickListener() { |
| | | @Override |
| | | public void onClick(DialogInterface dialog, int which) { |
| | | dialog.dismiss(); |
| | | UserUtil.agreeUserProtocol(getContext()); |
| | | showFloatImgAd(); |
| | | } |
| | | }).setData(data).create().show(); |
| | | } else { |
| | | showFloatImgAd(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 展示悬浮广告 |
| | |
| | | fl_indicator.postDelayed(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | builder.create().show(); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | }, 2000); |
| | | |
| | |
| | | cacheValue, |
| | | new TypeToken<List<HomeClass>>() { |
| | | }.getType()); |
| | | if (list != null) |
| | | for (int i = 0; i < list.size(); i++) { |
| | | if (list.get(i).getDataType().equalsIgnoreCase("novel")) { |
| | | list.remove(i--); |
| | | } |
| | | } |
| | | |
| | | categories.addAll(list); |
| | | } |
| | | |
| | |
| | | }.getType()); |
| | | |
| | | categories.addAll(list); |
| | | if (categories != null) |
| | | for (int i = 0; i < categories.size(); i++) { |
| | | if (categories.get(i).getDataType().equalsIgnoreCase("novel")) { |
| | | categories.remove(i--); |
| | | } |
| | | } |
| | | |
| | | adapter.notifyDataSetChanged(); |
| | | indicator.notifyDataSetChanged(); |
| | | |
| | |
| | | |
| | | @Override |
| | | public Fragment getItem(int position) { |
| | | if ("novel".equalsIgnoreCase(mlist.get(position).getDataType())) { |
| | | return NovelJNZFragment.newInstance(); |
| | | } else { |
| | | |
| | | Fragment fragment = RecommendFragment.newInstance(mlist.get(position), position + ""); |
| | | return fragment; |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |