| | |
| | | import android.content.Context; |
| | | import android.content.SharedPreferences; |
| | | import android.os.Bundle; |
| | | import android.support.v4.widget.SwipeRefreshLayout; |
| | | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; |
| | | import android.view.View; |
| | | import android.widget.ListView; |
| | | import android.widget.ProgressBar; |
| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.lcjian.library.RetainViewFragment; |
| | | import com.lcjian.library.util.RefreshLayout; |
| | | import com.lcjian.library.util.SingleToast; |
| | | import com.qq.e.ads.cfg.VideoOption; |
| | | import com.qq.e.ads.nativ.ADSize; |
| | |
| | | import com.weikou.beibeivideo.ui.recommend.DiscoverAdapter; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.widget.MySwipeRefreshLayout; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONObject; |
| | |
| | | private List<UniqueBean> uniques = new ArrayList<UniqueBean>(); |
| | | private int mCurrentPage = 1; |
| | | private ListView uniqueView; |
| | | private RefreshLayout rl_unique; |
| | | private MySwipeRefreshLayout rl_unique; |
| | | private DiscoverAdapter uniqueAdapter; |
| | | |
| | | |
| | | public DiscoverNowFragment() { |
| | | super(DiscoverNowFragment.class.getName()); |
| | | super(); |
| | | setName(DiscoverNowFragment.class.getName()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | MobclickAgent.onPageStart("主界面—分类—专题"); |
| | | } |
| | | |
| | | @Override |
| | | public void onPause() { |
| | | super.onPause(); |
| | | MobclickAgent.onPageEnd("主界面—分类—专题"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | refreshAd(); |
| | | } |
| | | }); |
| | | rl_unique.setOnLoadListener(new RefreshLayout.OnLoadListener() { |
| | | rl_unique.setOnLoadListener(new MySwipeRefreshLayout.OnLoadListener() { |
| | | @Override |
| | | public void onLoad() { |
| | | mCurrentPage++; |
| | |
| | | // 1.加载广告,先设置加载上下文环境和条件 |
| | | private void refreshAd() { |
| | | NativeExpressAD nativeExpressAD = new NativeExpressAD(uniqueView.getContext(), new ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT), |
| | | BeibeiConstant.GDT_ID, BeibeiConstant.GDT_DISCOVER_NATIVE, new NativeExpressAD.NativeExpressADListener() { |
| | | BeibeiConstant.GDT_DISCOVER_NATIVE, new NativeExpressAD.NativeExpressADListener() { |
| | | @Override |
| | | public void onADLoaded(List<NativeExpressADView> list) { |
| | | adList.clear(); |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADOpenOverlay(NativeExpressADView nativeExpressADView) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADCloseOverlay(NativeExpressADView nativeExpressADView) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onNoAD(AdError adError) { |