1 文件已重命名
33个文件已修改
30个文件已添加
| | |
| | | <uses-permission android:name="com.ddysvideo.mozillaonline.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED" /> |
| | | <uses-permission android:name="com.ddysvideo.mozillaonline.permission.SEND_DOWNLOAD_COMPLETED_INTENTS" /> |
| | | <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> |
| | | |
| | | <!-- 快手 --> |
| | | <permission |
| | | android:name="${applicationId}.permission.KW_SDK_BROADCAST" |
| | | android:protectionLevel="signature" /> |
| | | <uses-permission android:name="${applicationId}.permission.KW_SDK_BROADCAST" /> |
| | | |
| | | <application |
| | | android:name="com.weikou.beibeivideo.BeibeiVideoApplication" |
| | |
| | | android:name="push_kit_auto_init_enabled" |
| | | android:value="false" /> |
| | | <!-- 华为推送服务注册 --> |
| | | <!-- <service android:name=".service.HWPushService">--> |
| | | <!-- <intent-filter>--> |
| | | <!-- <action android:name="com.huawei.push.action.MESSAGING_EVENT" />--> |
| | | <!-- </intent-filter>--> |
| | | <!-- </service>--> |
| | | <!-- <service android:name=".service.HWPushService">--> |
| | | <!-- <intent-filter>--> |
| | | <!-- <action android:name="com.huawei.push.action.MESSAGING_EVENT" />--> |
| | | <!-- </intent-filter>--> |
| | | <!-- </service>--> |
| | | <!--小米推送 --> |
| | | |
| | | <meta-data |
| | |
| | | </intent-filter> |
| | | </receiver> |
| | | |
| | | |
| | | |
| | | |
| | | </application> |
| | | |
| | | </manifest> |
| | |
| | | implementation files('libs/FunshionBase-2.0.0.0.aar') |
| | | implementation files('libs/FunshionPlaySDK-2.0.0.2-buwanysdq.aar') |
| | | |
| | | implementation files('libs/tbs_sdk_thirdapp_v4.3.0.185_44085.jar') |
| | | |
| | | //阿里云手机号认证 |
| | | implementation files('libs/crashshield-2.0.0-release.aar') |
| | | implementation files('libs/logger-2.0.0-release.aar') |
| | | implementation files('libs/main-2.0.0-release.aar') |
| | | implementation files('libs/phoneNumber-L-AuthSDK-2.12.0.aar') |
| | | |
| | | //快手 |
| | | implementation files('libs/kssdk-all-3.3.23-publishRelease-b24448fc1.aar') |
| | | |
| | | |
| | | implementation 'androidx.recyclerview:recyclerview:1.0.0' |
| | |
| | | implementation project(path: ':library-GDTSDK') |
| | | implementation project(path: ':library-SocialSdk') |
| | | implementation project(path: ':library-APPUpdate') |
| | | |
| | | implementation project(path: ':library-youth') |
| | | //穿山甲广告 |
| | | implementation files('libs/open_ad_sdk_4.0.0.6.aar') |
| | | |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <item android:drawable="@drawable/ic_back_two" android:state_pressed="false"></item> |
| | | <item android:drawable="@drawable/ic_youth_back" android:state_pressed="false"></item> |
| | | <item android:drawable="@drawable/ic_back_two_highlight" android:state_pressed="true"></item> |
| | | |
| | | </selector> |
| | |
| | | android:layout_gravity="bottom" |
| | | android:background="@null" |
| | | android:padding="4dp" |
| | | android:src="@drawable/ic_back" /> |
| | | android:src="@drawable/ic_youth_back" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center_vertical" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/ic_youth_back" |
| | | android:drawablePadding="3dp" |
| | | android:gravity="center_vertical" |
| | | android:padding="8dp" |
| | |
| | | android:layout_marginRight="50dp" |
| | | android:focusable="true" |
| | | android:focusableInTouchMode="true" |
| | | android:gravity="center" |
| | | android:gravity="left" |
| | | android:orientation="vertical"> |
| | | |
| | | |
| | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center_vertical" |
| | | android:layout_marginTop="8dp" |
| | | android:layout_gravity="center_horizontal" |
| | | android:layout_marginTop="10dp" |
| | | android:layout_marginBottom="18dp" |
| | | android:gravity="left" |
| | | android:orientation="horizontal"> |
| | | |
| | | |
| | | <CheckBox |
| | | android:padding="10dp" |
| | | android:id="@+id/cb_user_agreement" |
| | | android:layout_width="15dp" |
| | | android:layout_height="15dp" |
| | |
| | | android:background="@drawable/selector_user_agreement_checkbox" |
| | | android:button="@null" |
| | | android:checked="false" |
| | | android:gravity="center" /> |
| | | android:gravity="center" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_user_agreement" |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="5dp" |
| | | android:text="@string/user_agreement" |
| | | android:textColor="@color/login_protocol_highlight_text_color" /> |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginLeft="6.5dp" |
| | | android:text="勾选即代表同意" |
| | | android:textColor="#B3B8D3" |
| | | android:textSize="11sp" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_user_agreement" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@string/user_agreement" |
| | | android:textColor="@color/login_protocol_highlight_text_color" |
| | | android:textSize="11sp" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="、" |
| | | android:textColor="@color/login_protocol_text_color" |
| | | android:textSize="11sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_privacy_policy" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@string/privacy_policy" |
| | | android:textColor="@color/login_protocol_highlight_text_color" |
| | | android:textSize="11sp" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | |
| | | android:layout_alignParentLeft="true" |
| | | android:layout_alignParentStart="true" |
| | | android:layout_centerVertical="true" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/ic_youth_back" |
| | | android:drawablePadding="3dp" |
| | | android:drawableStart="@drawable/ic_back_two" |
| | | android:drawableStart="@drawable/ic_youth_back" |
| | | android:gravity="center_vertical" |
| | | android:padding="8dp" /> |
| | | |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center_vertical" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/ic_youth_back" |
| | | android:drawablePadding="3dp" |
| | | android:gravity="center_vertical" |
| | | android:padding="8dp" |
| | |
| | | <include layout="@layout/view_status_bar" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_top" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="48dp" |
| | | android:background="@color/page_header_bg_color" |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center_vertical" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/ic_youth_back" |
| | | android:drawablePadding="3dp" |
| | | android:gravity="center_vertical" |
| | | android:padding="8dp" |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerVertical="true" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/ic_youth_back" |
| | | android:drawablePadding="3dp" |
| | | android:gravity="center" |
| | | android:padding="8dp" /> |
| | |
| | | android:layout_alignParentStart="true" |
| | | android:layout_centerVertical="true" |
| | | android:layout_marginLeft="10dp" |
| | | android:drawableLeft="@drawable/ic_back" |
| | | android:drawableStart="@drawable/ic_back" |
| | | android:drawableLeft="@drawable/ic_youth_back" |
| | | android:drawableStart="@drawable/ic_youth_back" |
| | | android:gravity="start|center_vertical" /> |
| | | |
| | | <TextView |
| | |
| | | android:layout_height="35dp" |
| | | android:layout_marginLeft="15dp" |
| | | android:layout_marginTop="15dp" |
| | | android:src="@drawable/ic_back_two" /> |
| | | android:src="@drawable/ic_youth_back" /> |
| | | |
| | | </FrameLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/theme" |
| | | android:orientation="vertical"> |
| | | |
| | | <FrameLayout |
| | | android:id="@+id/fl_content" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"></FrameLayout> |
| | | |
| | | </FrameLayout> |
| | |
| | | android:layout_height="30dp" |
| | | android:layout_centerVertical="true" |
| | | android:layout_marginLeft="10dp" |
| | | android:src="@drawable/ic_back_two" /> |
| | | android:src="@drawable/ic_youth_back" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_controller_title" |
| | |
| | | android:id="@+id/iv_wifi" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@drawable/ic_back_two" /> |
| | | android:src="@drawable/ic_youth_back" /> |
| | | </FrameLayout> |
| | | |
| | | <FrameLayout |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="right" |
| | | android:src="@drawable/ic_back_two" /> |
| | | android:src="@drawable/ic_youth_back" /> |
| | | </FrameLayout> |
| | | |
| | | |
| | |
| | | |
| | | <LinearLayout |
| | | |
| | | android:id="@+id/ll_videos" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="12dp" |
| | |
| | | android:layout_margin="12dp" |
| | | android:background="@drawable/shape_mine_functions_bg" |
| | | android:orientation="vertical" |
| | | android:padding="38dp"> |
| | | |
| | | android:paddingTop="38dp" |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | android:paddingBottom="38dp"> |
| | | |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/rl_mine_message" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="20dp" |
| | | android:layout_centerHorizontal="true" |
| | | android:src="@drawable/ic_mine_message_w"></ImageView> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_message" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_alignParentBottom="true" |
| | | android:layout_marginTop="28dp" |
| | | android:text="站内消息" |
| | | android:textColor="@color/mine_item_title_text_color" |
| | | android:textSize="@dimen/mine_item_name"></TextView> |
| | | </RelativeLayout> |
| | | |
| | | <View |
| | | android:layout_width="0dp" |
| | | android:layout_height="1dp" |
| | | android:layout_weight="2"></View> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/rl_mine_share" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="20dp" |
| | | android:layout_centerHorizontal="true" |
| | | android:src="@drawable/ic_mine_share_w"></ImageView> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_alignParentBottom="true" |
| | | android:layout_marginTop="28dp" |
| | | android:text="分享软件" |
| | | android:textColor="@color/mine_item_title_text_color" |
| | | android:textSize="@dimen/mine_item_name"></TextView> |
| | | </RelativeLayout> |
| | | |
| | | <View |
| | | android:layout_width="0dp" |
| | | android:layout_height="1dp" |
| | | android:layout_weight="2"></View> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/rl_mine_help" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="20dp" |
| | | android:layout_centerHorizontal="true" |
| | | android:src="@drawable/ic_mine_help_w"></ImageView> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_alignParentBottom="true" |
| | | android:layout_marginTop="28dp" |
| | | android:text="帮助中心" |
| | | android:textColor="@color/mine_item_title_text_color" |
| | | android:textSize="@dimen/mine_item_name"></TextView> |
| | | </RelativeLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | <com.lcjian.library.widget.MyGridView |
| | | android:id="@+id/gv_content" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="36.5dp"> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/rl_mine_buy_record" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="20dp" |
| | | android:layout_centerHorizontal="true" |
| | | android:src="@drawable/icon_mine_buy_record"></ImageView> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_message" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_alignParentBottom="true" |
| | | android:layout_marginTop="28dp" |
| | | android:text="购买记录" |
| | | android:textColor="@color/mine_item_title_text_color" |
| | | android:textSize="@dimen/mine_item_name"></TextView> |
| | | </RelativeLayout> |
| | | |
| | | <View |
| | | android:layout_width="0dp" |
| | | android:layout_height="1dp" |
| | | android:layout_weight="2"></View> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/rl_mine_about_us" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="20dp" |
| | | android:layout_centerHorizontal="true" |
| | | android:src="@drawable/ic_mine_about_us_w"></ImageView> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_alignParentBottom="true" |
| | | android:layout_marginTop="28dp" |
| | | android:text="关于我们" |
| | | android:textColor="@color/mine_item_title_text_color" |
| | | android:textSize="@dimen/mine_item_name"></TextView> |
| | | </RelativeLayout> |
| | | |
| | | <View |
| | | android:layout_width="0dp" |
| | | android:layout_height="1dp" |
| | | android:layout_weight="2"></View> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/rl_mine_settings" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="20dp" |
| | | android:layout_centerHorizontal="true" |
| | | android:src="@drawable/ic_mine_settings_w"></ImageView> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_alignParentBottom="true" |
| | | android:layout_marginTop="28dp" |
| | | android:text="   设置   " |
| | | android:textColor="@color/mine_item_title_text_color" |
| | | android:textSize="@dimen/mine_item_name"></TextView> |
| | | </RelativeLayout> |
| | | android:numColumns="3" |
| | | android:verticalSpacing="36dp"> |
| | | |
| | | |
| | | |
| | | </LinearLayout> |
| | | </com.lcjian.library.widget.MyGridView> |
| | | |
| | | |
| | | </LinearLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center_horizontal" |
| | | android:orientation="vertical"> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/rl_content" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_icon" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="20dp" |
| | | android:layout_centerHorizontal="true" |
| | | android:src="@drawable/ic_mine_message_w"></ImageView> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_name" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_alignParentBottom="true" |
| | | android:layout_marginTop="28dp" |
| | | android:text="站内消息" |
| | | android:textColor="@color/mine_item_title_text_color" |
| | | android:textSize="@dimen/mine_item_name"></TextView> |
| | | |
| | | </RelativeLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center_vertical" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/ic_youth_back" |
| | | android:drawablePadding="5dp" |
| | | android:gravity="center" |
| | | android:padding="8dp" |
| | |
| | | android:textSize="10sp" /> |
| | | |
| | | <RadioButton |
| | | android:id="@+id/rb_nav_discover" |
| | | android:id="@+id/rb_guess_like" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:button="@null" |
| | | android:drawableTop="@drawable/selector_discover" |
| | | android:drawableTop="@drawable/selector_guess_like" |
| | | android:drawablePadding="4dp" |
| | | android:gravity="center_horizontal" |
| | | android:text="@string/discover" |
| | | android:text="@string/recommend" |
| | | android:textAppearance="?android:attr/textAppearanceSmall" |
| | | android:textColor="@color/selector_bottom_bar_text" |
| | | android:textSize="10sp" /> |
| | | |
| | | |
| | | |
| | | <RadioButton |
| | | android:id="@+id/rb_gold_corn" |
| | |
| | | |
| | | |
| | | <RadioButton |
| | | android:id="@+id/rb_guess_like" |
| | | android:id="@+id/rb_nav_discover" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:button="@null" |
| | | android:drawableTop="@drawable/selector_guess_like" |
| | | android:drawableTop="@drawable/selector_discover" |
| | | android:drawablePadding="4dp" |
| | | android:gravity="center_horizontal" |
| | | android:text="@string/recommend" |
| | | android:text="@string/discover" |
| | | android:textAppearance="?android:attr/textAppearanceSmall" |
| | | android:textColor="@color/selector_bottom_bar_text" |
| | | android:textSize="10sp" /> |
| | |
| | | android:layout_alignParentStart="true" |
| | | android:layout_alignParentLeft="true" |
| | | android:layout_centerVertical="true" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/ic_youth_back" |
| | | android:drawablePadding="3dp" |
| | | android:gravity="center" |
| | | android:paddingLeft="15dp" |
| | |
| | | android:layout_alignParentLeft="true" |
| | | android:layout_alignParentStart="true" |
| | | android:layout_centerVertical="true" |
| | | android:drawableLeft="@drawable/ic_back_two" |
| | | android:drawableLeft="@drawable/ic_youth_back" |
| | | android:drawablePadding="3dp" |
| | | android:gravity="center" |
| | | android:padding="8dp" /> |
| | |
| | | import com.loopj.android.http.ResponseHandlerInterface; |
| | | import com.loopj.android.http.SyncHttpClient; |
| | | import com.ut.device.UTDevice; |
| | | import com.video.youth.util.YouthUtil; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | |
| | |
| | | LinkedHashMap<String, String> params, Context context) { |
| | | params.put("System", "1"); |
| | | params.put("Platform", "Android"); |
| | | params.put("YouthMode", YouthUtil.isOpenYouthMode(context) + ""); |
| | | params.put("Channel", ManifestDataUtil.getAppMetaData(context, "UMENG_CHANNEL")); |
| | | |
| | | //签名 |
| | |
| | | import com.alibaba.baichuan.android.trade.AlibcTradeSDK; |
| | | import com.alibaba.baichuan.android.trade.callback.AlibcTradeInitCallback; |
| | | import com.baidu.mobads.AppActivity; |
| | | import com.bytedance.sdk.openadsdk.TTAdSdk; |
| | | import com.funshion.playsdk.register.IAuthCodeGetter; |
| | | import com.kwad.sdk.api.KsAdSDK; |
| | | import com.kwad.sdk.api.SdkConfig; |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; |
| | | import com.nostra13.universalimageloader.core.ImageLoader; |
| | |
| | | MultiDex.install(this); |
| | | if (UserUtil.isAgreeUserProtocol(this) || BeibeiConstant.IS_TEST) { |
| | | //如果同意了用户协议 |
| | | init(application); |
| | | init(application, null); |
| | | } |
| | | } |
| | | |
| | |
| | | * |
| | | * @param application |
| | | */ |
| | | public static void init(final Application application) { |
| | | public static void init(final Application application, InitListener initListener) { |
| | | Log.i(TAG, "系统初始化"); |
| | | inited = true; |
| | | try { |
| | |
| | | try { |
| | | UMConfigure.setLogEnabled(false); |
| | | UMConfigure.init(application, application.getResources().getString(R.string.umeng_key), description, UMConfigure.DEVICE_TYPE_PHONE, null); |
| | | // 选用AUTO页面采集模式 |
| | | MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO); |
| | | } catch (Throwable e) { |
| | | |
| | | } |
| | | // 选用AUTO页面采集模式 |
| | | MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO); |
| | | |
| | | UMShareAPI.get(application); |
| | | PlatformConfig.setWeixin(BeibeiConstant.WECHAT_ID, BeibeiConstant.WECHAT_KEY); |
| | | PlatformConfig.setQQZone(BeibeiConstant.QQ_ID, BeibeiConstant.QQ_KEY); |
| | | PlatformConfig.setSinaWeibo(BeibeiConstant.SINA_ID, BeibeiConstant.SINA_KEY, "http://sns.whalecloud.com/sina2/callback"); |
| | | |
| | | ImageLoader.getInstance().init(buildDefaultILC(application)); |
| | | initCSJAd(application); |
| | | initCSJAd(application, initListener); |
| | | initKSSDK(application); |
| | | try { |
| | | GDTAdSdk.init(application, BeibeiConstant.GDT_ID); |
| | | } catch (Exception e) { |
| | |
| | | /** |
| | | * 穿山甲广告初始化 |
| | | */ |
| | | private static void initCSJAd(Context context) { |
| | | TTAdManagerHolder.init(context); |
| | | private static void initCSJAd(Context context, InitListener initListener) { |
| | | TTAdManagerHolder.init(context, new TTAdSdk.InitCallback() { |
| | | @Override |
| | | public void success() { |
| | | if (initListener != null) |
| | | initListener.onFinish(); |
| | | } |
| | | |
| | | @Override |
| | | public void fail(int i, String s) { |
| | | if (initListener != null) |
| | | initListener.onFinish(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //快手初始化 |
| | | public static void initKSSDK(Context appContext) { |
| | | KsAdSDK.init(appContext, new SdkConfig.Builder() |
| | | .appId("801000001") // 测试aapId,请联系快⼿平台申请正式AppId,必填 |
| | | .appName(appContext.getString(R.string.app_name)) // 测试appName,请填写您应⽤的名称,⾮必填 |
| | | .showNotification(true) // 是否展示下载通知栏 |
| | | .debug(true) // 是否开启sdk 调试⽇志 可选 |
| | | .build()); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | public interface InitListener { |
| | | public void onFinish(); |
| | | |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | |
| | | } |
| | | } |
| | |
| | | //百度内容联盟 |
| | | // MobadsPermissionSettings.setPermissionReadDeviceID(true); |
| | | if (!BeibeiVideoApplication.IsInited()) { |
| | | BeibeiVideoApplication.init(BeibeiVideoApplication.application); |
| | | } |
| | | BeibeiVideoApplication.init(BeibeiVideoApplication.application, new BeibeiVideoApplication.InitListener() { |
| | | @Override |
| | | public void onFinish() { |
| | | runOnUiThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | nextStep(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | }); |
| | | } else |
| | | nextStep(); |
| | | } |
| | | |
| | | private void nextStep() { |
| | | |
| | | getUid(); |
| | | vg_ad.postDelayed(new Runnable() { |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | Dialog mDialog; |
| | | AlertDialog alertDialog; |
| | | |
| | |
| | | @Override |
| | | protected void onActivityResult(int requestCode, int resultCode, Intent data) { |
| | | super.onActivityResult(requestCode, resultCode, data); |
| | | if (requestCode == REQUEST_CODE) { |
| | | myRequetPermission();//由于不知道是否选择了允许所以需要再次判断 |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; |
| | | import com.video.youth.entity.YouthModeChange; |
| | | import com.viewpagerindicator.IconPagerAdapter; |
| | | import com.viewpagerindicator.MainTabPageIndicator; |
| | | import com.weikou.beibeivideo.BasicTextHttpResponseHandler; |
| | |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.JumpDetail; |
| | | import com.weikou.beibeivideo.entity.VideoType; |
| | | import com.weikou.beibeivideo.entity.ad.SplashAdLoadInfo; |
| | | import com.weikou.beibeivideo.entity.recommend.HomeClass; |
| | | import com.weikou.beibeivideo.entity.recommend.HomeTabChangeInfo; |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | |
| | | super.onCreate(savedInstanceState); |
| | | if (!BeibeiConstant.IS_TEST) |
| | | showFloatImgAd(); |
| | | EventBus.getDefault().register(this); |
| | | } |
| | | |
| | | |
| | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | EventBus.getDefault().register(this); |
| | | if (needRefresh) { |
| | | needRefresh = false; |
| | | getCategories(); |
| | | } |
| | | } |
| | | |
| | | private static boolean needRefresh = false; |
| | | |
| | | @Subscribe |
| | | public void onEventMainThread(YouthModeChange change) { |
| | | needRefresh = true; |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public void onPause() { |
| | | super.onPause(); |
| | | EventBus.getDefault().unregister(this); |
| | | } |
| | | |
| | | @Subscribe |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onDestroy() { |
| | | super.onDestroy(); |
| | | EventBus.getDefault().unregister(this); |
| | | } |
| | | } |
New file |
| | |
| | | package com.weikou.beibeivideo.ui.main; |
| | | |
| | | import android.os.Bundle; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | import android.widget.ListView; |
| | | import android.widget.ProgressBar; |
| | | |
| | | import com.google.gson.FieldNamingPolicy; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.kwad.sdk.api.KsAdSDK; |
| | | import com.kwad.sdk.api.KsContentPage; |
| | | import com.kwad.sdk.api.KsScene; |
| | | import com.lcjian.library.util.FragmentSwitchHelper; |
| | | import com.lcjian.library.util.SingleToast; |
| | | import com.qq.e.ads.cfg.VideoOption; |
| | | import com.qq.e.ads.nativ.ADSize; |
| | | import com.qq.e.ads.nativ.NativeExpressAD; |
| | | import com.qq.e.ads.nativ.NativeExpressADView; |
| | | 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.entity.VideoInfo; |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | | import com.weikou.beibeivideo.ui.baidu.BaiDuVideosFragment; |
| | | import com.weikou.beibeivideo.ui.recommend.GuessLikeAdapter; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.widget.MySwipeRefreshLayout; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.fragment.app.Fragment; |
| | | import androidx.fragment.app.FragmentManager; |
| | | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; |
| | | |
| | | /** |
| | | * 主页面--快手视频 |
| | | */ |
| | | public class KSVideoFragment extends MyRetainViewFragment { |
| | | private static final String TAG = "KSVideoFragment"; |
| | | |
| | | public KSVideoFragment() { |
| | | super(); |
| | | setName(KSVideoFragment.class.getName()); |
| | | } |
| | | |
| | | private Fragment fragment; |
| | | |
| | | |
| | | @Override |
| | | public int getContentResource() { |
| | | return R.layout.fragment_ks_video; |
| | | } |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | Log.i(TAG, "onResume"); |
| | | } |
| | | |
| | | @Override |
| | | public void onPause() { |
| | | super.onPause(); |
| | | Log.i(TAG, "onPause"); |
| | | } |
| | | |
| | | @Override |
| | | public void onCreate(@Nullable Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | Log.i(TAG, "onCreate"); |
| | | } |
| | | |
| | | @Override |
| | | public void onCreateView(View contentView, Bundle savedInstanceState) { |
| | | Log.i(TAG, "onCreateView"); |
| | | // init(); |
| | | } |
| | | |
| | | public void init(FragmentManager fragmentManager, Fragment fragment) { |
| | | if (this.fragment == null) { |
| | | this.fragment = fragment; |
| | | fragmentManager.beginTransaction().add(R.id.fl_content, fragment).commitAllowingStateLoss(); |
| | | } |
| | | } |
| | | |
| | | private void init() { |
| | | KsScene adScene = new KsScene.Builder(8010000001L).build(); |
| | | KsContentPage ksContentPage = KsAdSDK.getLoadManager().loadContentPage(adScene); |
| | | ksContentPage.onPageLeaveIntercept(new KsContentPage.KsPageLeaveClickListener() { |
| | | @Override |
| | | public void onPageLeaveClick() { |
| | | |
| | | } |
| | | }); |
| | | ksContentPage.addPageLoadListener(new KsContentPage.OnPageLoadListener() { |
| | | |
| | | |
| | | @Override |
| | | public void onLoadStart(KsContentPage ksContentPage, int i) { |
| | | Log.i(TAG, "onLoadStart"); |
| | | } |
| | | |
| | | @Override |
| | | public void onLoadFinish(KsContentPage ksContentPage, int i) { |
| | | Log.i(TAG, "onLoadFinish"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onLoadError(KsContentPage ksContentPage, String s) { |
| | | Log.i(TAG, "onLoadError"); |
| | | } |
| | | }); |
| | | |
| | | |
| | | fragment = ksContentPage.getFragment(); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import android.content.SharedPreferences; |
| | | import android.content.SharedPreferences.Editor; |
| | | import android.content.pm.ActivityInfo; |
| | | import android.content.pm.ApplicationInfo; |
| | | import android.database.Cursor; |
| | | import android.graphics.drawable.Drawable; |
| | | import android.net.wifi.WifiInfo; |
| | | import android.net.wifi.WifiManager; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.loader.app.LoaderManager; |
| | | import androidx.loader.content.CursorLoader; |
| | | import androidx.loader.content.Loader; |
| | | |
| | | import android.util.Log; |
| | | import android.view.KeyEvent; |
| | | import android.view.View; |
| | |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.bumptech.glide.Glide; |
| | | import com.bumptech.glide.request.target.SimpleTarget; |
| | | import com.bumptech.glide.request.transition.Transition; |
| | | import com.google.gson.FieldNamingPolicy; |
| | | import com.androidquery.AQuery; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.kwad.sdk.api.KsAdSDK; |
| | | import com.kwad.sdk.api.KsContentPage; |
| | | import com.kwad.sdk.api.KsScene; |
| | | import com.lcjian.library.util.FragmentSwitchHelper; |
| | | import com.lcjian.library.util.MarketUtils; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.mozillaonline.providers.downloads.DownloadService; |
| | | import com.qq.e.ads.cfg.VideoOption; |
| | |
| | | import com.umeng.socialize.UMShareListener; |
| | | import com.umeng.socialize.bean.SHARE_MEDIA; |
| | | import com.umeng.socialize.media.UMImage; |
| | | import com.video.youth.util.YouthUtil; |
| | | import com.weikou.beibeivideo.BasicTextHttpResponseHandler; |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.BeibeiVideoApplication; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.db.MessageTable; |
| | | import com.weikou.beibeivideo.entity.NewComment; |
| | | import com.weikou.beibeivideo.entity.VideoInfo; |
| | | import com.weikou.beibeivideo.entity.recommend.HomeTabChangeInfo; |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | import com.weikou.beibeivideo.ui.baidu.BaiDuNewsFragment; |
| | |
| | | import com.weikou.beibeivideo.ui.push.PushOpenClickActivity; |
| | | import com.weikou.beibeivideo.ui.recommend.SearchActivity; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.DimenUtils; |
| | | import com.weikou.beibeivideo.util.ExitDialog; |
| | | import com.weikou.beibeivideo.util.LoginFirstDialog; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | import com.weikou.beibeivideo.util.ad.manager.SearchResultAdManager; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | import com.yeshi.appupdate.AppUpdate; |
| | | import com.yeshi.push.PushUtil; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | |
| | |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.loader.app.LoaderManager; |
| | | import androidx.loader.content.CursorLoader; |
| | | import androidx.loader.content.Loader; |
| | | |
| | | //import com.umeng.message.PushAgent; |
| | | |
| | |
| | | |
| | | private FragmentSwitchHelper mFragmentSwitchHelper; |
| | | |
| | | private AQuery mAQuery; |
| | | |
| | | @Override |
| | | protected void onSaveInstanceState(Bundle outState) { |
| | | outState.putString("flash back", "MainActivity flash show"); |
| | |
| | | super.onCreate(savedInstanceState); |
| | | setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);// 锁定竖屏 |
| | | setContentView(R.layout.activity_main); |
| | | |
| | | mAQuery = new AQuery(this); |
| | | exitDialogBuilder = new ExitDialog.Builder(this); |
| | | |
| | | exitDialog = exitDialogBuilder.create(); |
| | |
| | | |
| | | mFragmentSwitchHelper = FragmentSwitchHelper.create( |
| | | R.id.fl_main_fragment_container, getSupportFragmentManager(), |
| | | new HomeFragment(), new BaiDuVideosFragment(), |
| | | BaiDuNewsFragment.newInstance(), new MineFragment(), GoldCornFragment.newInstance()); |
| | | new HomeFragment(), new KSVideoFragment(), |
| | | BaiDuVideosFragment.newInstance(), new MineFragment(), GoldCornFragment.newInstance()); |
| | | rg_nav = findViewById(R.id.rg_nav); |
| | | rg_nav.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { |
| | | |
| | |
| | | case R.id.rb_nav_recommend: { |
| | | mFragmentSwitchHelper |
| | | .changeFragment(HomeFragment.class); |
| | | if (!YouthUtil.isOpenYouthMode(getApplicationContext())) |
| | | mAQuery.id(R.id.ll_top).visibility(View.VISIBLE); |
| | | } |
| | | break; |
| | | case R.id.rb_guess_like: { |
| | | mAQuery.id(R.id.ll_top).visibility(View.GONE); |
| | | mFragmentSwitchHelper |
| | | .changeFragment(BaiDuVideosFragment.class); |
| | | .changeFragment(KSVideoFragment.class); |
| | | |
| | | fl_category.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | ((KSVideoFragment) mFragmentSwitchHelper.getFragmentByName(KSVideoFragment.class.getName())).init(getSupportFragmentManager(), ksContentPage.getFragment()); |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | break; |
| | | case R.id.rb_gold_corn: { |
| | | if (!YouthUtil.isOpenYouthMode(getApplicationContext())) |
| | | mAQuery.id(R.id.ll_top).visibility(View.VISIBLE); |
| | | mFragmentSwitchHelper |
| | | .changeFragment(GoldCornFragment.class); |
| | | } |
| | | break; |
| | | case R.id.rb_nav_discover: { |
| | | if (!YouthUtil.isOpenYouthMode(getApplicationContext())) |
| | | mAQuery.id(R.id.ll_top).visibility(View.VISIBLE); |
| | | mFragmentSwitchHelper |
| | | .changeFragment(BaiDuNewsFragment.class); |
| | | .changeFragment(BaiDuVideosFragment.class); |
| | | } |
| | | break; |
| | | case R.id.rb_nav_mine: { |
| | | if (!YouthUtil.isOpenYouthMode(getApplicationContext())) |
| | | mAQuery.id(R.id.ll_top).visibility(View.VISIBLE); |
| | | mFragmentSwitchHelper.changeFragment(MineFragment.class); |
| | | } |
| | | break; |
| | |
| | | }); |
| | | } |
| | | }); |
| | | KsScene adScene = new KsScene.Builder(8010000001L).build(); |
| | | ksContentPage = KsAdSDK.getLoadManager().loadContentPage(adScene); |
| | | } |
| | | |
| | | private KsContentPage ksContentPage; |
| | | |
| | | /** |
| | | * 预加载广告 |
| | |
| | | } |
| | | |
| | | PushOpenClickActivity.resumeJumpActivity(this); |
| | | |
| | | if (YouthUtil.isOpenYouthMode(getApplicationContext())) { |
| | | mAQuery.id(R.id.ll_top).visibility(View.GONE); |
| | | mAQuery.id(R.id.rb_nav_discover).visibility(View.GONE); |
| | | mAQuery.id(R.id.rb_gold_corn).visibility(View.GONE); |
| | | mAQuery.id(R.id.rb_guess_like).visibility(View.GONE); |
| | | ((RadioGroup) mAQuery.id(R.id.rg_nav).getView()).setPadding(0, DimenUtils.dip2px(getApplicationContext(), 5), 0, 0); |
| | | } else { |
| | | mAQuery.id(R.id.ll_top).visibility(View.VISIBLE); |
| | | mAQuery.id(R.id.rb_nav_discover).visibility(View.VISIBLE); |
| | | mAQuery.id(R.id.rb_gold_corn).visibility(View.VISIBLE); |
| | | mAQuery.id(R.id.rb_guess_like).visibility(View.VISIBLE); |
| | | ((RadioGroup) mAQuery.id(R.id.rg_nav).getView()).setPadding(0, 0, 0, 0); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | startActivity(intent); |
| | | break; |
| | | case R.id.rl_mine_message: |
| | | openMsg(); |
| | | break; |
| | | // case R.id.rl_mine_message: |
| | | // openMsg(); |
| | | // break; |
| | | |
| | | case R.id.fl_category: |
| | | startActivity(new Intent(this, CategoryActivity.class)); |
| | |
| | | import androidx.loader.content.CursorLoader; |
| | | import androidx.loader.content.Loader; |
| | | |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.View.OnClickListener; |
| | | import android.view.ViewGroup; |
| | | import android.webkit.WebChromeClient; |
| | | import android.webkit.WebViewClient; |
| | | import android.widget.BaseAdapter; |
| | | import android.widget.GridView; |
| | | import android.widget.ImageView; |
| | | import android.widget.LinearLayout; |
| | | import android.widget.RelativeLayout; |
| | |
| | | import com.umeng.socialize.UMShareAPI; |
| | | import com.umeng.socialize.UMShareListener; |
| | | import com.umeng.socialize.bean.SHARE_MEDIA; |
| | | import com.video.youth.ui.YouthActivity; |
| | | import com.video.youth.util.YouthUtil; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.db.MessageTable; |
| | | import com.weikou.beibeivideo.entity.NewComment; |
| | |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 原主页--我的-----3.2.4版本后已经放弃此页面 |
| | |
| | | private RatioLayout rl_banner; |
| | | private ImageView iv_banner; |
| | | |
| | | private GridView gv_content; |
| | | |
| | | /** |
| | | * 用于表示登录状态 |
| | | */ |
| | |
| | | |
| | | private LinearLayout ll_mine_favourite, ll_mine_follow, ll_mine_watch_history; |
| | | |
| | | private RelativeLayout rl_mine_message, rl_mine_share, rl_mine_help, rl_mine_buy_record, rl_mine_about_us, rl_mine_settings; |
| | | |
| | | private boolean isHaveNewCom;// 是否存在新的评论消息 |
| | | |
| | |
| | | ll_mine_follow = contentView.findViewById(R.id.ll_mine_follow); |
| | | ll_mine_watch_history = contentView.findViewById(R.id.ll_mine_watch_history); |
| | | |
| | | rl_mine_message = contentView.findViewById(R.id.rl_mine_message); |
| | | rl_mine_share = contentView.findViewById(R.id.rl_mine_share); |
| | | rl_mine_help = contentView.findViewById(R.id.rl_mine_help); |
| | | rl_mine_about_us = contentView.findViewById(R.id.rl_mine_about_us); |
| | | rl_mine_buy_record = contentView.findViewById(R.id.rl_mine_buy_record); |
| | | rl_mine_settings = contentView.findViewById(R.id.rl_mine_settings); |
| | | |
| | | |
| | | tv_login = contentView.findViewById(R.id.mine_tv_login); |
| | | tv_name = contentView.findViewById(R.id.mine_tv_name); |
| | |
| | | rl_banner = contentView.findViewById(R.id.rl_banner); |
| | | iv_banner = contentView.findViewById(R.id.iv_banner); |
| | | |
| | | gv_content = contentView.findViewById(R.id.gv_content); |
| | | |
| | | mBadgeView = new BadgeView(iv_user_logo.getContext(), rl_mine_message); |
| | | mBadgeView.setBackgroundResource(R.drawable.ic_red_dot); |
| | | mBadgeView.setTextSize(1); |
| | | mBadgeView.setText(""); |
| | | mBadgeView.setBadgeMargin(DimenUtils.dipToPixels(20, tv_no_network.getContext())); |
| | | |
| | | |
| | | mUpdateBadgeView = new BadgeView(getContext(), rl_mine_settings); |
| | | mUpdateBadgeView.setBackgroundResource(R.drawable.ic_red_dot); |
| | | mUpdateBadgeView.setTextSize(1); |
| | | mUpdateBadgeView.setText(""); |
| | | mUpdateBadgeView.setBadgeMargin(DimenUtils.dipToPixels(20, |
| | | tv_no_network.getContext())); |
| | | |
| | | contentView.findViewById(R.id.mine_rl_head).setOnClickListener(this); |
| | | ll_mine_favourite.setOnClickListener(this); |
| | |
| | | ll_mine_watch_history.setOnClickListener(this); |
| | | mAquery.id(R.id.ll_mine_novel).clicked(this); |
| | | |
| | | rl_mine_about_us.setOnClickListener(this); |
| | | rl_mine_message.setOnClickListener(this); |
| | | rl_mine_help.setOnClickListener(this); |
| | | rl_mine_settings.setOnClickListener(this); |
| | | rl_mine_share.setOnClickListener(this); |
| | | |
| | | tv_vip_open.setOnClickListener(this); |
| | | rl_mine_buy_record.setOnClickListener(this); |
| | | |
| | | getLoaderManager().initLoader(0, null, this); |
| | | } |
| | |
| | | // Swap the new cursor in. (The framework will take care of closing the |
| | | // old cursor once we return.) |
| | | |
| | | if (data != null && data.getCount() != 0 || (isLogin && isHaveNewCom)) { |
| | | mBadgeView.show(); |
| | | } else { |
| | | mBadgeView.hide(); |
| | | if (mBadgeView != null) { |
| | | if (data != null && data.getCount() != 0 || (isLogin && isHaveNewCom)) { |
| | | mBadgeView.show(); |
| | | } else { |
| | | mBadgeView.hide(); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | //书架 |
| | | case R.id.ll_mine_novel: |
| | | break; |
| | | case R.id.rl_mine_message: |
| | | openMsg(); |
| | | break; |
| | | case R.id.rl_mine_share: |
| | | new ShareAPPDialog.Builder(getActivity()).create().show(); |
| | | break; |
| | | case R.id.rl_mine_help: |
| | | startActivity(new Intent(tv_no_network.getContext(), |
| | | HelpAndTicklingActivity.class)); |
| | | break; |
| | | case R.id.rl_mine_about_us: |
| | | Intent intent1 = new Intent(getContext(), BrowserActivity.class); |
| | | intent1.putExtra("url", BeibeiConstant.ABOUT_US); |
| | | |
| | | startActivity(intent1); |
| | | |
| | | break; |
| | | |
| | | case R.id.rl_mine_buy_record: { |
| | | String url = ConfigUtil.getBuyRecordUrl(getContext()); |
| | | if (StringUtils.isEmpty(url)) |
| | | return; |
| | | |
| | | Intent intent11 = new Intent(getContext(), BrowserActivity.class); |
| | | intent11.putExtra("url", url); |
| | | startActivity(intent11); |
| | | } |
| | | |
| | | break; |
| | | case R.id.rl_mine_settings: |
| | | startActivity(new Intent(tv_no_network.getContext(), SettingsActivity.class)); |
| | | break; |
| | | |
| | | case R.id.tv_vip_open: |
| | |
| | | mChangeHelper.registerReceiver(); |
| | | SharedPreferences preferences2 = tv_no_network.getContext().getSharedPreferences( |
| | | "update", Context.MODE_PRIVATE); |
| | | if (preferences2.getBoolean("status", false)) { |
| | | mUpdateBadgeView.show(); |
| | | } else { |
| | | mUpdateBadgeView.hide(); |
| | | if (mUpdateBadgeView != null) { |
| | | if (preferences2.getBoolean("status", false)) { |
| | | mUpdateBadgeView.show(); |
| | | } else { |
| | | mUpdateBadgeView.hide(); |
| | | } |
| | | } |
| | | //填充 |
| | | BannerVO bannerVO = ConfigUtil.getMinePageBanner(getContext()); |
| | |
| | | |
| | | |
| | | getPersonInfo(); |
| | | |
| | | if (YouthUtil.isOpenYouthMode(getContext())) { |
| | | gv_content.setAdapter(new MyAdapter(getYouthFunctions())); |
| | | mAquery.id(R.id.ll_videos).visibility(View.GONE); |
| | | mAquery.id(R.id.ll_vip).visibility(View.GONE); |
| | | } else { |
| | | gv_content.setAdapter(new MyAdapter(getNotYouthFunctions())); |
| | | mAquery.id(R.id.ll_videos).visibility(View.VISIBLE); |
| | | mAquery.id(R.id.ll_vip).visibility(View.VISIBLE); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | }); |
| | | } |
| | | |
| | | class MyAdapter extends BaseAdapter { |
| | | private List<Function> functionList; |
| | | private LayoutInflater inflater; |
| | | |
| | | public MyAdapter(List<Function> functionList) { |
| | | this.functionList = functionList; |
| | | inflater = LayoutInflater.from(getContext()); |
| | | } |
| | | |
| | | @Override |
| | | public int getCount() { |
| | | return functionList == null ? 0 : functionList.size(); |
| | | } |
| | | |
| | | @Override |
| | | public Object getItem(int i) { |
| | | return functionList.get(i); |
| | | } |
| | | |
| | | @Override |
| | | public long getItemId(int i) { |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public View getView(int i, View view, ViewGroup viewGroup) { |
| | | View root = inflater.inflate(R.layout.mine_function, null); |
| | | TextView tv_name = root.findViewById(R.id.tv_name); |
| | | ImageView iv_icon = root.findViewById(R.id.iv_icon); |
| | | RelativeLayout rl_container = root.findViewById(R.id.rl_content); |
| | | final Function function = functionList.get(i); |
| | | if (function.getType() == Function.Type.msg) { |
| | | mBadgeView = new BadgeView(iv_user_logo.getContext(), rl_container); |
| | | mBadgeView.setBackgroundResource(R.drawable.ic_red_dot); |
| | | mBadgeView.setTextSize(1); |
| | | mBadgeView.setText(""); |
| | | mBadgeView.setBadgeMargin(DimenUtils.dipToPixels(20, tv_no_network.getContext())); |
| | | |
| | | |
| | | mUpdateBadgeView = new BadgeView(getContext(), rl_container); |
| | | mUpdateBadgeView.setBackgroundResource(R.drawable.ic_red_dot); |
| | | mUpdateBadgeView.setTextSize(1); |
| | | mUpdateBadgeView.setText(""); |
| | | mUpdateBadgeView.setBadgeMargin(DimenUtils.dipToPixels(20, |
| | | tv_no_network.getContext())); |
| | | } |
| | | |
| | | tv_name.setText(function.getName()); |
| | | iv_icon.setImageResource(function.getResourceId()); |
| | | root.setOnClickListener(new OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | |
| | | if (function.getType() == Function.Type.msg) { |
| | | openMsg(); |
| | | } else if (function.getType() == Function.Type.share) { |
| | | new ShareAPPDialog.Builder(getActivity()).create().show(); |
| | | } else if (function.getType() == Function.Type.help) { |
| | | startActivity(new Intent(tv_no_network.getContext(), |
| | | HelpAndTicklingActivity.class)); |
| | | } else if (function.getType() == Function.Type.buy) { |
| | | String url = ConfigUtil.getBuyRecordUrl(getContext()); |
| | | if (StringUtils.isEmpty(url)) |
| | | return; |
| | | Intent intent11 = new Intent(getContext(), BrowserActivity.class); |
| | | intent11.putExtra("url", url); |
| | | startActivity(intent11); |
| | | } else if (function.getType() == Function.Type.youth) { |
| | | Intent intent11 = new Intent(getContext(), YouthActivity.class); |
| | | startActivity(intent11); |
| | | } else if (function.getType() == Function.Type.about) { |
| | | Intent intent1 = new Intent(getContext(), BrowserActivity.class); |
| | | intent1.putExtra("url", BeibeiConstant.ABOUT_US); |
| | | startActivity(intent1); |
| | | } else if (function.getType() == Function.Type.setting) { |
| | | startActivity(new Intent(tv_no_network.getContext(), SettingsActivity.class)); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | return root; |
| | | } |
| | | |
| | | } |
| | | |
| | | private List<Function> getNotYouthFunctions() { |
| | | List<Function> list = new ArrayList<>(); |
| | | list.add(new Function(R.drawable.ic_mine_message_w, "站内消息", Function.Type.msg)); |
| | | list.add(new Function(R.drawable.ic_mine_share_w, "分享软件", Function.Type.share)); |
| | | list.add(new Function(R.drawable.ic_mine_help_w, "帮助中心", Function.Type.help)); |
| | | list.add(new Function(R.drawable.icon_mine_buy_record, "购买记录", Function.Type.buy)); |
| | | list.add(new Function(R.drawable.icon_mine_youth, "青少年模式", Function.Type.youth)); |
| | | list.add(new Function(R.drawable.ic_mine_about_us_w, "关于我们", Function.Type.about)); |
| | | list.add(new Function(R.drawable.ic_mine_settings_w, "设置", Function.Type.setting)); |
| | | return list; |
| | | } |
| | | |
| | | private List<Function> getYouthFunctions() { |
| | | List<Function> list = new ArrayList<>(); |
| | | list.add(new Function(R.drawable.ic_mine_share_w, "分享软件", Function.Type.share)); |
| | | list.add(new Function(R.drawable.ic_mine_help_w, "帮助中心", Function.Type.help)); |
| | | list.add(new Function(R.drawable.icon_mine_youth, "青少年模式", Function.Type.youth)); |
| | | list.add(new Function(R.drawable.ic_mine_about_us_w, "关于我们", Function.Type.about)); |
| | | list.add(new Function(R.drawable.ic_mine_settings_w, "设置", Function.Type.setting)); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | static class Function { |
| | | |
| | | enum Type { |
| | | msg, share, help, buy, youth, about, setting |
| | | } |
| | | |
| | | private int resourceId; |
| | | private String name; |
| | | private Type type; |
| | | |
| | | public Function(int resourceId, String name, Type type) { |
| | | this.resourceId = resourceId; |
| | | this.name = name; |
| | | this.type = type; |
| | | } |
| | | |
| | | public int getResourceId() { |
| | | return resourceId; |
| | | } |
| | | |
| | | public void setResourceId(int resourceId) { |
| | | this.resourceId = resourceId; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Type getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Type type) { |
| | | this.type = type; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import android.content.res.Configuration; |
| | | import android.database.Cursor; |
| | | import android.graphics.drawable.Drawable; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | |
| | | import androidx.annotation.NonNull; |
| | |
| | | return; |
| | | //加载广告 |
| | | if (BeibeiConstant.AD_TYPE.isVideoDetailSplashAd()) { |
| | | |
| | | //判断加载广告的类型 |
| | | |
| | | int fullvideo = adInfo.getFullVideoWeight(); |
| | | int interstitial = adInfo.getInterstitialWeight(); |
| | | int random = (int) ((fullvideo + interstitial) * Math.random()); |
| | | if (random <= fullvideo) { |
| | | if (FullVideoAdManager.getInstance().isCacahed()) { |
| | | FullVideoAdManager.getInstance().showAd(this); |
| | | if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT_WATCH) { |
| | | int fullvideo = adInfo.getFullVideoWeight(); |
| | | int interstitial = adInfo.getInterstitialWeight(); |
| | | int random = (int) ((fullvideo + interstitial) * Math.random()); |
| | | if (random <= fullvideo) { |
| | | if (FullVideoAdManager.getInstance().isCacahed()) { |
| | | FullVideoAdManager.getInstance().showAd(this); |
| | | } else { |
| | | FullVideoAdManager.getInstance().loadAd(VideoDetailActivity2.this, new FullVideoAdManager.IFullVideoAdListener() { |
| | | @Override |
| | | public void onSuccess(TTFullScreenVideoAd ad) { |
| | | FullVideoAdManager.getInstance().showAd(VideoDetailActivity2.this); |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | FullVideoAdManager.getInstance().loadAd(BeibeiVideoApplication.application, new FullVideoAdManager.IFullVideoAdListener() { |
| | | @Override |
| | | public void onSuccess(TTFullScreenVideoAd ad) { |
| | | FullVideoAdManager.getInstance().showAd(VideoDetailActivity2.this); |
| | | } |
| | | }); |
| | | showInterstitialAd(); |
| | | } |
| | | } else { |
| | | showInterstitialAd(); |
| | | FullVideoAdManager.getInstance().loadGDT(VideoDetailActivity2.this, null); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Override |
| | | protected void onDestroy() { |
| | | if (BeibeiConstant.AD_TYPE != null && BeibeiConstant.AD_TYPE.isVideoDetailSplashAd()) |
| | | FullVideoAdManager.getInstance().loadAd(BeibeiVideoApplication.application, null); |
| | | FullVideoAdManager.getInstance().loadAd(VideoDetailActivity2.this, null); |
| | | uploadSession(); |
| | | GoldCornUtil.removeCallbacks(fl_video_play_background, makeGoldCornRunnable); |
| | | //屏幕常亮 |
| | |
| | | import com.lcjian.library.util.SingleToast; |
| | | import com.lcjian.library.util.common.ClipboardUtil; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.qq.e.ads.cfg.VideoOption; |
| | | import com.qq.e.ads.interstitial2.UnifiedInterstitialAD; |
| | | import com.qq.e.ads.interstitial2.UnifiedInterstitialADListener; |
| | | import com.qq.e.ads.interstitial2.UnifiedInterstitialMediaListener; |
| | | import com.qq.e.comm.util.AdError; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.weikou.beibeivideo.BasicTextHttpResponseHandler; |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | |
| | | private void showInterstitialAd() { |
| | | if (isInterstitialAdShown) |
| | | return; |
| | | if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT_WATCH) { |
| | | showCSJInterstitialAd(); |
| | | } else { |
| | | showGDTInterstitialAd(); |
| | | } |
| | | // showGDTInterstitialAd(); |
| | | } |
| | | |
| | | private UnifiedInterstitialAD iad; |
| | | |
| | | private void showGDTInterstitialAd() { |
| | | String posId = GDTConstant.PID_2_VIDEO_DETAIL_INTERSTITIAL; |
| | | iad = new UnifiedInterstitialAD(getActivity(), posId, new UnifiedInterstitialADListener() { |
| | | |
| | | @Override |
| | | public void onADReceive() { |
| | | if (fl_ad != null) { |
| | | fl_ad.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (iad != null) |
| | | iad.show(getActivity()); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoCached() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onNoAD(AdError adError) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADOpened() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADExposure() { |
| | | isInterstitialAdShown = true; |
| | | } |
| | | |
| | | @Override |
| | | public void onADClicked() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADLeftApplication() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADClosed() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderSuccess() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderFail() { |
| | | |
| | | } |
| | | }); |
| | | VideoOption.Builder builder = new VideoOption.Builder(); |
| | | VideoOption option = builder.setAutoPlayMuted(true) |
| | | .setAutoPlayPolicy(VideoOption.AutoPlayPolicy.WIFI).build(); |
| | | iad.setVideoOption(option); |
| | | iad.setMediaListener(new UnifiedInterstitialMediaListener() { |
| | | |
| | | @Override |
| | | public void onVideoInit() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoLoading() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoReady(long l) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoStart() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPause() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoComplete() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoError(AdError adError) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPageOpen() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPageClose() { |
| | | |
| | | } |
| | | }); |
| | | iad.loadAD(); |
| | | } |
| | | |
| | | private void showCSJInterstitialAd() { |
| | | TTAdNative mTTAdNative = TTAdSdk.getAdManager().createAdNative(getContext()); |
| | | AdSlot adSlot = new AdSlot.Builder() |
| | | .setCodeId(CSJConstant.VIDEO_DETAIL_INTERSTITIALAD) |
| | |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.os.Build; |
| | | import android.widget.Toast; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | |
| | | import com.bytedance.sdk.openadsdk.TTAdManager; |
| | | import com.bytedance.sdk.openadsdk.TTAdNative; |
| | | import com.bytedance.sdk.openadsdk.TTFullScreenVideoAd; |
| | | import com.qq.e.ads.cfg.VideoOption; |
| | | import com.qq.e.ads.interstitial2.UnifiedInterstitialAD; |
| | | import com.qq.e.ads.interstitial2.UnifiedInterstitialADListener; |
| | | import com.qq.e.ads.interstitial2.UnifiedInterstitialMediaListener; |
| | | import com.qq.e.comm.util.AdError; |
| | | import com.weikou.beibeivideo.util.DimenUtils; |
| | | |
| | | public class FullVideoAdManager { |
| | |
| | | private TTAdNative mTTAdNative = null; |
| | | |
| | | private TTFullScreenVideoAd mttFullVideoAd; |
| | | |
| | | //广点通广告 |
| | | private UnifiedInterstitialAD iad; |
| | | |
| | | private static FullVideoAdManager fullVideoAdManager; |
| | | |
| | |
| | | return fullVideoAdManager; |
| | | } |
| | | |
| | | public void loadAd(final Context context, final IFullVideoAdListener adListener) { |
| | | public void loadAd(final Activity context, final IFullVideoAdListener adListener) { |
| | | //获取当前SDK版本 |
| | | if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT_WATCH) { |
| | | loadCSJ(context, adListener); |
| | | } else { |
| | | loadGDT(context, adListener); |
| | | } |
| | | } |
| | | |
| | | private void loadCSJ(final Context context, final IFullVideoAdListener adListener) { |
| | | int w = DimenUtils.getScreenWidth(context); |
| | | int h = DimenUtils.getScreenHeight(context); |
| | | AdSlot adSlot = new AdSlot.Builder() |
| | |
| | | } |
| | | |
| | | |
| | | public void loadGDT(final Activity context, final IFullVideoAdListener adListener) { |
| | | String posId = GDTConstant.PID_2_VIDEO_DETAIL_INTERSTITIAL; |
| | | iad = new UnifiedInterstitialAD(context, posId, new UnifiedInterstitialADListener() { |
| | | |
| | | @Override |
| | | public void onADReceive() { |
| | | if (context != null) { |
| | | context.runOnUiThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (iad != null) |
| | | iad.show(context); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoCached() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onNoAD(AdError adError) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADOpened() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADExposure() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADClicked() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADLeftApplication() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADClosed() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderSuccess() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderFail() { |
| | | |
| | | } |
| | | }); |
| | | VideoOption.Builder builder = new VideoOption.Builder(); |
| | | VideoOption option = builder.setAutoPlayMuted(true) |
| | | .setAutoPlayPolicy(VideoOption.AutoPlayPolicy.WIFI).build(); |
| | | iad.setVideoOption(option); |
| | | iad.setMediaListener(new UnifiedInterstitialMediaListener() { |
| | | |
| | | @Override |
| | | public void onVideoInit() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoLoading() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoReady(long l) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoStart() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPause() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoComplete() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoError(AdError adError) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPageOpen() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoPageClose() { |
| | | |
| | | } |
| | | }); |
| | | iad.loadAD(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 展示广告 |
| | | * |
| | |
| | | //退出广告 |
| | | public static String PID_2_EXIT = "6091485426868623"; |
| | | |
| | | public static String PID_2_VIDEO_DETAIL_INTERSTITIAL = "7002342568464590"; |
| | | |
| | | |
| | | } |
| | |
| | | public class TTAdManagerHolder { |
| | | |
| | | private static final String TAG = "TTAdManagerHolder"; |
| | | private static boolean sInit; |
| | | |
| | | |
| | | public static TTAdManager get() throws Exception{ |
| | | if (!sInit) { |
| | | public static TTAdManager get() throws Exception { |
| | | if (!TTAdSdk.isInitSuccess()) { |
| | | throw new Exception("TTAdSdk is not init, please check."); |
| | | } |
| | | return TTAdSdk.getAdManager(); |
| | | } |
| | | |
| | | public static void init(Context context) { |
| | | doInit(context); |
| | | public static void init(Context context, TTAdSdk.InitCallback initCallback) { |
| | | doInit(context, initCallback); |
| | | } |
| | | |
| | | //step1:接入网盟广告sdk的初始化操作,详情见接入文档和穿山甲平台说明 |
| | | private static void doInit(Context context) { |
| | | if (!sInit) { |
| | | private static void doInit(Context context, TTAdSdk.InitCallback initCallback) { |
| | | if (!TTAdSdk.isInitSuccess()) { |
| | | try { |
| | | TTAdSdk.init(context, buildConfig(context), new TTAdSdk.InitCallback() { |
| | | @Override |
| | | public void success() { |
| | | Log.i(TAG, "TTAdSdk初始化成功"); |
| | | sInit = true; |
| | | } |
| | | |
| | | @Override |
| | | public void fail(int i, String s) { |
| | | Log.e(TAG, "TTAdSdk初始化失败:"+i+"-"+s); |
| | | sInit = false; |
| | | } |
| | | }); |
| | | TTAdSdk.init(context, buildConfig(context), initCallback); |
| | | |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } else { |
| | | initCallback.success(); |
| | | } |
| | | } |
| | | |
| | |
| | | api fileTree(include: '*.jar', dir: 'libs') |
| | | api 'androidx.legacy:legacy-support-v4:1.0.0' |
| | | api 'com.qq.e.union:union:+' |
| | | implementation 'com.qq.e.union:union:4.410.1290' |
| | | // implementation 'com.qq.e.union:union:4.410.1290' |
| | | // api files("libs/GDTSDK.unionNormal.4.420.1290.aar") |
| | | } |
| | | |
New file |
| | |
| | | plugins { |
| | | id 'com.android.library' |
| | | } |
| | | |
| | | android { |
| | | compileSdkVersion 28 |
| | | buildToolsVersion "28.0.3" |
| | | |
| | | defaultConfig { |
| | | minSdkVersion 17 |
| | | targetSdkVersion 28 |
| | | versionCode 1 |
| | | versionName "1.0" |
| | | |
| | | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| | | consumerProguardFiles "consumer-rules.pro" |
| | | } |
| | | |
| | | buildTypes { |
| | | release { |
| | | minifyEnabled false |
| | | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
| | | } |
| | | } |
| | | compileOptions { |
| | | sourceCompatibility JavaVersion.VERSION_1_8 |
| | | targetCompatibility JavaVersion.VERSION_1_8 |
| | | } |
| | | } |
| | | |
| | | dependencies { |
| | | |
| | | implementation 'androidx.appcompat:appcompat:1.1.0' |
| | | implementation 'com.google.android.material:material:1.1.0' |
| | | implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' |
| | | implementation project(path: ':library-common') |
| | | testImplementation 'junit:junit:4.+' |
| | | androidTestImplementation 'androidx.test.ext:junit:1.1.1' |
| | | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' |
| | | api files('libs/tbs_sdk_thirdapp_v4.3.0.185_44085.jar') |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.ec.search; |
| | | |
| | | import android.content.Context; |
| | | |
| | | import androidx.test.platform.app.InstrumentationRegistry; |
| | | import androidx.test.ext.junit.runners.AndroidJUnit4; |
| | | |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | |
| | | import static org.junit.Assert.*; |
| | | |
| | | /** |
| | | * Instrumented test, which will execute on an Android device. |
| | | * |
| | | * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> |
| | | */ |
| | | @RunWith(AndroidJUnit4.class) |
| | | public class ExampleInstrumentedTest { |
| | | @Test |
| | | public void useAppContext() { |
| | | // Context of the app under test. |
| | | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); |
| | | assertEquals("com.yeshi.ec.search.test", appContext.getPackageName()); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| | | package="com.video.youth"> |
| | | |
| | | <application> |
| | | <activity |
| | | android:name=".ui.YouthActivity" |
| | | android:screenOrientation="portrait"></activity> |
| | | <activity |
| | | android:name=".ui.YouthPwdActivity" |
| | | android:screenOrientation="portrait"></activity> |
| | | <activity |
| | | android:name=".ui.BrowserActivity" |
| | | android:screenOrientation="portrait"></activity> |
| | | </application> |
| | | </manifest> |
New file |
| | |
| | | package com.video.youth.entity; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class YouthModeChange implements Serializable { |
| | | |
| | | private boolean open; |
| | | |
| | | public YouthModeChange(boolean open) { |
| | | this.open = open; |
| | | } |
| | | |
| | | public boolean isOpen() { |
| | | return open; |
| | | } |
| | | |
| | | public void setOpen(boolean open) { |
| | | this.open = open; |
| | | } |
| | | } |
New file |
| | |
| | | package com.video.youth.ui; |
| | | |
| | | import android.Manifest; |
| | | import android.content.Intent; |
| | | import android.content.pm.PackageManager; |
| | | import android.graphics.Color; |
| | | import android.graphics.PixelFormat; |
| | | import android.net.Uri; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | import android.view.KeyEvent; |
| | | import android.view.View; |
| | | import android.view.View.OnClickListener; |
| | | import android.view.ViewGroup; |
| | | import android.webkit.JavascriptInterface; |
| | | import android.widget.ProgressBar; |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.lcjian.library.util.common.ClipboardUtil; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.tencent.smtt.export.external.interfaces.SslError; |
| | | import com.tencent.smtt.export.external.interfaces.SslErrorHandler; |
| | | import com.tencent.smtt.export.external.interfaces.WebResourceRequest; |
| | | import com.tencent.smtt.sdk.ValueCallback; |
| | | import com.tencent.smtt.sdk.WebChromeClient; |
| | | import com.tencent.smtt.sdk.WebSettings; |
| | | import com.tencent.smtt.sdk.WebView; |
| | | import com.tencent.smtt.sdk.WebViewClient; |
| | | import com.video.youth.R; |
| | | |
| | | import java.lang.reflect.Field; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.core.app.ActivityCompat; |
| | | import androidx.core.content.ContextCompat; |
| | | import androidx.fragment.app.FragmentActivity; |
| | | |
| | | public class BrowserActivity extends FragmentActivity implements OnClickListener { |
| | | private final static int FILECHOOSER_RESULTCODE = 10002; |
| | | |
| | | private static final String TAG = BrowserActivity.class.getSimpleName(); |
| | | private TextView tv_top_bar_left; |
| | | private TextView tv_top_bar_middle; |
| | | private WebView webview; |
| | | ProgressBar progressBar; |
| | | private ValueCallback mUploadMessage; |
| | | |
| | | |
| | | private void initX5WebView() { |
| | | webview = findViewById(R.id.webview); |
| | | webview.setWebViewClient(new WebViewClient() { |
| | | @Override |
| | | public boolean shouldOverrideUrlLoading(WebView view, String url) { |
| | | Log.i(TAG, "url:" + url); |
| | | if (url != null && url.startsWith("weixin://")) { |
| | | Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); |
| | | startActivity(intent); |
| | | return true; |
| | | } else if (url != null && (!url.startsWith("http"))) { |
| | | return true; |
| | | } |
| | | return super.shouldOverrideUrlLoading(view, url); |
| | | } |
| | | |
| | | @Override |
| | | public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) { |
| | | String url = webResourceRequest.getUrl().toString(); |
| | | Log.i(TAG, "url:" + url); |
| | | return super.shouldOverrideUrlLoading(webView, webResourceRequest); |
| | | } |
| | | |
| | | @Override |
| | | public void onPageFinished(WebView webView, String s) { |
| | | super.onPageFinished(webView, s); |
| | | } |
| | | |
| | | @Override |
| | | public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { |
| | | } |
| | | }); |
| | | |
| | | webview.setWebChromeClient(new WebChromeClient() { |
| | | |
| | | @Override |
| | | public void onReceivedTitle(WebView view, String title) { |
| | | if (!StringUtils.isBlank(wholeTitle)) |
| | | return; |
| | | tv_top_bar_middle.setText(title); |
| | | } |
| | | |
| | | @Override |
| | | public void onProgressChanged(WebView webView, int i) { |
| | | if (i == 100) { |
| | | progressBar.setVisibility(View.GONE); |
| | | } else { |
| | | if (View.INVISIBLE == progressBar.getVisibility()) { |
| | | progressBar.setVisibility(View.VISIBLE); |
| | | } |
| | | progressBar.setProgress(i); |
| | | } |
| | | super.onProgressChanged(webView, i); |
| | | } |
| | | |
| | | @Override |
| | | public void openFileChooser(ValueCallback<Uri> valueCallback, String acceptType, String capture) { |
| | | if (mUploadMessage != null) { |
| | | mUploadMessage.onReceiveValue(null); |
| | | } |
| | | if (lacksPermissions(Manifest.permission.READ_EXTERNAL_STORAGE)) { //存储权限未开启 |
| | | valueCallback.onReceiveValue(null); |
| | | ActivityCompat.requestPermissions(BrowserActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 10023); |
| | | return; |
| | | } |
| | | mUploadMessage = valueCallback; |
| | | Intent i = new Intent(Intent.ACTION_GET_CONTENT); |
| | | i.addCategory(Intent.CATEGORY_OPENABLE); |
| | | String type = TextUtils.isEmpty(acceptType) ? "*/*" : acceptType; |
| | | i.setType(type); |
| | | startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE); |
| | | super.openFileChooser(valueCallback, acceptType, capture); |
| | | } |
| | | |
| | | // 判断权限集合 是否授权 false授权 true未授权 |
| | | public boolean lacksPermissions(String... permissions) { |
| | | for (String permission : permissions) { |
| | | if (lacksPermission(permission)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | // 判断是否缺少权限 |
| | | private boolean lacksPermission(String permission) { |
| | | //权限未授权 |
| | | return ContextCompat.checkSelfPermission(getApplicationContext(), permission) == PackageManager.PERMISSION_DENIED; |
| | | } |
| | | |
| | | @Override |
| | | public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> valueCallback, FileChooserParams fileChooserParams) { |
| | | if (mUploadMessage != null) { |
| | | mUploadMessage.onReceiveValue(null); |
| | | } |
| | | if (lacksPermissions(Manifest.permission.READ_EXTERNAL_STORAGE)) { //存储权限未开启 |
| | | valueCallback.onReceiveValue(null); |
| | | ActivityCompat.requestPermissions(BrowserActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 10023); |
| | | return true; |
| | | } |
| | | |
| | | |
| | | mUploadMessage = valueCallback; |
| | | Intent i = new Intent(Intent.ACTION_GET_CONTENT); |
| | | i.addCategory(Intent.CATEGORY_OPENABLE); |
| | | if (fileChooserParams != null && fileChooserParams.getAcceptTypes() != null |
| | | && fileChooserParams.getAcceptTypes().length > 0) { |
| | | i.setType(fileChooserParams.getAcceptTypes()[0]); |
| | | } else { |
| | | i.setType("*/*"); |
| | | } |
| | | startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE); |
| | | return true; |
| | | } |
| | | }); |
| | | WebSettings webSetting = webview.getSettings(); |
| | | webSetting.setJavaScriptEnabled(true); |
| | | webSetting.setTextZoom(100); |
| | | webSetting.setDomStorageEnabled(true); |
| | | webview.addJavascriptInterface(new MyJavaInterface(), "yestv"); |
| | | } |
| | | |
| | | @Override |
| | | protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { |
| | | super.onActivityResult(requestCode, resultCode, data); |
| | | } |
| | | |
| | | private String wholeTitle; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
| | | try { |
| | | Class decorViewClazz = Class.forName("com.android.internal.policy.DecorView"); |
| | | Field field = decorViewClazz.getDeclaredField("mSemiTransparentStatusBarColor"); |
| | | field.setAccessible(true); |
| | | field.setInt(getWindow().getDecorView(), Color.TRANSPARENT); //改为透明 |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | getWindow().setFormat(PixelFormat.TRANSLUCENT); |
| | | setContentView(R.layout.activity_browser_youth); |
| | | tv_top_bar_left = findViewById(R.id.tv_left); |
| | | tv_top_bar_middle = findViewById(R.id.tv_middle); |
| | | |
| | | tv_top_bar_left.setOnClickListener(this); |
| | | |
| | | progressBar = findViewById(R.id.myProgressBar); |
| | | progressBar.setMax(100); |
| | | progressBar.setProgressDrawable(this.getResources() |
| | | .getDrawable(R.drawable.color_progressbar)); |
| | | initX5WebView(); |
| | | webview.loadUrl(getIntent().getStringExtra("url")); |
| | | wholeTitle = getIntent().getStringExtra("title"); |
| | | if (!StringUtils.isBlank(wholeTitle)) { |
| | | tv_top_bar_middle.setText(wholeTitle); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | } |
| | | |
| | | @Override |
| | | public void onPause() { |
| | | super.onPause(); |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | if (webview != null) { |
| | | webview.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); |
| | | webview.clearHistory(); |
| | | |
| | | ((ViewGroup) webview.getParent()).removeView(webview); |
| | | webview.destroy(); |
| | | webview = null; |
| | | } |
| | | super.onDestroy(); |
| | | } |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (v.getId() == R.id.tv_left) { |
| | | if (!webview.canGoBack()) |
| | | finish(); |
| | | else { |
| | | webview.goBack(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 设置回退 |
| | | // 覆盖Activity类的onKeyDown(int keyCoder,KeyEvent event)方法 |
| | | @Override |
| | | public boolean onKeyDown(int keyCode, KeyEvent event) { |
| | | if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) { |
| | | webview.goBack(); // goBack()表示返回WebView的上一页面 |
| | | return true; |
| | | } |
| | | return super.onKeyDown(keyCode, event); |
| | | } |
| | | |
| | | class MyJavaInterface { |
| | | |
| | | @JavascriptInterface |
| | | public void toast(String st) { |
| | | Toast.makeText(BrowserActivity.this, st, Toast.LENGTH_SHORT).show(); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void copyText(String st) { |
| | | ClipboardUtil.copy(getApplicationContext(), st); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public String getAppName() { |
| | | return getString(R.string.app_name) + ""; |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.video.youth.ui; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Intent; |
| | | import android.graphics.Color; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | import android.view.View.OnClickListener; |
| | | import android.widget.Toast; |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.video.youth.util.YouthUtil; |
| | | import com.video.youth.R; |
| | | |
| | | import java.lang.reflect.Field; |
| | | |
| | | public class YouthActivity extends Activity implements |
| | | OnClickListener { |
| | | |
| | | |
| | | private AQuery mAquery; |
| | | |
| | | |
| | | private void initView() { |
| | | mAquery = new AQuery(this); |
| | | mAquery.id(R.id.tv_middle).text("青少年模式"); |
| | | mAquery.id(R.id.tv_left).clicked(this); |
| | | mAquery.id(R.id.tv_open).clicked(this); |
| | | } |
| | | |
| | | private void init() { |
| | | if (YouthUtil.isOpenYouthMode(getApplicationContext())) { |
| | | mAquery.id(R.id.tv_open).text("关闭青少年模式"); |
| | | } else { |
| | | mAquery.id(R.id.tv_open).text("开启青少年模式"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
| | | try { |
| | | Class decorViewClazz = Class.forName("com.android.internal.policy.DecorView"); |
| | | Field field = decorViewClazz.getDeclaredField("mSemiTransparentStatusBarColor"); |
| | | field.setAccessible(true); |
| | | field.setInt(getWindow().getDecorView(), Color.TRANSPARENT); //改为透明 |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | setContentView(R.layout.activity_youth); |
| | | initView(); |
| | | } |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | init(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | } |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | |
| | | int id = v.getId(); |
| | | if (id == R.id.tv_left) { |
| | | finish(); |
| | | } else if (id == R.id.tv_open) { |
| | | if (YouthUtil.isOpenYouthMode(getApplicationContext())) { |
| | | startActivity(new Intent(this, YouthPwdActivity.class).putExtra("type", YouthPwdActivity.TYPE_VERIFY)); |
| | | } else { |
| | | if (YouthUtil.isSetPwd(getApplicationContext())) { |
| | | YouthUtil.openYouthMode(getApplicationContext()); |
| | | init(); |
| | | Toast.makeText(this, "已开启青少年模式", Toast.LENGTH_SHORT).show(); |
| | | } else |
| | | startActivity(new Intent(this, YouthPwdActivity.class).putExtra("type", YouthPwdActivity.TYPE_SET)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.video.youth.ui; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Intent; |
| | | import android.graphics.Color; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | import android.view.View.OnClickListener; |
| | | import android.widget.Toast; |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.video.youth.ui.subview.VerifyCodeViewShowLine; |
| | | import com.video.youth.util.YouthUtil; |
| | | import com.video.youth.R; |
| | | |
| | | import java.lang.reflect.Field; |
| | | |
| | | public class YouthPwdActivity extends Activity implements |
| | | OnClickListener { |
| | | |
| | | //设置密码 |
| | | public final static int TYPE_SET = 1; |
| | | //验证密码 |
| | | public final static int TYPE_VERIFY = 2; |
| | | //修改密码-原密码 |
| | | public final static int TYPE_UPDATE_OLD = 3; |
| | | //修改密码-新密码 |
| | | public final static int TYPE_UPDATE_NEW = 4; |
| | | |
| | | |
| | | private AQuery mAquery; |
| | | |
| | | private VerifyCodeViewShowLine vcvs; |
| | | |
| | | |
| | | private void initView() { |
| | | mAquery = new AQuery(this); |
| | | vcvs = (VerifyCodeViewShowLine) mAquery.id(R.id.vcvs_pwd).getView(); |
| | | mAquery.id(R.id.tv_middle).text("青少年模式"); |
| | | mAquery.id(R.id.tv_left).clicked(this); |
| | | mAquery.id(R.id.tv_btn).clicked(this); |
| | | mAquery.id(R.id.tv_pwd_forget).clicked(this); |
| | | mAquery.id(R.id.tv_pwd_update).clicked(this); |
| | | } |
| | | |
| | | int type; |
| | | |
| | | private void init() { |
| | | type = getIntent().getIntExtra("type", TYPE_SET); |
| | | switch (type) { |
| | | case TYPE_SET: |
| | | mAquery.id(R.id.tv_title).text("设置密码"); |
| | | mAquery.id(R.id.tv_btn).text("确认设置"); |
| | | break; |
| | | case TYPE_VERIFY: |
| | | mAquery.id(R.id.tv_title).text("输入密码"); |
| | | mAquery.id(R.id.tv_btn).text("确定"); |
| | | break; |
| | | case TYPE_UPDATE_OLD: |
| | | mAquery.id(R.id.tv_title).text("请输入原密码"); |
| | | mAquery.id(R.id.tv_btn).text("下一步"); |
| | | break; |
| | | case TYPE_UPDATE_NEW: |
| | | mAquery.id(R.id.tv_title).text("请输入新密码"); |
| | | mAquery.id(R.id.tv_btn).text("确定"); |
| | | break; |
| | | } |
| | | |
| | | vcvs.setInputCompleteListener(new VerifyCodeViewShowLine.InputCompleteListener() { |
| | | @Override |
| | | public void inputComplete() { |
| | | mAquery.id(R.id.tv_btn).enabled(true); |
| | | } |
| | | |
| | | @Override |
| | | public void invalidContent() { |
| | | mAquery.id(R.id.tv_btn).enabled(false); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
| | | try { |
| | | Class decorViewClazz = Class.forName("com.android.internal.policy.DecorView"); |
| | | Field field = decorViewClazz.getDeclaredField("mSemiTransparentStatusBarColor"); |
| | | field.setAccessible(true); |
| | | field.setInt(getWindow().getDecorView(), Color.TRANSPARENT); //改为透明 |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | setContentView(R.layout.activity_youth_password); |
| | | initView(); |
| | | init(); |
| | | } |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | init(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | } |
| | | |
| | | |
| | | //获取输入的密码 |
| | | private String getInputPwd() { |
| | | return vcvs.getEditContent(); |
| | | } |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | int id = v.getId(); |
| | | if (id == R.id.tv_left) { |
| | | finish(); |
| | | } else if (id == R.id.tv_pwd_update) { |
| | | if (type != TYPE_VERIFY) { |
| | | return; |
| | | } |
| | | startActivity(new Intent(this, YouthPwdActivity.class).putExtra("type", TYPE_UPDATE_OLD)); |
| | | } else if (id == R.id.tv_pwd_forget) { |
| | | startActivity(new Intent(this, BrowserActivity.class).putExtra("url", getString(R.string.forget_pwd))); |
| | | } else if (id == R.id.tv_btn) { |
| | | switch (type) { |
| | | case TYPE_SET: { |
| | | String pwd = getInputPwd(); |
| | | YouthUtil.setPwd(getApplicationContext(), pwd); |
| | | Toast.makeText(this, "密码设置成功", Toast.LENGTH_SHORT).show(); |
| | | YouthUtil.openYouthMode(getApplicationContext()); |
| | | finish(); |
| | | } |
| | | |
| | | break; |
| | | case TYPE_VERIFY: { |
| | | String pwd = getInputPwd(); |
| | | if (!YouthUtil.isPwdRight(getApplicationContext(), pwd)) { |
| | | Toast.makeText(this, "密码错误", Toast.LENGTH_SHORT).show(); |
| | | return; |
| | | } |
| | | if (YouthUtil.isOpenYouthMode(getApplicationContext())) { |
| | | YouthUtil.closeYouthMode(getApplicationContext()); |
| | | Toast.makeText(this, "青少年模式已关闭", Toast.LENGTH_SHORT).show(); |
| | | } else { |
| | | YouthUtil.openYouthMode(getApplicationContext()); |
| | | Toast.makeText(this, "青少年模式已开启", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | finish(); |
| | | } |
| | | |
| | | break; |
| | | case TYPE_UPDATE_OLD: { |
| | | String pwd = getInputPwd(); |
| | | if (!YouthUtil.isPwdRight(getApplicationContext(), pwd)) { |
| | | Toast.makeText(this, "原密码错误", Toast.LENGTH_SHORT).show(); |
| | | return; |
| | | } |
| | | startActivity(new Intent(this, YouthPwdActivity.class).putExtra("type", TYPE_UPDATE_NEW)); |
| | | finish(); |
| | | } |
| | | break; |
| | | case TYPE_UPDATE_NEW: { |
| | | String content = getInputPwd(); |
| | | YouthUtil.setPwd(getApplicationContext(), content); |
| | | Toast.makeText(this, "密码修改成功", Toast.LENGTH_SHORT).show(); |
| | | finish(); |
| | | } |
| | | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.video.youth.ui.subview; |
| | | |
| | | import android.content.Context; |
| | | import android.util.AttributeSet; |
| | | import android.view.MotionEvent; |
| | | |
| | | import androidx.appcompat.widget.AppCompatEditText; |
| | | |
| | | public class MyEditText extends AppCompatEditText { |
| | | |
| | | private long lastTime = 0; |
| | | |
| | | public MyEditText(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | public MyEditText(Context context, AttributeSet attrs) { |
| | | super(context, attrs); |
| | | } |
| | | |
| | | public MyEditText(Context context, AttributeSet attrs, int defStyleAttr) { |
| | | super(context, attrs, defStyleAttr); |
| | | } |
| | | |
| | | @Override |
| | | protected void onSelectionChanged(int selStart, int selEnd) { |
| | | super.onSelectionChanged(selStart, selEnd); |
| | | this.setSelection(this.getText().length()); |
| | | } |
| | | |
| | | @Override |
| | | public boolean onTouchEvent(MotionEvent event) { |
| | | switch (event.getAction()) { |
| | | case MotionEvent.ACTION_DOWN: |
| | | long currentTime = System.currentTimeMillis(); |
| | | if (currentTime - lastTime < 500) { |
| | | lastTime = currentTime; |
| | | return true; |
| | | } else { |
| | | lastTime = currentTime; |
| | | } |
| | | break; |
| | | } |
| | | return super.onTouchEvent(event); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.video.youth.ui.subview; |
| | | |
| | | import android.content.Context; |
| | | import android.text.Editable; |
| | | import android.text.TextWatcher; |
| | | import android.util.AttributeSet; |
| | | import android.view.View; |
| | | import android.widget.EditText; |
| | | import android.widget.RelativeLayout; |
| | | import android.widget.TextView; |
| | | |
| | | |
| | | import com.video.youth.R; |
| | | |
| | | public class VerifyCodeViewShowLine extends RelativeLayout { |
| | | |
| | | public EditText editText; |
| | | private TextView[] textViews; |
| | | private static int MAX = 4; |
| | | private String inputContent; |
| | | |
| | | public VerifyCodeViewShowLine(Context context) { |
| | | this(context, null); |
| | | } |
| | | |
| | | public VerifyCodeViewShowLine(Context context, AttributeSet attrs) { |
| | | this(context, attrs, 0); |
| | | } |
| | | |
| | | public VerifyCodeViewShowLine(Context context, AttributeSet attrs, int defStyleAttr) { |
| | | super(context, attrs, defStyleAttr); |
| | | View.inflate(context, R.layout.view_youth_input_code, this); |
| | | textViews = new TextView[MAX]; |
| | | textViews[0] = findViewById(R.id.tv_code_1); |
| | | textViews[1] = findViewById(R.id.tv_code_2); |
| | | textViews[2] = findViewById(R.id.tv_code_3); |
| | | textViews[3] = findViewById(R.id.tv_code_4); |
| | | editText = findViewById(R.id.edit_text_view); |
| | | |
| | | editText.setCursorVisible(false);//隐藏光标 |
| | | setEditTextListener(); |
| | | } |
| | | |
| | | private void setEditTextListener() { |
| | | editText.addTextChangedListener(new TextWatcher() { |
| | | |
| | | @Override |
| | | public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable editable) { |
| | | inputContent = editText.getText().toString(); |
| | | |
| | | if (inputCompleteListener != null) { |
| | | if (inputContent.length() >= MAX) { |
| | | inputCompleteListener.inputComplete(); |
| | | } else { |
| | | inputCompleteListener.invalidContent(); |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < MAX; i++) { |
| | | if (i < inputContent.length()) { |
| | | textViews[i].setText(String.valueOf(inputContent.charAt(i))); |
| | | } else { |
| | | textViews[i].setText(""); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | private InputCompleteListener inputCompleteListener; |
| | | |
| | | public void setInputCompleteListener(InputCompleteListener inputCompleteListener) { |
| | | this.inputCompleteListener = inputCompleteListener; |
| | | } |
| | | |
| | | public interface InputCompleteListener { |
| | | |
| | | void inputComplete(); |
| | | |
| | | void invalidContent(); |
| | | } |
| | | |
| | | public String getEditContent() { |
| | | return inputContent; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.video.youth.util; |
| | | |
| | | import android.content.Context; |
| | | import android.content.SharedPreferences; |
| | | |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.video.youth.entity.YouthModeChange; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | |
| | | public class YouthUtil { |
| | | |
| | | /** |
| | | * 是否开启了青少年模式 |
| | | * |
| | | * @param context |
| | | * @return |
| | | */ |
| | | public static boolean isOpenYouthMode(Context context) { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("youth_setting", Context.MODE_PRIVATE); |
| | | return sharedPreferences.getBoolean("open", false); |
| | | } |
| | | |
| | | /** |
| | | * 关闭青少年模式 |
| | | * |
| | | * @param context |
| | | */ |
| | | public static void openYouthMode(Context context) { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("youth_setting", Context.MODE_PRIVATE); |
| | | SharedPreferences.Editor editor = sharedPreferences.edit(); |
| | | editor.putBoolean("open", true); |
| | | editor.commit(); |
| | | EventBus.getDefault().post(new YouthModeChange(true)); |
| | | } |
| | | |
| | | /** |
| | | * 关闭青少年模式 |
| | | * |
| | | * @param context |
| | | */ |
| | | public static void closeYouthMode(Context context) { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("youth_setting", Context.MODE_PRIVATE); |
| | | SharedPreferences.Editor editor = sharedPreferences.edit(); |
| | | editor.putBoolean("open", false); |
| | | editor.commit(); |
| | | EventBus.getDefault().post(new YouthModeChange(false)); |
| | | } |
| | | |
| | | /** |
| | | * 设置密码 |
| | | * |
| | | * @param context |
| | | * @param pwd |
| | | */ |
| | | public static void setPwd(Context context, String pwd) { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("youth_setting", Context.MODE_PRIVATE); |
| | | SharedPreferences.Editor editor = sharedPreferences.edit(); |
| | | editor.putString("pwd", pwd); |
| | | editor.commit(); |
| | | } |
| | | |
| | | /** |
| | | * 密码是否正确 |
| | | * |
| | | * @param context |
| | | * @param pwd |
| | | * @return |
| | | */ |
| | | public static boolean isPwdRight(Context context, String pwd) { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("youth_setting", Context.MODE_PRIVATE); |
| | | String old = sharedPreferences.getString("pwd", ""); |
| | | return old.equalsIgnoreCase(pwd); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否设置了密码 |
| | | * |
| | | * @param context |
| | | * @return |
| | | */ |
| | | public static boolean isSetPwd(Context context) { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("youth_setting", Context.MODE_PRIVATE); |
| | | String old = sharedPreferences.getString("pwd", ""); |
| | | return !StringUtils.isBlank(old); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <item android:drawable="@drawable/shape_youth_btn" android:state_enabled="true"></item> |
| | | <item android:drawable="@drawable/shape_youth_btn_invalid" android:state_enabled="false"></item> |
| | | |
| | | </selector> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="40dp" /> |
| | | |
| | | <solid android:color="@color/btn_bg_color" /> |
| | | |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="40dp" /> |
| | | |
| | | <solid android:color="@color/btn_invalid_bg_color" /> |
| | | |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="8dp" /> |
| | | |
| | | <solid android:color="#CECECE" /> |
| | | |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout 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="match_parent" |
| | | android:orientation="vertical"> |
| | | |
| | | |
| | | <include layout="@layout/item_youth_nav"></include> |
| | | |
| | | <ProgressBar |
| | | android:id="@+id/myProgressBar" |
| | | style="?android:attr/progressBarStyleHorizontal" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="#0B78E3" /> |
| | | |
| | | |
| | | <com.tencent.smtt.sdk.WebView |
| | | android:id="@+id/webview" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"></com.tencent.smtt.sdk.WebView> |
| | | |
| | | |
| | | </LinearLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout 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="match_parent" |
| | | android:orientation="vertical"> |
| | | |
| | | |
| | | <include layout="@layout/item_youth_nav"></include> |
| | | |
| | | |
| | | <com.lcjian.library.widget.RatioLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:ratio="0.408"> |
| | | |
| | | <ImageView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:src="@drawable/ic_youth_banner"></ImageView> |
| | | </com.lcjian.library.widget.RatioLayout> |
| | | |
| | | <ScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_margin="22dp" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="@string/youth_notify_1" |
| | | android:textColor="#ff00a365" |
| | | android:textSize="15sp" /> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="36dp" |
| | | android:text="@string/youth_notify_2" |
| | | android:textColor="#ff333333" |
| | | android:textSize="15sp" /> |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:lineSpacingExtra="5dp" |
| | | android:text="建议青少年们适当观看本App中与学习课程、科普知识相关的内容等" |
| | | android:textColor="#fffe3c69" |
| | | android:textSize="15sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </ScrollView> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_open" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="50dp" |
| | | android:background="#35C791" |
| | | android:gravity="center" |
| | | android:text="开启青少年模式" |
| | | android:textColor="#FFFFFF" |
| | | android:textSize="18sp"> |
| | | |
| | | |
| | | </TextView> |
| | | |
| | | </LinearLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout 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="match_parent" |
| | | android:background="#FFFFFF" |
| | | android:orientation="vertical"> |
| | | |
| | | |
| | | <include layout="@layout/item_youth_nav"></include> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="#E0E0E0"></View> |
| | | |
| | | <ScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingLeft="46dp" |
| | | android:paddingTop="46dp" |
| | | android:paddingRight="46dp"> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_title" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="23dp" |
| | | android:gravity="center" |
| | | android:text="请设置密码" |
| | | android:textColor="#ff000000" |
| | | android:textSize="24sp" /> |
| | | |
| | | |
| | | <com.video.youth.ui.subview.VerifyCodeViewShowLine |
| | | android:id="@+id/vcvs_pwd" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="140dp" |
| | | android:inputType="number" |
| | | android:maxLength="4"></com.video.youth.ui.subview.VerifyCodeViewShowLine> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_btn" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="44dp" |
| | | android:layout_marginTop="46dp" |
| | | android:background="@drawable/selector_youth_btn" |
| | | android:enabled="false" |
| | | android:gravity="center" |
| | | android:text="确认设置" |
| | | android:textColor="@color/btn_text_color" |
| | | android:textSize="17sp" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_password" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="60dp" |
| | | android:gravity="center"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_pwd_update" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="修改密码" |
| | | android:textColor="@color/btn_bg_color" |
| | | android:textSize="11sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_pwd_forget" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="43dp" |
| | | android:text="找回密码" |
| | | android:textColor="@color/btn_bg_color" |
| | | android:textSize="11sp" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </ScrollView> |
| | | |
| | | |
| | | </LinearLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout 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="48dp"> |
| | | |
| | | |
| | | <FrameLayout |
| | | android:background="#FFFFFF" |
| | | android:id="@+id/fl_nav" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:gravity="center_vertical"> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_left" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="match_parent" |
| | | android:layout_gravity="left|center_vertical" |
| | | android:drawableLeft="@drawable/ic_youth_back" |
| | | android:drawablePadding="12dp" |
| | | android:gravity="center" |
| | | android:paddingLeft="10dp" |
| | | android:paddingRight="10dp" |
| | | android:text="返回" |
| | | android:textAppearance="?android:attr/textAppearanceMedium" |
| | | android:textColor="#000000" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_middle" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:ellipsize="end" |
| | | android:maxLength="10" |
| | | android:textAppearance="?android:attr/textAppearanceLarge" |
| | | android:textColor="#000000" /> |
| | | |
| | | |
| | | </FrameLayout> |
| | | |
| | | |
| | | </LinearLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:focusable="true" |
| | | android:focusableInTouchMode="true"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:clickable="false" |
| | | android:gravity="center"> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_code_1" |
| | | style="@style/code" |
| | | android:text=""></TextView> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_code_2" |
| | | style="@style/code" |
| | | android:text=""></TextView> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_code_3" |
| | | style="@style/code" |
| | | android:text=""></TextView> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_code_4" |
| | | style="@style/code" |
| | | android:text=""></TextView> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <EditText |
| | | android:id="@+id/edit_text_view" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="60dp" |
| | | android:background="@color/transparent" |
| | | android:inputType="number" |
| | | android:longClickable="false" |
| | | android:maxLength="4" |
| | | android:textColor="@color/transparent" |
| | | android:textSize="14sp" /> |
| | | |
| | | |
| | | </RelativeLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <resources> |
| | | <color name="btn_bg_color">#FF067cf6</color> |
| | | <color name="btn_text_color">#FFFFFF</color> |
| | | |
| | | <color name="btn_invalid_bg_color">#CECECE</color> |
| | | |
| | | |
| | | <color name="colorPrimary">#3F51B5</color> |
| | | <color name="colorPrimaryDark">#303F9F</color> |
| | | <color name="colorAccent">#159FFF</color> |
| | | |
| | | |
| | | </resources> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <resources> |
| | | |
| | | <string name="youth_notify_1" translatable="false">为呵护未成年人健康成长、适度合理使用本App,影视大全推出青少年模式,该模式下包括但不限于对观看时间、付费购买VIP等有所限制,会提醒用户注意休息和提醒支付风险等,请找家长帮忙协助调整限制。</string> |
| | | <string name="youth_notify_2" translatable="false">青少年默认限制观看时长限制\n |
| | | 每天40分钟\n\n |
| | | 青少年默认限制观看时间段限制\n |
| | | 早上6:00-晚上10:00\n\n |
| | | 青少年默认限制资金往来\n |
| | | 购买视频VIP和发起本App内的任何支付\n\n |
| | | </string> |
| | | |
| | | <string name="forget_pwd" translatable="false">http://bwweb.yeshitv.com/youth/forget.html</string> |
| | | |
| | | </resources> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <resources> |
| | | |
| | | |
| | | <!-- 视频搜索结果页专辑视频按钮样式--> |
| | | <style name="code"> |
| | | <item name="android:layout_width">43dp</item> |
| | | <item name="android:layout_height">48dp</item> |
| | | <item name="android:gravity">center</item> |
| | | <item name="android:maxLength">1</item> |
| | | <item name="android:textColor">#000000</item> |
| | | <item name="android:textSize">20sp</item> |
| | | <item name="android:background">@drawable/shape_youth_code_input</item> |
| | | <item name="android:layout_marginLeft">4.5dp</item> |
| | | <item name="android:layout_marginRight">4.5dp</item> |
| | | <item name="android:clickable">false</item> |
| | | </style> |
| | | |
| | | |
| | | |
| | | </resources> |
New file |
| | |
| | | package com.yeshi.ec.search; |
| | | |
| | | import org.junit.Test; |
| | | |
| | | import static org.junit.Assert.*; |
| | | |
| | | /** |
| | | * Example local unit test, which will execute on the development machine (host). |
| | | * |
| | | * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> |
| | | */ |
| | | public class ExampleUnitTest { |
| | | @Test |
| | | public void addition_isCorrect() { |
| | | assertEquals(4, 2 + 2); |
| | | } |
| | | } |
| | |
| | | include ':library-ViewPagerIndicator' |
| | | include ':library-DownloadProvider' |
| | | include ':library-common' |
| | | include ':library-youth' |
| | | include ':library-APPUpdate' |
| | | include ':library-gallery' |
| | | include ':BuWanVideo' |