1个文件已删除
41个文件已修改
11个文件已添加
| | |
| | | android:name="com.weikou.beibeivideo.ui.ad.SplashAdActivity" |
| | | android:hardwareAccelerated="true" |
| | | android:label="@string/app_name" |
| | | android:launchMode="singleInstance" |
| | | android:launchMode="singleTask" |
| | | android:screenOrientation="portrait"></activity> |
| | | |
| | | |
| | |
| | | android:value="570f28a578d6e12cba6f7f200b8d1c83"></meta-data> |
| | | <meta-data |
| | | android:name="UMENG_CHANNEL" |
| | | android:value="huawei"></meta-data> |
| | | android:value="qq"></meta-data> |
| | | |
| | | |
| | | <provider |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="@color/page_content_bg_color" /> |
| | | <corners |
| | | android:bottomLeftRadius="5dp" |
| | | android:bottomRightRadius="5dp" |
| | | android:topLeftRadius="5dp" |
| | | android:topRightRadius="5dp" /> |
| | | |
| | | |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <solid android:color="@color/follow_btn_bg_color" /> |
| | | <corners android:radius="20dp" /> |
| | | |
| | | </shape> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="@color/page_content_bg_color" /> |
| | | <solid android:color="@color/video_detail_follow_bg_color" /> |
| | | <corners |
| | | android:bottomLeftRadius="5dp" |
| | | android:bottomRightRadius="5dp" |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <solid android:color="@color/follow_btn_bg_color" /> |
| | | <corners android:radius="20dp" /> |
| | | |
| | | <solid android:color="@color/page_content_bg_color" /> |
| | | <stroke |
| | | android:width="1dp" |
| | | android:color="#59d0d0d0" /> |
| | | |
| | | |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <solid android:color="#ffffffff" /> |
| | | <stroke |
| | | android:width="1dp" |
| | | android:color="#59000000"></stroke> |
| | | <corners android:radius="16dp" /> |
| | | |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <solid android:color="@color/video_list_nav_bg_color"></solid> |
| | | <stroke |
| | | android:width="1dp" |
| | | android:color="@color/video_list_nav_text_color"></stroke> |
| | | <corners android:radius="20dp"></corners> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <solid android:color="@color/video_list_nav_hightlight_bg_color"></solid> |
| | | <corners android:radius="20dp"></corners> |
| | | </shape> |
| | |
| | | <gradient |
| | | android:angle="90" |
| | | android:endColor="#00000000" |
| | | android:startColor="#ff000000" |
| | | android:startColor="#80000000" |
| | | android:type="linear" |
| | | android:useLevel="true" /> |
| | | <corners |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerVertical="true" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/icon_player_back" |
| | | android:drawablePadding="3dp" |
| | | android:gravity="center" |
| | | android:padding="8dp" /> |
| | |
| | | android:gravity="center" |
| | | android:paddingLeft="10dp" |
| | | android:paddingRight="10dp" |
| | | android:text="横屏" |
| | | android:textColor="@color/white" |
| | | android:textSize="18sp" |
| | | android:visibility="gone"></TextView> |
| | | android:visibility="visible"></TextView> |
| | | </LinearLayout> |
| | | |
| | | <ProgressBar |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="right|top" |
| | | android:layout_marginRight="4dp" |
| | | android:background="@drawable/ic_player_browser_more_bg" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | |
| | | android:layout_height="wrap_content" |
| | | android:drawableLeft="@drawable/icon_browser_more_refresh" |
| | | android:drawablePadding="9dp" |
| | | android:padding="11dp" |
| | | android:padding="9dp" |
| | | android:text="刷新" |
| | | android:textColor="#ff666666" |
| | | android:textSize="15sp" /> |
| | |
| | | android:layout_height="wrap_content" |
| | | android:drawableLeft="@drawable/icon_browser_more_copy" |
| | | android:drawablePadding="9dp" |
| | | android:padding="11dp" |
| | | android:padding="9dp" |
| | | android:text="复制链接" |
| | | android:textColor="#ff666666" |
| | | android:textSize="15sp" /> |
| | |
| | | android:layout_height="wrap_content" |
| | | android:drawableLeft="@drawable/icon_browser_more_open" |
| | | android:drawablePadding="9dp" |
| | | android:padding="11dp" |
| | | android:paddingLeft="9dp" |
| | | android:paddingTop="9dp" |
| | | android:paddingBottom="9dp" |
| | | android:text="用其他浏览器打开" |
| | | android:textColor="#ff666666" |
| | | android:textSize="15sp" /> |
| | |
| | | <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="#000000" |
| | | android:background="@color/page_content_bg_color" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | |
| | | android:layout_height="48dp" |
| | | android:gravity="center_vertical"> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_top_bar_left" |
| | | style="@style/TextBuleNormal" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerVertical="true" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/icon_player_back" |
| | | android:drawablePadding="3dp" |
| | | android:gravity="center" |
| | | android:padding="8dp" |
| | | android:visibility="invisible" /> |
| | | android:padding="8dp" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | |
| | | android:ellipsize="end" |
| | | android:maxLines="1" |
| | | android:text="" |
| | | android:textColor="#DDDDDD" |
| | | android:textColor="@color/page_title_text_color" |
| | | android:textSize="15sp"></TextView> |
| | | |
| | | <TextView |
| | |
| | | android:layout_marginTop="3dp" |
| | | android:ellipsize="end" |
| | | android:maxLines="1" |
| | | android:textColor="#DDDDDD" |
| | | android:textColor="#999999" |
| | | android:textSize="8sp"></TextView> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_refresh" |
| | | <TextView |
| | | android:id="@+id/tv_right" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="5dp" |
| | | android:layout_marginRight="15dp" |
| | | android:src="@drawable/ic_refresh"></ImageView> |
| | | android:layout_height="match_parent" |
| | | android:drawableRight="@drawable/icon_browser_more" |
| | | android:gravity="center" |
| | | android:paddingLeft="10dp" |
| | | android:paddingRight="10dp" |
| | | android:textColor="@color/white" |
| | | android:textSize="18sp" |
| | | android:visibility="visible"></TextView> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | |
| | | android:text="恭喜你!免广告权益180分后可重新获得" |
| | | android:textColor="#ffffffff" |
| | | android:textSize="14sp" /> |
| | | |
| | | |
| | | <FrameLayout |
| | | android:id="@+id/fl_menu" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="#80000000" |
| | | android:visibility="gone"> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_menu" |
| | | android:layout_width="172dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="right|top" |
| | | android:layout_marginRight="4dp" |
| | | android:background="@drawable/ic_player_browser_more_bg" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_refresh" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:drawableLeft="@drawable/icon_browser_more_refresh" |
| | | android:drawablePadding="9dp" |
| | | android:padding="9dp" |
| | | android:text="刷新" |
| | | android:textColor="#ff666666" |
| | | android:textSize="15sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_copy" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:drawableLeft="@drawable/icon_browser_more_copy" |
| | | android:drawablePadding="9dp" |
| | | android:padding="9dp" |
| | | android:text="复制链接" |
| | | android:textColor="#ff666666" |
| | | android:textSize="15sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_open" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:drawableLeft="@drawable/icon_browser_more_open" |
| | | android:drawablePadding="9dp" |
| | | android:paddingLeft="9dp" |
| | | android:paddingTop="9dp" |
| | | android:paddingBottom="9dp" |
| | | android:text="用其他浏览器打开" |
| | | android:textColor="#ff666666" |
| | | android:textSize="15sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </FrameLayout> |
| | | |
| | | |
| | | </FrameLayout> |
| | |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_top_bar_left" |
| | | android:id="@+id/tv_top_bar_left1" |
| | | style="@style/TextBuleNormal" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:layout_alignParentLeft="true" |
| | | android:layout_centerVertical="true" |
| | | android:layout_gravity="left|top" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/icon_player_back" |
| | | android:drawablePadding="3dp" |
| | | android:gravity="center" |
| | | android:padding="8dp" /> |
| | | android:padding="8dp" |
| | | android:visibility="gone" /> |
| | | |
| | | |
| | | </FrameLayout> |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="right|center_vertical" |
| | | android:layout_marginRight="15dp" |
| | | android:background="@drawable/ic_select2" |
| | | android:background="@drawable/shape_video_list_nav_highlight_bg" |
| | | android:gravity="center" |
| | | android:paddingLeft="8dp" |
| | | android:paddingRight="8dp" |
| | | android:paddingTop="3dp" |
| | | android:paddingRight="8dp" |
| | | android:paddingBottom="3dp" |
| | | android:text="最新更新" |
| | | android:textAppearance="?android:attr/textAppearanceSmall" |
| | | android:textColor="#3B3B3B" /> |
| | | android:textColor="@color/video_list_nav_hightlight_text_color" /> |
| | | </FrameLayout> |
| | | |
| | | <FrameLayout |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="left|center_vertical" |
| | | android:layout_marginLeft="15dp" |
| | | android:background="@drawable/shape_video_detail_follow_btn" |
| | | android:background="@drawable/shape_video_list_nav_bg" |
| | | android:gravity="center" |
| | | android:paddingLeft="8dp" |
| | | android:paddingRight="8dp" |
| | | android:paddingTop="3dp" |
| | | android:paddingRight="8dp" |
| | | android:paddingBottom="3dp" |
| | | android:text="最热视频" |
| | | |
| | | android:textColor="#EFEFEF" /> |
| | | android:textColor="@color/video_list_nav_text_color" /> |
| | | </FrameLayout> |
| | | |
| | | <FrameLayout |
| | |
| | | android:id="@+id/container" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="#000000" |
| | | android:orientation="vertical"> |
| | | |
| | | |
| | |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="#010005" |
| | | android:background="@color/transparent" |
| | | android:orientation="vertical"> |
| | | |
| | | |
| | | <FrameLayout |
| | | android:id="@+id/fl_ad" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"> |
| | | |
| | | <FrameLayout |
| | | android:id="@+id/fl_ad" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"></FrameLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_input" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="34dp" |
| | | android:layout_gravity="top|right" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginRight="20dp" |
| | | android:background="@drawable/shape_splash_ad" |
| | | android:gravity="center" |
| | | android:orientation="horizontal" |
| | | android:paddingLeft="20dp" |
| | | android:paddingRight="20dp" |
| | | android:visibility="invisible"> |
| | | |
| | | <TextView |
| | | android:id="@+id/ad_input" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:maxLines="1" |
| | | android:padding="2dp" |
| | | android:text="跳过" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:visibility="visible" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/ad_close_time" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="2dp" |
| | | android:maxLines="1" |
| | | android:padding="2dp" |
| | | android:text="5" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:visibility="visible" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </FrameLayout> |
| | | android:layout_height="match_parent"></FrameLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center_horizontal" |
| | | android:padding="15dp"> |
| | | android:id="@+id/ll_input" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="34dp" |
| | | android:layout_gravity="top|right" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginRight="20dp" |
| | | android:background="@drawable/shape_splash_ad" |
| | | android:gravity="center" |
| | | android:orientation="horizontal" |
| | | android:paddingLeft="20dp" |
| | | android:paddingRight="20dp" |
| | | android:visibility="invisible"> |
| | | |
| | | <ImageView |
| | | android:layout_width="28dp" |
| | | android:layout_height="28dp" |
| | | android:src="@drawable/ic_launcher"></ImageView> |
| | | |
| | | <ImageView |
| | | <TextView |
| | | android:id="@+id/ad_input" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="27dp" |
| | | android:layout_marginLeft="5dp" |
| | | android:src="@drawable/ic_splash_bottom_small"></ImageView> |
| | | android:layout_height="wrap_content" |
| | | android:maxLines="1" |
| | | android:padding="2dp" |
| | | android:text="跳过" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:visibility="visible" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/ad_close_time" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="2dp" |
| | | android:maxLines="1" |
| | | android:padding="2dp" |
| | | android:text="5" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:visibility="visible" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </FrameLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@color/page_content_bg_color" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.qq.e.ads.nativ.widget.NativeAdContainer |
| | | android:id="@+id/root" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | |
| | | <com.lcjian.library.widget.RatioLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="95" |
| | | app:ratio="1.39"> |
| | | |
| | | <FrameLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_picture" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:scaleType="centerCrop"></ImageView> |
| | | |
| | | |
| | | </FrameLayout> |
| | | |
| | | </com.lcjian.library.widget.RatioLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginLeft="17dp" |
| | | android:layout_weight="190" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="2dp" |
| | | android:gravity="bottom" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_name" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:ellipsize="end" |
| | | android:maxLines="2" |
| | | android:text="以家人之名" |
| | | android:textColor="@color/video_list_title_text_color" |
| | | android:textSize="15sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_type" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="8dp" |
| | | android:textColor="@color/video_list_subtitle_text_color" |
| | | android:textSize="12sp"> |
| | | |
| | | |
| | | </TextView> |
| | | |
| | | <View |
| | | android:layout_width="1dp" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"></View> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_actors" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:ellipsize="end" |
| | | android:lines="2" |
| | | android:text="主演: 谭松韵 / 宋威龙 / 张新成 / 孙铱 / 何瑞贤" |
| | | android:textColor="@color/video_list_subtitle_text_color" |
| | | android:textSize="12sp" /> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="1dp" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"></View> |
| | | |
| | | <FrameLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_play" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_video_search_result_album_play" |
| | | android:paddingLeft="30dp" |
| | | android:paddingTop="6dp" |
| | | android:paddingRight="30dp" |
| | | android:paddingBottom="6dp" |
| | | android:text="查看详情" |
| | | android:textColor="#ffffe74d" |
| | | android:textSize="12sp" /> |
| | | |
| | | |
| | | </FrameLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </com.qq.e.ads.nativ.widget.NativeAdContainer> |
| | | |
| | | |
| | | </FrameLayout> |
| | |
| | | android:id="@+id/ll_add_attention" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_video_detail_follow_bg" |
| | | android:background="@drawable/shape_item_follow_bg" |
| | | android:gravity="center_vertical" |
| | | android:orientation="horizontal" |
| | | android:padding="6.5dp"> |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center_vertical" |
| | | android:layout_marginRight="6dp" |
| | | android:background="@drawable/shape_video_detail_follow_btn" |
| | | android:background="@drawable/shape_item_follow_btn" |
| | | android:drawableLeft="@drawable/ic_follow_add" |
| | | android:drawablePadding="7dp" |
| | | android:gravity="center" |
| | |
| | | android:paddingBottom="5dp" |
| | | android:text="已关注" |
| | | android:textColor="@color/follow_btn_text_color" |
| | | android:textSize="10sp" /> |
| | | android:textSize="12sp" /> |
| | | |
| | | </LinearLayout> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="#666666" > |
| | | android:layout_height="40dp" |
| | | android:background="@color/page_content_bg_color"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:gravity="center" |
| | | android:paddingTop="5dp" |
| | | android:paddingBottom="5dp" |
| | | android:gravity="center" > |
| | | android:paddingBottom="5dp"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_resource" |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="5dp" |
| | | android:textColor="@color/white" |
| | | android:gravity="center" /> |
| | | android:gravity="center" |
| | | android:textColor="@color/video_detail_resource_text_color" /> |
| | | </LinearLayout> |
| | | |
| | | </FrameLayout> |
| | |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@color/page_content_bg_color" |
| | | android:orientation="vertical"> |
| | | |
| | | |
| | |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="95" |
| | | app:ratio="1.38"> |
| | | app:ratio="1.39"> |
| | | |
| | | <FrameLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center_vertical" |
| | | android:drawableStart="@drawable/ic_back" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawablePadding="5dp" |
| | | android:gravity="center" |
| | | android:padding="8dp" |
| | | android:textColor="@color/page_title_text_color" /> |
| | | android:textColor="@color/page_title_text_color" |
| | | android:textSize="17sp" /> |
| | | </FrameLayout> |
| | | |
| | | <LinearLayout |
| | |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/page_content_bg_color" |
| | | android:background="@color/page_bg_color" |
| | | android:orientation="vertical"> |
| | | |
| | | <include layout="@layout/view_status_bar" /> |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="48dp" |
| | | android:background="@color/page_content_bg_color" |
| | | android:gravity="center_vertical" |
| | | android:orientation="horizontal" |
| | | android:padding="8dp"> |
| | |
| | | android:id="@+id/rv_video_search" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@color/page_content_bg_color" |
| | | android:paddingLeft="10dp" |
| | | android:paddingRight="10dp"></android.support.v7.widget.RecyclerView> |
| | | </com.weikou.beibeivideo.widget.MySwipeRefreshLayout> |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="15dp" |
| | | android:layout_marginTop="15dp" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/icon_player_back" |
| | | android:drawablePadding="5dp" |
| | | android:gravity="center" |
| | | android:src="@drawable/ic_back_two" |
| | | android:textColor="@color/white" /> |
| | | |
| | | </FrameLayout> |
| | |
| | | <color name="video_detail_content_text_color">#999999</color> |
| | | <color name="video_detail_resource_text_color">#666666</color> |
| | | <color name="video_detail_resource_bg_color">#F0F0F0</color> |
| | | <color name="video_detail_follow_bg_color">#FAFAFA</color> |
| | | <color name="video_detail_follow_text_color">#666666</color> |
| | | |
| | | |
| | | <color name="video_list_nav_hightlight_text_color">#FFFFFF</color> |
| | | <color name="video_list_nav_hightlight_bg_color">#51B3FF</color> |
| | | |
| | | <color name="video_list_nav_text_color">#717481</color> |
| | | <color name="video_list_nav_bg_color">#FFFFFF</color> |
| | | |
| | | |
| | | </resources> |
| | |
| | | import com.umeng.commonsdk.UMConfigure; |
| | | import com.umeng.socialize.PlatformConfig; |
| | | import com.umeng.socialize.UMShareAPI; |
| | | import com.weikou.beibeivideo.entity.ad.AdPidInfo; |
| | | import com.weikou.beibeivideo.entity.ad.AdPositionEnum; |
| | | import com.weikou.beibeivideo.entity.ad.SplashAdLoadInfo; |
| | | import com.weikou.beibeivideo.ui.SplashActivity; |
| | | import com.weikou.beibeivideo.ui.ad.SplashADFragment; |
| | |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.CrashHandler; |
| | | import com.weikou.beibeivideo.util.FunshionConstant; |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | import com.weikou.beibeivideo.util.ad.CSJConstant; |
| | | import com.weikou.beibeivideo.util.ad.GDTConstant; |
| | | import com.weikou.beibeivideo.util.ad.TTAdManagerHolder; |
| | | import com.weikou.beibeivideo.util.downutil.StringUtils; |
| | | import com.yeshi.push.PushUtil; |
| | |
| | | ComponentName cn = am.getRunningTasks(1).get(0).topActivity; |
| | | if (!cn.getClassName().equalsIgnoreCase(SplashActivity.class.getName())) { |
| | | Log.i(TAG, "应当展示开屏广告"); |
| | | SplashADFragment.loadAd(getApplicationContext(), null, null, true, new SplashADFragment.AdLoadResultListener() { |
| | | //小于30分钟不展示 |
| | | if (System.currentTimeMillis() - SplashADFragment.lastShowTime < 1000 * 60 * 30L) |
| | | return; |
| | | if (SplashADFragment.isAdLoaded()) { |
| | | startActivity(new Intent(getApplicationContext(), SplashAdActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); |
| | | return; |
| | | } |
| | | |
| | | AdUtil.AD_TYPE type1 = AdUtil.getAdType(getApplicationContext(), AdPositionEnum.splashHotStart); |
| | | String pid1 = AdUtil.getAdPid(getApplicationContext(), AdPositionEnum.splashHotStart); |
| | | AdPidInfo adPidInfo1 = null; |
| | | AdPidInfo adPidInfo2 = null; |
| | | if (type1 != null) { |
| | | String defaultPid = null; |
| | | if (type1 == AdUtil.AD_TYPE.csj) { |
| | | defaultPid = CSJConstant.SPLASH_AD_HOT; |
| | | } else if (type1 == AdUtil.AD_TYPE.gdt) { |
| | | defaultPid = GDTConstant.PID_SPLASH_HOT; |
| | | } |
| | | if (StringUtils.isNullOrEmpty(pid1)) { |
| | | defaultPid = pid1; |
| | | } |
| | | adPidInfo1 = new AdPidInfo(type1, defaultPid); |
| | | if (type1 == AdUtil.AD_TYPE.csj) { |
| | | adPidInfo2 = new AdPidInfo(AdUtil.AD_TYPE.gdt, GDTConstant.PID_SPLASH_HOT); |
| | | } else if (type1 == AdUtil.AD_TYPE.gdt) { |
| | | adPidInfo2 = new AdPidInfo(AdUtil.AD_TYPE.csj, CSJConstant.SPLASH_AD_HOT); |
| | | } |
| | | } |
| | | |
| | | |
| | | SplashADFragment.loadAd(getApplicationContext(), adPidInfo1, adPidInfo2, null, null, true, new SplashADFragment.AdLoadResultListener() { |
| | | |
| | | @Override |
| | | public void onAdLoad(SplashAdLoadInfo adLoadInfo) { |
| | |
| | | @Expose |
| | | private int count; |
| | | @Expose |
| | | private int pageSize; |
| | | private int number; |
| | | |
| | | //当前页码(0-开始) |
| | | private int currentPage; |
| | |
| | | this.count = count; |
| | | } |
| | | |
| | | public int getPageSize() { |
| | | return pageSize; |
| | | public int getNumber() { |
| | | return number; |
| | | } |
| | | |
| | | public void setPageSize(int pageSize) { |
| | | this.pageSize = pageSize; |
| | | public void setNumber(int number) { |
| | | this.number = number; |
| | | } |
| | | |
| | | public int getCurrentPage() { |
New file |
| | |
| | | package com.weikou.beibeivideo.entity.ad; |
| | | |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class AdPidInfo implements Serializable { |
| | | private AdUtil.AD_TYPE adType; |
| | | private String pid; |
| | | |
| | | public AdPidInfo(AdUtil.AD_TYPE adType, String pid) { |
| | | this.adType = adType; |
| | | this.pid = pid; |
| | | } |
| | | |
| | | public AdUtil.AD_TYPE getAdType() { |
| | | return adType; |
| | | } |
| | | |
| | | public void setAdType(AdUtil.AD_TYPE adType) { |
| | | this.adType = adType; |
| | | } |
| | | |
| | | public String getPid() { |
| | | return pid; |
| | | } |
| | | |
| | | public void setPid(String pid) { |
| | | this.pid = pid; |
| | | } |
| | | } |
| | |
| | | |
| | | public enum AdPositionEnum { |
| | | splash("splash"),//开屏 |
| | | splashHotStart("splashHotStart"),//热启动开屏 |
| | | videoPlayPre("videoPlayPre"),//视频播放前贴 |
| | | exitApp("exitApp"),//APP退出广告 |
| | | videoSearch("videoSearch"),//搜索页广告 |
New file |
| | |
| | | package com.weikou.beibeivideo.entity.vo; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | |
| | | public class VideoDetailAdInfoVO { |
| | | //播放前贴广告 |
| | | @Expose |
| | | private boolean playVideo; |
| | | //全屏视频广告 |
| | | @Expose |
| | | private boolean fullVideo; |
| | | |
| | | public boolean isPlayVideo() { |
| | | return playVideo; |
| | | } |
| | | |
| | | public void setPlayVideo(boolean playVideo) { |
| | | this.playVideo = playVideo; |
| | | } |
| | | |
| | | public boolean isFullVideo() { |
| | | return fullVideo; |
| | | } |
| | | |
| | | public void setFullVideo(boolean fullVideo) { |
| | | this.fullVideo = fullVideo; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.BeibeiVideoApplication; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.ad.AdPidInfo; |
| | | import com.weikou.beibeivideo.entity.ad.AdPositionEnum; |
| | | import com.weikou.beibeivideo.entity.ad.AdTypeVO; |
| | | import com.weikou.beibeivideo.entity.ad.SplashAdLoadInfo; |
| | |
| | | |
| | | private SplashADFragment splashADFragment; |
| | | |
| | | private void loadSplashAd(final AdUtil.AD_TYPE adType, final String pid) { |
| | | SplashADFragment.loadAd(getApplicationContext(), adType, pid, true, new SplashADFragment.AdLoadResultListener() { |
| | | |
| | | @Override |
| | | public void onAdLoad(SplashAdLoadInfo adLoadInfo) { |
| | | splashADFragment = SplashADFragment.newInstance(); |
| | | splashADFragment.setAdShowListener(new SplashADFragment.AdShowListener() { |
| | | @Override |
| | | public void onClose() { |
| | | toMainActivity(); |
| | | } |
| | | }); |
| | | getSupportFragmentManager().beginTransaction().replace(R.id.fl_splash_ad, splashADFragment).commitAllowingStateLoss(); |
| | | } |
| | | private void loadSplashAd(AdUtil.AD_TYPE adType, String pid) { |
| | | AdPidInfo adPidInfo2 = null; |
| | | if (adType == AdUtil.AD_TYPE.gdt) { |
| | | adPidInfo2 = new AdPidInfo(AdUtil.AD_TYPE.csj, CSJConstant.SPLASH_AD); |
| | | } else { |
| | | adPidInfo2 = new AdPidInfo(AdUtil.AD_TYPE.gdt, BeibeiConstant.GDT_SPLASH_POSITION_ID); |
| | | } |
| | | |
| | | @Override |
| | | public void onNoAd() { |
| | | toMainActivity(); |
| | | } |
| | | |
| | | splashADFragment = SplashADFragment.newInstance(new AdPidInfo(adType, pid), adPidInfo2); |
| | | splashADFragment.setAdShowListener(new SplashADFragment.AdShowListener() { |
| | | @Override |
| | | public void onClose() { |
| | | toMainActivity(); |
| | | } |
| | | }); |
| | | |
| | | //直接加载广告 |
| | | getSupportFragmentManager().beginTransaction().replace(R.id.fl_splash_ad, splashADFragment).commitAllowingStateLoss(); |
| | | } |
| | | |
| | | private void myRequetPermission() { |
| | |
| | | import android.widget.TextView; |
| | | |
| | | import com.bytedance.sdk.openadsdk.TTSplashAd; |
| | | import com.qq.e.ads.splash.SplashAD; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.ad.AdPidInfo; |
| | | import com.weikou.beibeivideo.entity.ad.AdPositionEnum; |
| | | import com.weikou.beibeivideo.entity.ad.SplashAdLoadInfo; |
| | | import com.weikou.beibeivideo.ui.SplashActivity; |
| | |
| | | private FrameLayout fl_ad; |
| | | |
| | | private static SplashAdLoadInfo adLoadInfo; |
| | | public static long lastShowTime = 0L; |
| | | |
| | | private AdShowListener mAdShowListener; |
| | | |
| | |
| | | this.mAdShowListener = mAdShowListener; |
| | | } |
| | | |
| | | /** |
| | | * 加载开屏广告 |
| | | * |
| | | * @param adType |
| | | */ |
| | | private SplashADFragment() { |
| | | |
| | | } |
| | | |
| | | public static SplashADFragment newInstance(AdPidInfo pid1, AdPidInfo pid2) { |
| | | SplashADFragment fragment = new SplashADFragment(); |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putSerializable("pid1", pid1); |
| | | bundle.putSerializable("pid2", pid2); |
| | | fragment.setArguments(bundle); |
| | | return fragment; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 加载开屏广告 |
| | | * |
| | | * @param context |
| | | * @param adType1 |
| | | * @param pid1 |
| | | * @param adPidInfo1 |
| | | * @param adPidInfo2 |
| | | * @param skip |
| | | * @param time |
| | | * @param first |
| | | * @param adLoadResultListener |
| | | */ |
| | | public static void loadAd(Context context, AdUtil.AD_TYPE adType1, String pid1, boolean first, AdLoadResultListener adLoadResultListener) { |
| | | if (adType1 == null) { |
| | | adType1 = AdUtil.getAdType(context, AdPositionEnum.splash); |
| | | pid1 = AdUtil.getAdPid(context, AdPositionEnum.splash); |
| | | public static void loadAd(Context context, AdPidInfo adPidInfo1, AdPidInfo adPidInfo2, View skip, TextView time, boolean first, AdLoadResultListener adLoadResultListener) { |
| | | if (adPidInfo1 == null) { |
| | | if (adLoadResultListener != null) |
| | | adLoadResultListener.onNoAd(); |
| | | return; |
| | | } |
| | | |
| | | final AdUtil.AD_TYPE adType = adType1; |
| | | final String pid = pid1; |
| | | |
| | | SplashAdUtil.loadAD(pid, adType, context, null, null, null, new SplashAdUtil.SplashAdListener() { |
| | | SplashAdUtil.loadAD(adPidInfo1.getPid(), adPidInfo1.getAdType(), context, skip, time, new SplashAdUtil.SplashAdListener() { |
| | | @Override |
| | | public void onAdLoad(SplashAdLoadInfo adLoadInfo) { |
| | | SplashADFragment.adLoadInfo = adLoadInfo; |
| | |
| | | |
| | | @Override |
| | | public void noAd() {//初次加载未加载出广告 |
| | | if (AdUtil.AD_TYPE.csj == adType) { |
| | | if (first) { |
| | | loadAd(context, AdUtil.AD_TYPE.gdt, BeibeiConstant.GDT_SPLASH_POSITION_ID, false, adLoadResultListener); |
| | | } else { |
| | | if (adLoadResultListener != null) |
| | | adLoadResultListener.onNoAd(); |
| | | } |
| | | } else if (AdUtil.AD_TYPE.gdt == adType) { |
| | | //再次加载穿山甲广告 |
| | | if (first) { |
| | | loadAd(context, AdUtil.AD_TYPE.csj, CSJConstant.SPLASH_AD, false, adLoadResultListener); |
| | | } else { |
| | | if (adLoadResultListener != null) |
| | | adLoadResultListener.onNoAd(); |
| | | } |
| | | |
| | | if (first) { |
| | | loadAd(context, adPidInfo2, null, skip, time, false, adLoadResultListener); |
| | | } else { |
| | | if (adLoadResultListener != null) |
| | | adLoadResultListener.onNoAd(); |
| | |
| | | private Timer timer; |
| | | private int leftTime = 5; |
| | | |
| | | public void showAd() { |
| | | public boolean showAd() { |
| | | if (isAdLoaded()) { |
| | | //穿山甲广告 |
| | | if (adLoadInfo.getCsjAd() != null) { |
| | |
| | | ad.setSplashInteractionListener(new TTSplashAd.AdInteractionListener() { |
| | | @Override |
| | | public void onAdClicked(View view, int type) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdShow(View view, int type) { |
| | | lastShowTime = System.currentTimeMillis(); |
| | | } |
| | | |
| | | @Override |
| | | public void onAdSkip() { |
| | | |
| | | if (mAdShowListener != null) |
| | | mAdShowListener.onClose(); |
| | | } |
| | | |
| | | @Override |
| | | public void onAdTimeOver() { |
| | | |
| | | if (mAdShowListener != null) |
| | | mAdShowListener.onClose(); |
| | | } |
| | | }); |
| | | |
| | | if (timer == null) |
| | | timer = new Timer(); |
| | | timer.cancel(); |
| | | if (timer != null) |
| | | timer.cancel(); |
| | | timer = new Timer(); |
| | | ll_input.setVisibility(View.VISIBLE); |
| | | timer.schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | leftTime--; |
| | | if (leftTime < 0) { |
| | | timer.cancel(); |
| | | //进入主页 |
| | | mAdShowListener.onClose(); |
| | | if (ad_close_time != null) |
| | | ad_close_time.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (ad_close_time != null) |
| | | ad_close_time.setVisibility(View.GONE); |
| | | if (ll_input != null) |
| | | ll_input.setClickable(true); |
| | | } |
| | | }); |
| | | |
| | | |
| | | return; |
| | | } else { |
| | | //倒计时 |
| | |
| | | ad_close_time.setText(leftTime + ""); |
| | | } |
| | | }); |
| | | |
| | | ll_input.setClickable(false); |
| | | } |
| | | } |
| | | }, 1000, 1000); |
| | |
| | | ll_input.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | fl_ad.removeAllViews(); |
| | | mAdShowListener.onClose(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | adLoadInfo = null; |
| | | } else if (adLoadInfo.getGdtSplashAd() != null) { |
| | | adLoadInfo.getGdtSplashAd().showAd(fl_ad); |
| | | SplashAD splashAD = adLoadInfo.getGdtSplashAd(); |
| | | splashAD.showAd(fl_ad); |
| | | lastShowTime = System.currentTimeMillis(); |
| | | adLoadInfo = null; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | return false; |
| | | } |
| | | |
| | | public static SplashADFragment newInstance() { |
| | | Bundle bundle = new Bundle(); |
| | | |
| | | SplashADFragment fragment = new SplashADFragment(); |
| | | fragment.setArguments(bundle); |
| | | return fragment; |
| | | } |
| | | |
| | | private void initView(View root) { |
| | | ll_input = root.findViewById(R.id.ll_input); |
| | | ad_close_time = root.findViewById(R.id.ad_close_time); |
| | | fl_ad = root.findViewById(R.id.fl_ad); |
| | | } |
| | | |
| | | @Nullable |
| | |
| | | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View root = LayoutInflater.from(getContext()).inflate(R.layout.fragment_splash_ad, null); |
| | | initView(root); |
| | | showAd(); |
| | | if (!showAd()) { |
| | | Bundle arguments = getArguments(); |
| | | AdPidInfo adPidInfo1 = null; |
| | | AdPidInfo adPidInfo2 = null; |
| | | if (arguments != null) { |
| | | adPidInfo1 = (AdPidInfo) arguments.getSerializable("pid1"); |
| | | adPidInfo2 = (AdPidInfo) arguments.getSerializable("pid2"); |
| | | } |
| | | |
| | | loadAd(getContext(), adPidInfo1, adPidInfo2, ll_input, ad_close_time, true, new SplashADFragment.AdLoadResultListener() { |
| | | |
| | | @Override |
| | | public void onAdLoad(SplashAdLoadInfo adLoadInfo) { |
| | | showAd(); |
| | | } |
| | | |
| | | @Override |
| | | public void onNoAd() { |
| | | if (mAdShowListener != null) |
| | | mAdShowListener.onClose(); |
| | | } |
| | | |
| | | @Override |
| | | public void onClose() { |
| | | if (mAdShowListener != null) |
| | | mAdShowListener.onClose(); |
| | | } |
| | | }); |
| | | } |
| | | return root; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | setContentView(R.layout.activity_main); |
| | | setContentView(R.layout.activity_splash_ad); |
| | | TopStatusSettings.setStatusViewAndDeepColor(this); |
| | | EventBus.getDefault().register(this); |
| | | splashADFragment = SplashADFragment.newInstance(); |
| | | splashADFragment = SplashADFragment.newInstance(null, null); |
| | | splashADFragment.setAdShowListener(new SplashADFragment.AdShowListener() { |
| | | @Override |
| | | public void onClose() { |
| | |
| | | rl_category_video.setRefreshing(true); |
| | | category_two = 1; |
| | | |
| | | tv_new.setBackgroundResource(R.drawable.ic_select2); |
| | | tv_hot.setBackgroundResource(R.drawable.shape_video_detail_follow_btn); |
| | | tv_new.setBackground(getResources().getDrawable(R.drawable.shape_video_list_nav_highlight_bg)); |
| | | tv_hot.setBackground(getResources().getDrawable(R.drawable.shape_video_list_nav_bg)); |
| | | |
| | | tv_new.setTextColor(Color.parseColor("#3B3B3B")); |
| | | tv_hot.setTextColor(Color.parseColor("#efefef")); |
| | | tv_new.setTextColor(getResources().getColor(R.color.video_list_nav_hightlight_text_color)); |
| | | tv_hot.setTextColor(getResources().getColor(R.color.video_list_nav_text_color)); |
| | | |
| | | getVideoList(); |
| | | break; |
| | |
| | | mCurrentPage = 1; |
| | | category_two = 2; |
| | | rl_category_video.setRefreshing(true); |
| | | tv_new.setBackgroundResource(R.drawable.shape_video_detail_follow_btn); |
| | | tv_hot.setBackgroundResource(R.drawable.ic_select2); |
| | | tv_hot.setTextColor(Color.parseColor("#3B3B3B")); |
| | | tv_new.setTextColor(Color.parseColor("#efefef")); |
| | | tv_hot.setBackground(getResources().getDrawable(R.drawable.shape_video_list_nav_highlight_bg)); |
| | | tv_new.setBackground(getResources().getDrawable(R.drawable.shape_video_list_nav_bg)); |
| | | tv_hot.setTextColor(getResources().getColor(R.color.video_list_nav_hightlight_text_color)); |
| | | tv_new.setTextColor(getResources().getColor(R.color.video_list_nav_text_color)); |
| | | getVideoList(); |
| | | break; |
| | | |
| | |
| | | import android.os.Handler; |
| | | import android.support.v7.widget.LinearLayoutManager; |
| | | import android.support.v7.widget.RecyclerView; |
| | | import android.text.SpannableString; |
| | | import android.text.Spanned; |
| | | import android.text.style.ForegroundColorSpan; |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | |
| | | .build(); |
| | | |
| | | public static EpisodeFragment newInstance(VideoInfo videoInfo, |
| | | int playingPosition, int start, int end,String from) { |
| | | int playingPosition, int start, int end, String from) { |
| | | EpisodeFragment episodeFragment = new EpisodeFragment(); |
| | | Bundle args = new Bundle(); |
| | | args.putSerializable("video_info", videoInfo); |
| | |
| | | } |
| | | |
| | | private void setFollowData(boolean attention) { |
| | | tv_cancle_follow.setBackgroundResource(R.drawable.shape_video_detail_follow_btn); |
| | | tv_cancle_follow.setTextColor(getResources().getColor(R.color.video_detail_follow_text_color)); |
| | | if (attention) { |
| | | tv_cancle_follow.setText("已关注"); |
| | | tv_cancle_follow.setCompoundDrawables(null, null, null, null); |
| | | } else { |
| | | tv_cancle_follow.setText("关注"); |
| | | Drawable drawable = getResources().getDrawable(R.drawable.ic_follow_add); |
| | | Drawable drawable = getResources().getDrawable(R.drawable.ic_follow_add_w); |
| | | drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); |
| | | tv_cancle_follow.setCompoundDrawables(drawable, null, null, null); |
| | | } |
| | |
| | | |
| | | tv_video_resource = contentView.findViewById(R.id.tv_video_resource); |
| | | ll_add_attention = contentView.findViewById(R.id.ll_add_attention); |
| | | ll_add_attention.setBackgroundResource(R.drawable.shape_video_detail_follow_bg); |
| | | tv_title = contentView.findViewById(R.id.tv_title); |
| | | tv_score = contentView.findViewById(R.id.tv_score); |
| | | tv_play_num = contentView.findViewById(R.id.tv_play_num); |
| | |
| | | |
| | | private ProgressDialog pd; |
| | | |
| | | private void setResource(String resource) { |
| | | SpannableString st = new SpannableString(resource); |
| | | st.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.video_detail_resource_text_color)), 3, resource.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); |
| | | tv_video_resource.setText(st); |
| | | } |
| | | |
| | | private void initResource() { |
| | | |
| | | if (mVideoInfo.getResourceList() != null |
| | | && mVideoInfo.getResourceList().size() > 0) { |
| | | tv_video_resource.setVisibility(View.VISIBLE); |
| | | String resource = ""; |
| | | if (selectedUrl == null || selectedUrl.getPicture() == null) { |
| | | tv_video_resource.setText("来源:其他"); |
| | | resource = "来源:其他"; |
| | | } else { |
| | | tv_video_resource.setText("来源:" + selectedUrl.getName()); |
| | | resource = "来源:" + selectedUrl.getName(); |
| | | } |
| | | setResource(resource); |
| | | |
| | | popupWindow = new PopupWindow( |
| | | com.weikou.beibeivideo.util.DimenUtils.dip2px(getContext(), 120), |
| | | android.view.WindowManager.LayoutParams.WRAP_CONTENT); |
| | | popupWindow.setOutsideTouchable(true);// 点击外部可点击 |
| | | popupWindow.setBackgroundDrawable(new ColorDrawable(0));// 设置背景 |
| | | popupWindow.setBackgroundDrawable(getResources().getDrawable(R.drawable.shape_video_detail_resource_bg)); |
| | | popupWindow.setAnimationStyle(R.style.PopupAnimation); |
| | | popupWindow.setFocusable(true);// 获取焦点 |
| | | |
| | |
| | | ListView.LayoutParams param = new ListView.LayoutParams( |
| | | FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | lv.setLayoutParams(param); |
| | | lv.setBackground(getResources().getDrawable(R.drawable.shape_video_detail_resource_bg)); |
| | | |
| | | lv.setOnItemClickListener(new OnItemClickListener() { |
| | | @Override |
| | | public void onItemClick(AdapterView<?> parent, View view, |
| | |
| | | pd.show(); |
| | | getVideoDetail(mVideoInfo.getId(), urlList |
| | | .get(position).getId(), mVideoInfo |
| | | .getThirdType(), true,fromName); |
| | | .getThirdType(), true, fromName); |
| | | } |
| | | selectedUrl = urlList.get(position); |
| | | if (selectedUrl == null || selectedUrl.getPicture() == null) { |
| | | tv_video_resource.setText("来源:其他"); |
| | | setResource("来源:其他"); |
| | | } else { |
| | | tv_video_resource.setText("来源:" + selectedUrl.getName()); |
| | | setResource("来源:" + selectedUrl.getName()); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | lv.setAdapter(new ResourceAdapter(urlList)); |
| | | lv.setDivider(new ColorDrawable(Color.BLACK)); |
| | | lv.setDividerHeight(1); |
| | | lv.setDividerHeight(0); |
| | | popupWindow.setContentView(lv); |
| | | /* |
| | | * Window dialogWindow = dialog.getWindow(); dialogWindow.get |
| | |
| | | TextView tv = view.findViewById(R.id.tv_resource); |
| | | try { |
| | | Glide.with(getActivity().getApplicationContext()) |
| | | .load(reList.get(position).getPicture().contains("http://") ? reList |
| | | .get(position).getPicture() : BeibeiConstant.HOST |
| | | + "/BuWan/" + reList.get(position).getPicture()) |
| | | .load(reList.get(position).getPicture()) |
| | | .apply(new RequestOptions().placeholder(R.drawable.from_other).error(R.drawable.from_other)) |
| | | .into(iv); |
| | | } catch (IllegalArgumentException e) { |
| | |
| | | import com.weikou.beibeivideo.entity.VideoInfo; |
| | | import com.weikou.beibeivideo.entity.VideoResource; |
| | | import com.weikou.beibeivideo.entity.video.ChangeVideoEvent; |
| | | import com.weikou.beibeivideo.entity.vo.VideoDetailAdInfoVO; |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | import com.weikou.beibeivideo.ui.ad.PlayVideoPreADFragment; |
| | | import com.weikou.beibeivideo.ui.common.ShareActivity; |
| | |
| | | private boolean playerLock;//播放器是否锁屏 |
| | | |
| | | private String from; |
| | | |
| | | private VideoDetailAdInfoVO adInfo; |
| | | |
| | | @Override |
| | | protected void onSaveInstanceState(Bundle outState) { |
| | |
| | | |
| | | |
| | | private void loadFullVideoAd() { |
| | | if (adInfo == null || !adInfo.isFullVideo()) |
| | | return; |
| | | //加载广告 |
| | | if (BeibeiConstant.AD_TYPE.isVideoDetailSplashAd()) { |
| | | if (FullVideoAdManager.getInstance().isCacahed()) { |
| | |
| | | if (BeibeiConstant.IS_TEST) |
| | | BeibeiConstant.AD_TYPE = null; |
| | | //需要加载广告 |
| | | if (BeibeiConstant.AD_TYPE != null && BeibeiConstant.AD_TYPE.isPlayerAd() && playUrl != null && playUrl.getPlayType() != 2) { |
| | | if (BeibeiConstant.AD_TYPE != null && BeibeiConstant.AD_TYPE.isPlayerAd() && playUrl != null && playUrl.getPlayType() != 2 && adInfo != null && adInfo.isPlayVideo()) { |
| | | mVideoDetailVideoAdFragment = new PlayVideoPreADFragment(); |
| | | mVideoDetailVideoAdFragment.setPageEventListener(new IPageEventListener() { |
| | | @Override |
| | |
| | | Gson gson = new GsonBuilder().setFieldNamingPolicy( |
| | | FieldNamingPolicy.UPPER_CAMEL_CASE) |
| | | .create(); |
| | | JSONObject videoJson = data.optJSONObject("Video"); |
| | | final VideoInfo videoInfo = gson |
| | | .fromJson(jsonObject.getJSONObject("Data") |
| | | .fromJson(videoJson |
| | | .toString(), |
| | | new TypeToken<VideoInfo>() { |
| | | }.getType()); |
| | | if (videoInfo != null) { |
| | | VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application, videoInfo.getVideoDetailList(), false); |
| | | } |
| | | // 附加字段 |
| | | if (jsonObject.optJSONObject("Extra1") != null) { |
| | | if (jsonObject.optJSONObject("Extra1").optJSONObject("Attention") != null) { |
| | | JSONObject obj = jsonObject.optJSONObject("Extra1").optJSONObject("Attention"); |
| | | Follow attention = new Follow(); |
| | | attention.setMovieName(obj.optString("Name")); |
| | | attention.setMoviePicture(obj.optString("Picture")); |
| | | attention.setUpdateInfo(obj.optString("UpdateInfo")); |
| | | attention.setAttention(Boolean.parseBoolean(obj.optString("IsAttention"))); |
| | | videoInfo.setAttention(attention); |
| | | } |
| | | |
| | | if (data.optJSONObject("AdInfo") != null) { |
| | | adInfo = gson.fromJson(data.optJSONObject("AdInfo").toString(), VideoDetailAdInfoVO.class); |
| | | } |
| | | // 关注 |
| | | if (data.optJSONObject("Attention") != null) { |
| | | JSONObject obj = data.optJSONObject("Attention"); |
| | | Follow attention = new Follow(); |
| | | attention.setMoviePicture(obj.optString("Picture")); |
| | | attention.setMovieName(obj.optString("Name")); |
| | | attention.setUpdateInfo(obj.optString("UpdateInfo")); |
| | | attention.setAttention(obj.optBoolean("Attention")); |
| | | videoInfo.setAttention(attention); |
| | | } |
| | | VideoDetailActivity2.this.videoInfo = videoInfo; |
| | | JSONArray extraData = jsonObject |
| | |
| | | import android.content.SharedPreferences; |
| | | import android.content.pm.ActivityInfo; |
| | | import android.graphics.Color; |
| | | import android.net.Uri; |
| | | import android.net.http.SslError; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.lcjian.library.RetainViewFragment; |
| | | import com.lcjian.library.dialog.DialogUtil; |
| | | import com.lcjian.library.util.SingleToast; |
| | |
| | | import com.weikou.beibeivideo.ui.dialog.VIPDialog; |
| | | import com.weikou.beibeivideo.ui.login.LoginActivity; |
| | | import com.weikou.beibeivideo.ui.main.MainActivity; |
| | | import com.weikou.beibeivideo.ui.video.VideoPlayerBrowserActivity; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.ConfigUtil; |
| | | import com.weikou.beibeivideo.util.DimenUtils; |
| | |
| | | private boolean showAd = true; |
| | | |
| | | private Dialog loadingDialog; |
| | | private ImageView iv_refresh; |
| | | private TextView tv_right; |
| | | |
| | | private AQuery query; |
| | | |
| | | |
| | | private void getPPVideoInfo(String url) { |
| | |
| | | return super.onConsoleMessage(consoleMessage); |
| | | } |
| | | |
| | | @Override |
| | | public void onReceivedTitle(WebView view, String title) { |
| | | super.onReceivedTitle(view, title); |
| | | tv_url.setText(view.getUrl()); |
| | | tv_title.setText(title); |
| | | } |
| | | |
| | | /** |
| | | * 全屏播放配置 |
| | | */ |
| | |
| | | getActivity().getWindow().setAttributes(attrs); |
| | | ll_bottom.setVisibility(View.GONE); |
| | | ll_top.setVisibility(View.GONE); |
| | | query.id(R.id.tv_top_bar_left1).visibility(View.VISIBLE); |
| | | } |
| | | |
| | | @Override |
| | |
| | | attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN; |
| | | getActivity().getWindow().setAttributes(attrs); |
| | | setLeftTime(); |
| | | query.id(R.id.tv_top_bar_left1).visibility(View.GONE); |
| | | } |
| | | }); |
| | | WebSettings webSetting = webview.getSettings(); |
| | |
| | | |
| | | @Override |
| | | public void onCreateView(View contentView, Bundle savedInstanceState) { |
| | | query = new AQuery(contentView); |
| | | initView(contentView); |
| | | Bundle bundle = getArguments(); |
| | | if (bundle != null) { |
| | |
| | | ll_top = view.findViewById(R.id.ll_top); |
| | | tv_title = view.findViewById(R.id.tv_title); |
| | | tv_url = view.findViewById(R.id.tv_url); |
| | | iv_refresh = view.findViewById(R.id.iv_refresh); |
| | | tv_right = view.findViewById(R.id.tv_right); |
| | | query.id(R.id.tv_top_bar_left1).clicked(this); |
| | | |
| | | |
| | | iv_favourite.setOnClickListener(this); |
| | | iv_watch_history.setOnClickListener(this); |
| | | ll_vip_open.setOnClickListener(this); |
| | | iv_refresh.setOnClickListener(this); |
| | | tv_right.setOnClickListener(this); |
| | | tv_url.setOnClickListener(new View.OnClickListener() { |
| | | |
| | | @Override |
| | |
| | | jumpToVIP(); |
| | | } |
| | | }).create(); |
| | | |
| | | query.id(R.id.fl_menu).clicked(new OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | hiddenMenu(); |
| | | } |
| | | }); |
| | | |
| | | query.id(R.id.tv_refresh).clicked(new OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | hiddenMenu(); |
| | | webview.reload(); |
| | | } |
| | | }); |
| | | |
| | | query.id(R.id.tv_copy).clicked(new OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | hiddenMenu(); |
| | | ClipboardUtil.copy(getContext(), tv_url.getText().toString()); |
| | | Toast.makeText(getContext(), "复制成功", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | }); |
| | | |
| | | query.id(R.id.tv_open).clicked(new OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | hiddenMenu(); |
| | | String url = tv_url.getText().toString(); |
| | | Uri uri = Uri.parse(url); |
| | | Intent intent = new Intent(Intent.ACTION_VIEW, uri); |
| | | startActivity(intent); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | |
| | | super.onDestroy(); |
| | | } |
| | | |
| | | private void hiddenMenu() { |
| | | query.id(R.id.fl_menu).visibility(View.GONE); |
| | | } |
| | | |
| | | private void showMenu() { |
| | | query.id(R.id.fl_menu).visibility(View.VISIBLE); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | switch (v.getId()) { |
| | | case R.id.tv_top_bar_left: { |
| | | case R.id.tv_top_bar_left: |
| | | case R.id.tv_top_bar_left1: { |
| | | if (getActivity().getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) { |
| | | if (webview != null) |
| | | webview.loadUrl("javascript:exitFullScreenPlay();"); |
| | |
| | | case R.id.ll_vip_open: |
| | | jumpToVIP(); |
| | | break; |
| | | case R.id.iv_refresh: |
| | | if (webview != null) { |
| | | webview.reload(); |
| | | } |
| | | case R.id.tv_right: |
| | | if (query.id(R.id.fl_menu).getView().getVisibility() == View.VISIBLE) |
| | | hiddenMenu(); |
| | | else |
| | | showMenu(); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | rl_recommend.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { |
| | | @Override |
| | | public void onRefresh() { |
| | | if (position == 0) { |
| | | getHotStars(); |
| | | } |
| | | |
| | | //加载广告 |
| | | loadAd(); |
| | | getHomeAd(); |
| | |
| | | rl_recommend.setRefreshing(true); |
| | | getHomeAd(); |
| | | Log.i("mResult", "onCreate---postDelayed---loadAD1"); |
| | | if (position == 0) |
| | | getHotStars(); |
| | | } |
| | | } |
| | | }, 500); |
| | |
| | | List<HomeVideo> homeList = new ArrayList<HomeVideo>(); |
| | | if (homeArray != null && homeArray.length() > 0) { |
| | | for (int j = 0; j < homeArray.length(); j++) { |
| | | |
| | | homeList.add(gson.fromJson(homeArray |
| | | .optJSONObject(j).toString(), |
| | | HomeVideo.class)); |
| | | //TODO 测试 |
| | | if (i == 1 && j == 0) { |
| | | homeList.get(0).setBigPicture(true); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | type.setHomeVideoList(homeList); |
| | | JSONArray itemArray = obj |
| | | .optJSONArray("ItemTypeList"); |
| | |
| | | } |
| | | |
| | | //不足一页不显示刷新 |
| | | if (homeType.getCount() <= homeType.getPageSize()) { |
| | | if (homeType.getCount() <= homeType.getNumber()) { |
| | | refreshP = 0; |
| | | } |
| | | |
| | |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.lcjian.library.util.common.SoftKeyboardUtils; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.qq.e.ads.cfg.VideoOption; |
| | | import com.qq.e.ads.nativ.NativeADUnifiedListener; |
| | | import com.qq.e.ads.nativ.NativeUnifiedAD; |
| | | import com.qq.e.ads.nativ.NativeUnifiedADData; |
| | | import com.qq.e.comm.util.AdError; |
| | | import com.weikou.beibeivideo.BasicTextHttpResponseHandler; |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.R; |
| | |
| | | import com.weikou.beibeivideo.util.DimenUtils; |
| | | import com.weikou.beibeivideo.util.UmengEventUtil; |
| | | import com.weikou.beibeivideo.util.ad.ExpressAdManager; |
| | | import com.weikou.beibeivideo.util.ad.GDTConstant; |
| | | import com.weikou.beibeivideo.util.ad.manager.SearchResultAdManager; |
| | | import com.weikou.beibeivideo.util.ui.DividerItemDecoration; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | |
| | | } |
| | | } |
| | | //不存在广告 |
| | | if (!hasAd) { |
| | | mVideoInfos.add(0, VideoContent.createAdContent(SearchResultActivity.this.adList.get(0))); |
| | | if (!hasAd && mVideoInfos.size() > 2) { |
| | | //TODO 测试 |
| | | VideoContent videoContent = VideoContent.createAdContent(SearchResultActivity.this.adList.get(0)); |
| | | mVideoInfos.add(2, videoContent); |
| | | SearchResultActivity.this.adList.remove(0); |
| | | adapter.notifyDataSetChanged(); |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | //拉取2.0的自渲染广告 |
| | | private void loadAd() { |
| | | ExpressAdContainer ad = SearchResultAdManager.getInstance(getApplicationContext()).consumeAD(); |
| | | if (ad == null) { |
| | | SearchResultAdManager.getInstance(getApplicationContext()).loadAD(1, new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | | String pid = GDTConstant.PID_2_SEARCH_RESULT_ALBUM; |
| | | NativeUnifiedAD mAdManager = new NativeUnifiedAD(this, pid, new NativeADUnifiedListener() { |
| | | |
| | | @Override |
| | | public void onNoAD(AdError adError) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADLoaded(List<NativeUnifiedADData> list) { |
| | | if (list != null && list.size() > 0) { |
| | | List<ExpressAdContainer> adList = new ArrayList<>(); |
| | | adList.add(new ExpressAdContainer(list.get(0))); |
| | | fillAD(adList); |
| | | } |
| | | }); |
| | | } else { |
| | | List<ExpressAdContainer> adList = new ArrayList<>(); |
| | | adList.add(ad); |
| | | fillAD(adList); |
| | | } |
| | | //加载下一个需要的广告 |
| | | SearchResultAdManager.getInstance(getApplicationContext()).autoLoadAd(); |
| | | } |
| | | }); |
| | | mAdManager.setVideoPlayPolicy(VideoOption.VideoPlayPolicy.AUTO); |
| | | mAdManager.loadData(1); |
| | | } |
| | | |
| | | // private void loadAd() { |
| | | // ExpressAdContainer ad = SearchResultAdManager.getInstance(getApplicationContext()).consumeAD(); |
| | | // if (ad == null) { |
| | | // SearchResultAdManager.getInstance(getApplicationContext()).loadAD(1, new ExpressAdManager.IAdLoadListener() { |
| | | // @Override |
| | | // public void onSuccess(List<ExpressAdContainer> adList) { |
| | | // fillAD(adList); |
| | | // } |
| | | // }); |
| | | // } else { |
| | | // List<ExpressAdContainer> adList = new ArrayList<>(); |
| | | // adList.add(ad); |
| | | // fillAD(adList); |
| | | // } |
| | | // //加载下一个需要的广告 |
| | | // SearchResultAdManager.getInstance(getApplicationContext()).autoLoadAd(); |
| | | // } |
| | | |
| | | private List<ExpressAdContainer> adList = new ArrayList<>(); |
| | | |
| | | private void search(String key, String videoType) { |
| | |
| | | import android.text.style.AbsoluteSizeSpan; |
| | | import android.text.style.ForegroundColorSpan; |
| | | import android.text.style.StyleSpan; |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | |
| | | import com.bumptech.glide.Glide; |
| | | import com.lcjian.library.util.common.DimenUtils; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.qq.e.ads.nativ.NativeADEventListener; |
| | | import com.qq.e.ads.nativ.NativeUnifiedADData; |
| | | import com.qq.e.ads.nativ.widget.NativeAdContainer; |
| | | import com.qq.e.comm.constants.AdPatternType; |
| | | import com.qq.e.comm.util.AdError; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.VideoDetailInfo; |
| | | import com.weikou.beibeivideo.entity.VideoInfo; |
| | |
| | | import com.weikou.beibeivideo.ui.media.VideoDetailActivity2; |
| | | import com.weikou.beibeivideo.util.ad.ExpressAdManager; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade; |
| | |
| | | */ |
| | | public class SearchResultAdapter extends RecyclerView.Adapter { |
| | | |
| | | private static final String TAG = "SearchResultAdapter"; |
| | | private List<VideoContent> contentList; |
| | | |
| | | private Activity mContext; |
| | |
| | | } else if (viewType == TYPE_FOOTER) { |
| | | return new HeaderViewHolder(footerView); |
| | | } else if (viewType == VideoContent.TYPE_AD) { |
| | | return new VideoAdHolder(inflater.inflate(R.layout.item_video_list_column1_ad, parent, false)); |
| | | return new VideoAdHolder(inflater.inflate(R.layout.item_album_list_ad, parent, false)); |
| | | } else if (viewType == TYPE_VIDEO_ALBUM) { |
| | | return new AlbumVideoHolder(inflater.inflate(R.layout.item_video_search_result_album, parent, false)); |
| | | } else if (viewType == TYPE_VIDEO_SIMPLE) { |
| | |
| | | |
| | | final VideoContent videoContent = contentList.get(position); |
| | | if (holder instanceof AlbumVideoHolder) { |
| | | final VideoInfo info = videoContent.getVideo(); |
| | | final AlbumVideoHolder albumVideoHolder = (AlbumVideoHolder) holder; |
| | | final VideoInfo info = videoContent.getVideo(); |
| | | |
| | | try { |
| | | String pic = info.getVpicture(); |
| | | if (StringUtils.isBlank(pic)) |
| | |
| | | |
| | | } else if (holder instanceof VideoAdHolder) { |
| | | final VideoAdHolder viewHolder = (VideoAdHolder) holder; |
| | | final ExpressAdContainer ad = videoContent.getAd(); |
| | | viewHolder.fl_ad.removeAllViews(); |
| | | ExpressAdManager.renderAndFillAd(mContext, ad, viewHolder.fl_ad, new ExpressAdManager.IAdEventListener() { |
| | | @Override |
| | | public void closeAd(ExpressAdContainer ad) { |
| | | contentList.remove(videoContent); |
| | | notifyDataSetChanged(); |
| | | if (videoContent.getAd().getGdt2Unfied() != null) { |
| | | NativeUnifiedADData ad = videoContent.getAd().getGdt2Unfied(); |
| | | |
| | | Glide.with(mContext).load(ad.getImgUrl()).transition(withCrossFade()).placeholder(R.drawable.shape_video_list_cover_placeholder).into(viewHolder.iv_picture); |
| | | viewHolder.tv_name.setText(ad.getTitle()); |
| | | viewHolder.tv_actors.setText(ad.getDesc()); |
| | | |
| | | |
| | | List<View> clickableViews = new ArrayList<>(); |
| | | clickableViews.add(viewHolder.tv_play); |
| | | clickableViews.add(viewHolder.view); |
| | | ad.setNativeAdEventListener(new NativeADEventListener() { |
| | | @Override |
| | | public void onADExposed() { |
| | | Log.i(TAG, "onADExposed"); |
| | | } |
| | | |
| | | @Override |
| | | public void onADClicked() { |
| | | Log.i(TAG, "onADClicked"); |
| | | } |
| | | |
| | | @Override |
| | | public void onADError(AdError adError) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADStatusChanged() { |
| | | Log.i(TAG, "onADStatusChanged"); |
| | | } |
| | | }); |
| | | //删除多余广告标识 |
| | | for (int i = 0; i < viewHolder.mNativeAdContainer.getChildCount(); i++) { |
| | | if (viewHolder.mNativeAdContainer.getChildAt(i) instanceof ImageView) { |
| | | viewHolder.mNativeAdContainer.removeViewAt(i); |
| | | i--; |
| | | } |
| | | } |
| | | }); |
| | | // 将布局与广告进行绑定 |
| | | ad.bindAdToView(mContext, viewHolder.mNativeAdContainer, null, clickableViews); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | class VideoAdHolder extends RecyclerView.ViewHolder { |
| | | ImageView iv_picture; |
| | | TextView tv_name; |
| | | TextView tv_type; |
| | | TextView tv_actors; |
| | | TextView tv_play; |
| | | View view; |
| | | FrameLayout fl_ad; |
| | | NativeAdContainer mNativeAdContainer; |
| | | |
| | | public VideoAdHolder(View view) { |
| | | super(view); |
| | | this.view = view; |
| | | fl_ad = view.findViewById(R.id.fl_ad); |
| | | this.view = view; |
| | | iv_picture = view.findViewById(R.id.iv_picture); |
| | | tv_name = view.findViewById(R.id.tv_name); |
| | | tv_type = view.findViewById(R.id.tv_type); |
| | | tv_actors = view.findViewById(R.id.tv_actors); |
| | | tv_play = view.findViewById(R.id.tv_play); |
| | | mNativeAdContainer = view.findViewById(R.id.root); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } else if (viewHolder instanceof RecommendVideoAdHolder) {//广告 |
| | | final RecommendVideoAdHolder holder = (RecommendVideoAdHolder) viewHolder; |
| | | if (columns == 2) { |
| | | holder.rl_container.setRatio(0.625f); |
| | | holder.rl_container.setRatio(0.562f); |
| | | } else if (columns == 3) { |
| | | holder.rl_container.setRatio(1.4f); |
| | | holder.rl_container.setRatio(1.39f); |
| | | } |
| | | ExpressAdContainer ad = content.getAd(); |
| | | View v = inflater.inflate(R.layout.item_ad_list_small_gdt2, null); |
| | |
| | | @Override |
| | | public boolean shouldOverrideUrlLoading(WebView view, String url) { |
| | | Log.i(TAG, "shouldOverrideUrlLoading:" + url); |
| | | tv_url.setText(webview.getUrl()); |
| | | return super.shouldOverrideUrlLoading(view, url); |
| | | } |
| | | |
| | |
| | | public void onReceivedTitle(WebView view, String title) { |
| | | super.onReceivedTitle(view, title); |
| | | tv_title.setText(title); |
| | | tv_url.setText(view.getUrl()); |
| | | } |
| | | |
| | | /** |
| | |
| | | // loadHander.sendEmptyMessage(0); |
| | | String url = getIntent().getStringExtra("url"); |
| | | webview.loadUrl(url); |
| | | tv_url.setText(url); |
| | | } |
| | | |
| | | private void hiddenMenu() { |
| | |
| | | } |
| | | break; |
| | | case R.id.tv_right: { |
| | | setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); |
| | | findViewById(R.id.v_status_bar).setVisibility(View.GONE); |
| | | findViewById(R.id.top).setVisibility(View.GONE); |
| | | } |
| | | break; |
| | | |
| | | case R.id.tv_more: |
| | | if (query.id(R.id.fl_menu).getView().getVisibility() == View.VISIBLE) |
| | | hiddenMenu(); |
| | | else |
| | | showMenu(); |
| | | break; |
| | | } |
| | | break; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | |
| | | } else if (viewHolder instanceof RecommendVideoAdHolder) {//广告 |
| | | final RecommendVideoAdHolder holder = (RecommendVideoAdHolder) viewHolder; |
| | | if (columns == 2) { |
| | | holder.rl_container.setRatio(0.625f); |
| | | holder.rl_container.setRatio(0.562f); |
| | | } else if (columns == 3) { |
| | | holder.rl_container.setRatio(1.4f); |
| | | holder.rl_container.setRatio(1.39f); |
| | | } |
| | | ExpressAdContainer ad = content.getAd(); |
| | | View v = inflater.inflate(R.layout.item_ad_list_small_gdt2, null); |
| | |
| | | //开屏广告 |
| | | public static String SPLASH_AD = "887360667"; |
| | | |
| | | //开屏广告热启动 |
| | | public static String SPLASH_AD_HOT = "887455481"; |
| | | |
| | | //软件退出广告 |
| | | public static String APP_EXIT = "945469133"; |
| | | |
| | |
| | | public static String PID_HOME_RECOMMEND_BIG_IMG = "2011627548122579"; |
| | | |
| | | public static String PID_VIDEO_DETAIL_PLAYER = "5061928359494942"; |
| | | |
| | | public static String PID_SPLASH_HOT = "4081479119572059"; |
| | | //视频播放器下方广告位 |
| | | public static String PID_2_VIDEO_DETAIL_PLAY_EXPRESS1 = "9031528552257617"; |
| | | //相关视频下方广告位 |
| | |
| | | |
| | | public static String PID_2_VIDEO_LIST_SMALL_AD_COLUMN2 = "7001426565143389"; |
| | | |
| | | //专辑搜索结果 |
| | | public static String PID_2_SEARCH_RESULT_ALBUM = "1041571271169104"; |
| | | |
| | | |
| | | //PPTV视频前贴 |
| | | public static String PID_2_VIDEO_DETAIL_PLAYER_PRE_PPTV = "5091266068484315"; |
| | |
| | | public static String PID_2_VIDEO_DETAIL_PLAYER_REWARD_PPTV = "9051467743649673"; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.os.SystemClock; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.TextView; |
| | |
| | | |
| | | public class SplashAdUtil { |
| | | |
| | | private static final String TAG = "SplashAdUtil"; |
| | | |
| | | /** |
| | | * 加载开屏广告 |
| | | * |
| | | * @param adType |
| | | * @param context |
| | | * @param skip |
| | | * @param vg_ad |
| | | * @param tv_time |
| | | * @param splashAdListener |
| | | */ |
| | | public static void loadAD(String pid, AdUtil.AD_TYPE adType, Context context, final View skip, ViewGroup vg_ad, final TextView tv_time, final SplashAdListener splashAdListener) { |
| | | public static void loadAD(String pid, AdUtil.AD_TYPE adType, Context context, final View skip, final TextView tv_time, final SplashAdListener splashAdListener) { |
| | | if (adType == null) { |
| | | splashAdListener.close(); |
| | | return; |
| | | } |
| | | if (AdUtil.AD_TYPE.csj == adType) { |
| | | loadCSJ(pid, context, skip, vg_ad, splashAdListener); |
| | | loadCSJ(pid, context, skip, splashAdListener); |
| | | } else if (AdUtil.AD_TYPE.gdt == adType) { |
| | | loadGDT(pid, context, skip, vg_ad, tv_time, splashAdListener); |
| | | loadGDT(pid, context, skip, tv_time, splashAdListener); |
| | | } else { |
| | | splashAdListener.close(); |
| | | } |
| | |
| | | |
| | | private static SplashAD gdtSplashAD; |
| | | |
| | | private static void loadGDT(String code, Context context, final View skip, ViewGroup vg_ad, final TextView tv_time, final SplashAdListener splashAdListener) { |
| | | private static void loadGDT(String code, Context context, final View skip, final TextView tv_time, final SplashAdListener splashAdListener) { |
| | | |
| | | String channel = ManifestDataUtil.getAppMetaData(context, "UMENG_CHANNEL"); |
| | | if (StringUtils.isNullOrEmpty(code)) |
| | | code = BeibeiConstant.GDT_SPLASH_POSITION_ID; |
| | | skip.setVisibility(View.VISIBLE); |
| | | gdtSplashAD = new SplashAD(context, skip, code, new SplashADListener() { |
| | | @Override |
| | | public void onADDismissed() { |
| | |
| | | |
| | | @Override |
| | | public void onNoAD(AdError adError) { |
| | | Log.i(TAG, "GDT:onNoAD-" + adError.getErrorMsg()); |
| | | splashAdListener.noAd(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void onADPresent() { |
| | | skip.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | skip.setVisibility(View.VISIBLE); |
| | | } |
| | | }); |
| | | if (skip != null) |
| | | skip.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | skip.setVisibility(View.VISIBLE); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public void onADTick(final long l) { |
| | | tv_time.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | tv_time.setText(l / 1000 + ""); |
| | | } |
| | | }); |
| | | if (tv_time != null) |
| | | tv_time.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | tv_time.setText(l / 1000 + ""); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public void onADLoaded(long l) { |
| | | // gdtSplashAD.preLoad(); |
| | | // System.out.println(""); |
| | | splashAdListener.onAdLoad(new SplashAdLoadInfo(gdtSplashAD, l)); |
| | | Log.i(TAG, "GDT:onADLoaded-" + l); |
| | | splashAdListener.onAdLoad(new SplashAdLoadInfo(gdtSplashAD, System.currentTimeMillis() + (l - SystemClock.elapsedRealtime()))); |
| | | } |
| | | }, 0); |
| | | gdtSplashAD.fetchAdOnly(); |
| | |
| | | * |
| | | * @param context |
| | | * @param skip |
| | | * @param vg_ad |
| | | * @param splashAdListener |
| | | */ |
| | | private static void loadCSJ(String code, Context context, final View skip, final ViewGroup vg_ad, final SplashAdListener splashAdListener) { |
| | | skip.setVisibility(View.GONE); |
| | | private static void loadCSJ(String code, Context context, final View skip, final SplashAdListener splashAdListener) { |
| | | if (skip != null) |
| | | skip.setVisibility(View.GONE); |
| | | TTAdManager ttAdManager = TTAdManagerHolder.get(); |
| | | TTAdNative mTTAdNative = ttAdManager.createAdNative(context.getApplicationContext()); |
| | | //穿山甲广告 |
| | |
| | | return; |
| | | } |
| | | |
| | | splashAdListener.onAdLoad(new SplashAdLoadInfo(gdtSplashAD, System.currentTimeMillis()+1000*60*30L)); |
| | | splashAdListener.onAdLoad(new SplashAdLoadInfo(System.currentTimeMillis() + 1000 * 60 * 30L, ad)); |
| | | |
| | | } |
| | | },4000); |
| | | }, 4000); |
| | | |
| | | |
| | | } |
| | |
| | | public static void setVideoListItem(Context mContext, VideoHolder viewHolder, View.OnClickListener itemOnClickListener, final VideoInfo info, int columns) { |
| | | viewHolder.ll_video_show.setVisibility(View.VISIBLE); |
| | | if (columns == 2) { |
| | | viewHolder.rl_ratio.setRatio(0.625f); |
| | | viewHolder.rl_ratio.setRatio(0.562f); |
| | | } else if (columns == 3) { |
| | | viewHolder.rl_ratio.setRatio(1.4f); |
| | | viewHolder.rl_ratio.setRatio(1.39f); |
| | | } else { |
| | | viewHolder.rl_ratio.setRatio(0.625f); |
| | | viewHolder.rl_ratio.setRatio(0.562f); |
| | | } |
| | | |
| | | String picture = ""; |
| | |
| | | viewHolder.iv_high.setVisibility(View.GONE); |
| | | } |
| | | |
| | | info.setSubTitle("副标题副标题副标题副标题副标题副标题副标题"); |
| | | viewHolder.tv_movie_sub_title.setText(info.getSubTitle()==null?"":info.getSubTitle()); |
| | | } |
| | | |
| | |
| | | dependencies { |
| | | api fileTree(include: '*.jar', dir: 'libs') |
| | | api 'com.android.support:support-v4:27.1.1' |
| | | api files('libs/GDTSDK.unionNormal.4.333.1203.aar') |
| | | api 'com.qq.e.union:union:+' |
| | | } |
| | | |
| | | android { |