| | |
| | | android:protectionLevel="signature" /> |
| | | <uses-permission android:name="${applicationId}.permission.KW_SDK_BROADCAST" /> |
| | | |
| | | <uses-sdk tools:overrideLibrary="com.bytedance.pangrowthsdk,com.bytedance.novel.pangolin,com.bytedance.sdk.dp.dpsdk_lite,com.bytedance.sdk.dp.dpsdk_live,com.byted.live.api,com.bytedance.pangolin.game,com.bytedance.miniapp,com.volcengine.mars.utility" /> |
| | | <uses-sdk tools:overrideLibrary="com.bytedance.pangrowthsdk,com.bytedance.novel.pangolin,com.bytedance.sdk.dp.dpsdk_lite,com.bytedance.sdk.dp.dpsdk_live,com.byted.live.api,com.bytedance.pangolin.game,com.bytedance.miniapp,com.volcengine.mars.utility,com.shuyu.gsyvideoplayer.lib,com.shuyu.gsyvideoplayer,tv.danmaku.ijk.media.exo2,com.shuyu.gsyvideoplayer.armv5,com.shuyu.gsyvideoplayer.armv7a,com.shuyu.gsyvideoplayer.armv64,com.shuyu.gsyvideoplayer.x86_64,com.shuyu.gsyvideoplayer.x86,com.shuyu.gsy.base,shuyu.com.androidvideocache" /> |
| | | |
| | | |
| | | <application |
| | | android:name="com.weikou.beibeivideo.BeibeiVideoApplication" |
| | |
| | | android:value="570f28a578d6e12cba6f7f200b8d1c83"></meta-data> |
| | | <meta-data |
| | | android:name="UMENG_CHANNEL" |
| | | android:value="QQ"></meta-data> |
| | | android:value="VIVO"></meta-data> |
| | | |
| | | |
| | | <provider |
| | |
| | | |
| | | implementation 'androidx.cardview:cardview:1.0.0' |
| | | |
| | | // //视频播放器 |
| | | // //完整版引入 |
| | | // implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer:v8.1.5-release-jitpack' |
| | | |
| | | implementation 'com.shuyu:GSYVideoPlayer:7.1.8' |
| | | |
| | | //权限请求 |
| | | implementation 'com.github.jokermonn:permissions4m:2.1.2-lib' |
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/page_bg_color" |
| | | android:orientation="vertical"> |
| | | |
| | | <FrameLayout |
| | | android:id="@+id/fl_container" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"></FrameLayout> |
| | | |
| | | <com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer |
| | | android:id="@+id/videoPlayer" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"></com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer> |
| | | |
| | | <FrameLayout |
| | | android:id="@+id/fl_loading" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="#000000"> |
| | | |
| | | |
| | | <ProgressBar |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center"></ProgressBar> |
| | | |
| | | </FrameLayout> |
| | | |
| | | </FrameLayout> |
| | |
| | | <resources> |
| | | <string name="app_name">影视大全</string> |
| | | <string name="app_name">影视大全布丸</string> |
| | | <string name="recommend">视频</string> |
| | | <string name="category">分类</string> |
| | | <string name="discover">发现</string> |
New file |
| | |
| | | package com.funshion.video.parser; |
| | | |
| | | import android.content.pm.ActivityInfo; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.webkit.ConsoleMessage; |
| | | import android.webkit.JavascriptInterface; |
| | | import android.webkit.WebChromeClient; |
| | | import android.webkit.WebResourceRequest; |
| | | import android.webkit.WebSettings; |
| | | import android.webkit.WebView; |
| | | import android.webkit.WebViewClient; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.shuyu.gsyvideoplayer.GSYVideoManager; |
| | | import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.util.downutil.StringUtils; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.fragment.app.Fragment; |
| | | |
| | | /** |
| | | * 视频播放路径解析 |
| | | */ |
| | | public class FunshionWebPlayerFragment extends Fragment { |
| | | |
| | | final int MAX_PARSE_COUNT = 4; |
| | | private String TAG = "FunshionWebPlayerFragment"; |
| | | private WebView webView; |
| | | private String url; |
| | | private String playUrl = null; |
| | | int parseCount = 0; |
| | | |
| | | |
| | | private String title; |
| | | |
| | | |
| | | private AQuery mAQuery; |
| | | private StandardGSYVideoPlayer videoPlayer; |
| | | |
| | | public FunshionWebPlayerFragment(String title, String url) { |
| | | this.url = url; |
| | | this.title = title; |
| | | } |
| | | |
| | | private void initWebSetting() { |
| | | WebSettings webSetting = webView.getSettings(); |
| | | webSetting.setJavaScriptEnabled(true); |
| | | webSetting.setTextZoom(100); |
| | | webSetting.setBlockNetworkImage(false); |
| | | webSetting.setJavaScriptEnabled(true); |
| | | webSetting.setJavaScriptCanOpenWindowsAutomatically(true); |
| | | webSetting.setAllowFileAccess(true); |
| | | webSetting.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); |
| | | webSetting.setSupportZoom(false); |
| | | webSetting.setBuiltInZoomControls(true); |
| | | webSetting.setUseWideViewPort(true); |
| | | webSetting.setSupportMultipleWindows(true); |
| | | webSetting.setLoadWithOverviewMode(true); |
| | | webSetting.setAppCacheEnabled(true); |
| | | webSetting.setDatabaseEnabled(true); |
| | | webSetting.setDomStorageEnabled(true); |
| | | webSetting.setGeolocationEnabled(true); |
| | | webSetting.setAppCacheMaxSize(Long.MAX_VALUE); |
| | | webSetting.setPluginState(WebSettings.PluginState.ON_DEMAND); |
| | | webSetting.setRenderPriority(WebSettings.RenderPriority.HIGH); |
| | | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
| | | webSetting.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); |
| | | } |
| | | } |
| | | |
| | | |
| | | private void initView() { |
| | | WebSettings settings = webView.getSettings(); |
| | | settings.setJavaScriptEnabled(true); |
| | | settings.setJavaScriptCanOpenWindowsAutomatically(true); |
| | | settings.setPluginState(WebSettings.PluginState.ON); |
| | | // settings.setPluginsEnabled(true); |
| | | settings.setAllowFileAccess(true); |
| | | settings.setLoadWithOverviewMode(true); |
| | | settings.setUserAgentString("Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Mobile Safari/537.36"); |
| | | |
| | | webView.setWebViewClient(new WebViewClient() { |
| | | @Override |
| | | public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { |
| | | String url = request.getUrl().toString(); |
| | | Log.i(TAG, request.getUrl().toString()); |
| | | return super.shouldOverrideUrlLoading(view, request); |
| | | } |
| | | |
| | | @Override |
| | | public void onPageFinished(WebView view, String url) { |
| | | super.onPageFinished(view, url); |
| | | startParse(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean shouldOverrideUrlLoading(WebView view, String url) { |
| | | Log.i(TAG, url); |
| | | return super.shouldOverrideUrlLoading(view, url); |
| | | } |
| | | }); |
| | | |
| | | webView.setWebChromeClient(new WebChromeClient() { |
| | | @Override |
| | | public boolean onConsoleMessage(ConsoleMessage consoleMessage) { |
| | | Log.i(TAG, consoleMessage.lineNumber() + ":" + consoleMessage.message()); |
| | | return super.onConsoleMessage(consoleMessage); |
| | | } |
| | | }); |
| | | |
| | | webView.addJavascriptInterface(new VideoJavascriptInter(new IParseResult() { |
| | | @Override |
| | | public void onSuccess(String url) { |
| | | Log.i(TAG, "开始播放:" + url); |
| | | videoPlayer.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | videoPlayer.setUp(url, true, title); |
| | | videoPlayer.getTitleTextView().setVisibility(View.VISIBLE); |
| | | videoPlayer.startPlayLogic(); |
| | | mAQuery.id(R.id.fl_loading).visibility(View.GONE); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | }), "__video"); |
| | | |
| | | initWebSetting(); |
| | | } |
| | | |
| | | private void initPlayer() { |
| | | |
| | | videoPlayer.getBackButton().setVisibility(View.INVISIBLE); |
| | | videoPlayer.getBackButton().setImageResource(R.drawable.icon_player_back); |
| | | |
| | | //设置返回按键功能 |
| | | videoPlayer.getBackButton().setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | getActivity().onBackPressed(); |
| | | videoPlayer.getBackButton().setVisibility(View.INVISIBLE); |
| | | } |
| | | }); |
| | | |
| | | |
| | | videoPlayer.getFullscreenButton().setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (getActivity().getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) { |
| | | getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); |
| | | videoPlayer.getBackButton().setVisibility(View.VISIBLE); |
| | | } else { |
| | | getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); |
| | | videoPlayer.getBackButton().setVisibility(View.INVISIBLE); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onCreate(@Nullable Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | } |
| | | |
| | | private void startParse() { |
| | | if (parseCount > MAX_PARSE_COUNT) { |
| | | return; |
| | | } |
| | | if (!StringUtils.isNullOrEmpty(playUrl)) { |
| | | return; |
| | | } |
| | | webView.postDelayed(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | webView.loadUrl("javascript:var ___= document.getElementsByTagName('video')[0].getAttribute('src');__video.src(___)"); |
| | | startParse(); |
| | | } |
| | | }, (int) (Math.pow(parseCount, 2) * 1000)); |
| | | parseCount++; |
| | | |
| | | } |
| | | |
| | | @Nullable |
| | | @Override |
| | | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View root = LayoutInflater.from(getContext()).inflate(R.layout.fragment_funshion_native_player, null); |
| | | videoPlayer = root.findViewById(R.id.videoPlayer); |
| | | mAQuery = new AQuery(root); |
| | | webView = new WebView(getContext()); |
| | | initView(); |
| | | webView.loadUrl(url); |
| | | ((FrameLayout) mAQuery.id(R.id.fl_container).getView()).addView(webView); |
| | | initPlayer(); |
| | | return root; |
| | | } |
| | | |
| | | public void onBackPressed() { |
| | | //先返回正常状态 |
| | | if (getActivity().getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) { |
| | | videoPlayer.getFullscreenButton().performClick(); |
| | | return; |
| | | } |
| | | //释放所有 |
| | | videoPlayer.setVideoAllCallBack(null); |
| | | } |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | videoPlayer.onVideoResume(); |
| | | } |
| | | |
| | | @Override |
| | | public void onPause() { |
| | | super.onPause(); |
| | | videoPlayer.onVideoPause(); |
| | | } |
| | | |
| | | @Override |
| | | public void onDestroy() { |
| | | super.onDestroy(); |
| | | webView.destroy(); |
| | | GSYVideoManager.releaseAllVideos(); |
| | | |
| | | } |
| | | |
| | | |
| | | class VideoJavascriptInter { |
| | | private IParseResult resultListener; |
| | | |
| | | public VideoJavascriptInter(IParseResult result) { |
| | | this.resultListener = result; |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void src(String url) { |
| | | if (!StringUtils.isNullOrEmpty(url) && StringUtils.isNullOrEmpty(playUrl)) { |
| | | playUrl = url; |
| | | if (resultListener != null) { |
| | | resultListener.onSuccess(playUrl); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | interface IParseResult { |
| | | public void onSuccess(String url); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | commonPost(context, BASE_URL + "user", params, handler); |
| | | } |
| | | |
| | | |
| | | public static void phoneLogin(Context context, String phone, String code, ResponseHandlerInterface handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); |
| | | params.put("Method", "phoneLogin"); |
| | | params.put("phone", phone); |
| | | params.put("code", code); |
| | | commonPost(context, BASE_URL + "user", params, handler); |
| | | } |
| | | |
| | | /** |
| | | * 电话号码绑定 |
| | | * |
| | |
| | | commonPost(context, BASE_URL + "user", params, handler); |
| | | } |
| | | |
| | | |
| | | public static void sendLoginVerifyCode(Context context, String phone, |
| | | ResponseHandlerInterface handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); |
| | | params.put("Method", "sendSMSCode"); |
| | | params.put("phone", phone); |
| | | commonPost(context, BASE_URL + "user", params, handler); |
| | | } |
| | | |
| | | /** |
| | | * Email注册 |
| | | * |
| | |
| | | package com.weikou.beibeivideo.entity.vo; |
| | | |
| | | import com.google.gson.annotations.Expose; |
| | | import com.weikou.beibeivideo.entity.VideoInfo; |
| | | |
| | | public class WatchHistoryVO { |
| | | @Expose |
| | | private String id; |
| | | @Expose |
| | | private Long createTime; |
| | | @Expose |
| | | private VideoInfo video; |
| | | @Expose |
| | | private int position; |
| | | //选中 |
| | | private boolean selected; |
| | |
| | | //保存购买记录 |
| | | ConfigUtil.saveBuyRecordUrl(getApplicationContext(), data.optString("buyRecordUrl")); |
| | | |
| | | //是否正在上线 |
| | | ConfigUtil.saveOnLining(getApplicationContext(), data.optBoolean("onLining")); |
| | | |
| | | |
| | | //保存免广告权益持续时间 |
| | | AdUtil.setPPTVNoAdRewardHour(getApplicationContext(), pptvNoAdRewardHour); |
| | | |
| | |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | import com.weikou.beibeivideo.ui.login.LoginActivity; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.mine.MyFavouriteActivity; |
| | | import com.weikou.beibeivideo.util.JsonUtil; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | import com.weikou.beibeivideo.widget.MySwipeRefreshLayout; |
| | | |
| | |
| | | tv_login.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | startActivity(new Intent(FollowActivity.this, LoginActivity.class)); |
| | | UserUtil.toLogin(FollowActivity.this); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.GoodsInfo; |
| | | import com.weikou.beibeivideo.ui.common.FollowActivity; |
| | | import com.weikou.beibeivideo.ui.login.LoginActivity; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONObject; |
| | |
| | | String loginUid = sp.getString("LoginUid", ""); |
| | | if (StringUtils.isEmpty(loginUid)) { |
| | | SingleToast.showToast(mContext, "登录后才能收藏"); |
| | | mContext.startActivity(new Intent(mContext, LoginActivity.class)); |
| | | UserUtil.toLogin(mContext); |
| | | |
| | | return; |
| | | } |
| | | if (Boolean.parseBoolean(info.getCollect())) { |
| | |
| | | import com.weikou.beibeivideo.entity.Ware; |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | import com.weikou.beibeivideo.ui.login.LoginActivity; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | |
| | | import org.apache.http.Header; |
| | |
| | | String loginUid = sp.getString("LoginUid", ""); |
| | | if (StringUtils.isEmpty(loginUid)) { |
| | | SingleToast.showToast(GoodsDetailActivity.this, "登录后才能收藏"); |
| | | startActivity(new Intent(GoodsDetailActivity.this, LoginActivity.class)); |
| | | UserUtil.toLogin(GoodsDetailActivity.this); |
| | | return; |
| | | } |
| | | if (isCollect) |
| | |
| | | import com.weikou.beibeivideo.entity.UserInfo; |
| | | import com.weikou.beibeivideo.ui.login.LoginActivity; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONObject; |
| | |
| | | * 登录 |
| | | */ |
| | | private void setLogin() { |
| | | mContext.startActivity(new Intent(mContext, LoginActivity.class)); |
| | | UserUtil.toLogin(mContext); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (!UserUtil.isLogin(mContext)) { |
| | | mContext.startActivity(new Intent(mContext, LoginActivity.class)); |
| | | UserUtil.toLogin(mContext); |
| | | return; |
| | | } |
| | | mContext.startActivity(new Intent(mContext, BrowserActivity.class).putExtra("url", signInInfo.getSignInConfig().getRecordUrl()).putExtra("close", false)); |
| | |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | import com.weikou.beibeivideo.ui.mine.BrowserActivity; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.ConfigUtil; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | |
| | | import org.apache.http.Header; |
| | |
| | | } |
| | | break; |
| | | case R.id.tv_other_login: |
| | | setLoginType(true); |
| | | if (ConfigUtil.isOnLining(getApplicationContext())) { |
| | | startActivity(new Intent(this, PhoneLoginActivity.class).putExtra("login", true)); |
| | | finish(); |
| | | } else { |
| | | setLoginType(true); |
| | | } |
| | | break; |
| | | case R.id.ll_login_qq:// QQ登录 |
| | | if (!cb_user_agreement.isChecked()) { |
| | |
| | | placeholder(R.drawable.ic_portrait_default).error(R.drawable.ic_portrait_default).transform(new GlideCircleTransform(getApplicationContext())).into(iv_portrait); |
| | | if (!StringUtils.isEmpty(userInfoVO.getNickName())) { |
| | | tv_nickName.setText(userInfoVO.getNickName()); |
| | | tv_nickName.setTextColor(Color.WHITE); |
| | | tv_nickName.setTextColor(Color.GRAY); |
| | | } else { |
| | | tv_nickName.setText("未填写"); |
| | | tv_nickName.setTextColor(Color.GRAY); |
| | |
| | | |
| | | if (!StringUtils.isEmpty(userInfoVO.getBirthday())) { |
| | | tv_birthday.setText(userInfoVO.getBirthday()); |
| | | tv_birthday.setTextColor(Color.WHITE); |
| | | tv_birthday.setTextColor(Color.GRAY); |
| | | } else { |
| | | tv_birthday.setText("未填写"); |
| | | tv_birthday.setTextColor(Color.GRAY); |
| | |
| | | |
| | | if (!StringUtils.isEmpty(userInfoVO.getSex())) { |
| | | tv_sex.setText(Integer.parseInt(userInfoVO.getSex()) == 0 ? "女" : "男"); |
| | | tv_sex.setTextColor(Color.WHITE); |
| | | tv_sex.setTextColor(Color.GRAY); |
| | | } else { |
| | | tv_sex.setText("未填写"); |
| | | tv_sex.setTextColor(Color.GRAY); |
| | |
| | | |
| | | if (!StringUtils.isEmpty(userInfoVO.getSign())) { |
| | | tv_autograph.setText(userInfoVO.getSign()); |
| | | tv_autograph.setTextColor(Color.WHITE); |
| | | tv_autograph.setTextColor(Color.GRAY); |
| | | } else { |
| | | tv_autograph.setText("未填写"); |
| | | tv_autograph.setTextColor(Color.GRAY); |
| | |
| | | package com.weikou.beibeivideo.ui.login; |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.content.SharedPreferences; |
| | | import android.graphics.Color; |
| | | import android.graphics.Paint; |
| | | import android.os.Bundle; |
| | |
| | | |
| | | private PhoneNumberAuthHelper mPhoneNumberAuthHelper; |
| | | |
| | | private TextView tv_login_onekey, tv_obtain_verfication_code, tv_title; |
| | | private TextView tv_login_onekey, tv_obtain_verfication_code, tv_title, tv_confirm; |
| | | |
| | | private EditText et_phone, et_verfication_code; |
| | | |
| | |
| | | cb_user_agreement = findViewById(R.id.cb_user_agreement); |
| | | et_verfication_code = findViewById(R.id.et_verfication_code); |
| | | tv_title = findViewById(R.id.tv_title); |
| | | tv_confirm = findViewById(R.id.tv_confirm); |
| | | |
| | | tv_login_onekey.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); //下划线 |
| | | tv_login_onekey.getPaint().setAntiAlias(true);//抗锯齿 |
| | | |
| | | |
| | | tv_obtain_verfication_code.setOnClickListener(this); |
| | | tv_login_onekey.setOnClickListener(this); |
| | | findViewById(R.id.tv_confirm).setOnClickListener(this); |
| | | tv_confirm.setOnClickListener(this); |
| | | findViewById(R.id.tv_back).setOnClickListener(this); |
| | | findViewById(R.id.tv_user_agreement).setOnClickListener(this); |
| | | findViewById(R.id.tv_privacy_policy).setOnClickListener(this); |
| | |
| | | initView(); |
| | | login = getIntent().getBooleanExtra("login", false); |
| | | tv_title.setText(login ? "登录" : "绑定手机号"); |
| | | tv_confirm.setText(login ? "登录" : "绑定"); |
| | | |
| | | if (login) { |
| | | tv_login_onekey.setVisibility(View.GONE); |
| | | } |
| | | |
| | | openOneKeyLogin(false); |
| | | |
| | | if (!login) { |
| | | openOneKeyLogin(false); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | break; |
| | | } |
| | | tv_obtain_verfication_code.setEnabled(false); |
| | | sendBindVerifyCode(phone); |
| | | if (login) { |
| | | sendLoginVerifyCode(phone); |
| | | } else { |
| | | sendBindVerifyCode(phone); |
| | | } |
| | | break; |
| | | |
| | | |
| | |
| | | SingleToast.showToast(this, "验证码不能为空"); |
| | | return; |
| | | } |
| | | bindPhone(null); |
| | | if (login) { |
| | | phoneLogin(); |
| | | } else { |
| | | bindPhone(null); |
| | | } |
| | | break; |
| | | |
| | | case R.id.tv_login_onekey: |
| | |
| | | }); |
| | | } |
| | | |
| | | private void sendLoginVerifyCode(String phone) { |
| | | timer = new Timer(); |
| | | timer.schedule(new PhoneLoginActivity.MyTask(), 1000, 1000); |
| | | String loginUid = UserUtil.getLoginUid(this); |
| | | BeibeiVideoAPI.sendLoginVerifyCode(PhoneLoginActivity.this, phone, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject.optBoolean("IsPost")) { |
| | | SingleToast.showToast(PhoneLoginActivity.this, "验证码发送成功,请注意查收"); |
| | | } else { |
| | | SingleToast.showToast(PhoneLoginActivity.this, "获取验证码失败,请重新获取!"); |
| | | handler.sendEmptyMessage(1); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFinish() { |
| | | super.onFinish(); |
| | | tv_obtain_verfication_code.setEnabled(true); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | private void bindPhone(String accessToken) { |
| | | String loginUid = UserUtil.getLoginUid(this); |
| | |
| | | public void onFinish() { |
| | | super.onFinish(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | mPhoneNumberAuthHelper.quitLoginPage(); |
| | | if (mPhoneNumberAuthHelper != null) { |
| | | mPhoneNumberAuthHelper.quitLoginPage(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | private void phoneLogin() { |
| | | String phone = (et_phone.getText() + "").trim(); |
| | | String code = (et_verfication_code.getText() + "").trim(); |
| | | BeibeiVideoAPI.phoneLogin(this, phone, code, new BasicTextHttpResponseHandler() { |
| | | |
| | | @Override |
| | | public void onStart() { |
| | | super.onStart(); |
| | | DialogUtil.show(loadingDialog); |
| | | } |
| | | |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject.optBoolean("IsPost")) { |
| | | JSONObject user = jsonObject.optJSONObject("Data"); |
| | | |
| | | SharedPreferences.Editor edit = getSharedPreferences("user", |
| | | Context.MODE_PRIVATE).edit(); |
| | | edit.putString("portrait", user.optString("Portrait")); |
| | | edit.putString("LoginUid", |
| | | user.optString("Id")); |
| | | edit.putString("name", |
| | | user.optString("Nickname")); |
| | | edit.commit(); |
| | | //绑定成功 |
| | | Toast.makeText(PhoneLoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show(); |
| | | PhoneLoginActivity.this.finish(); |
| | | } else { |
| | | Toast.makeText(PhoneLoginActivity.this, jsonObject.optString("Error"), Toast.LENGTH_SHORT).show(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFinish() { |
| | | super.onFinish(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | } |
| | | }); |
| | | |
| | |
| | | @Override |
| | | public void onSignIn() { |
| | | if (!UserUtil.isLogin(BeibeiVideoApplication.application)) { |
| | | startActivityForResult(new Intent(BeibeiVideoApplication.application, LoginActivity.class).putExtra("result", true), 20001); |
| | | // startActivityForResult(new Intent(BeibeiVideoApplication.application, LoginActivity.class).putExtra("result", true), 20001); |
| | | UserUtil.toLogin(BeibeiVideoApplication.application); |
| | | return; |
| | | } |
| | | signIn(); |
| | |
| | | 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; |
| | |
| | | if (isLogin) {// 登录后 逻辑 |
| | | intent.setClass(MainActivity.this, PersonInfoActivity.class); |
| | | } else {// 登录前 |
| | | intent.setClass(MainActivity.this, LoginActivity.class); |
| | | UserUtil.toLogin(MainActivity.this); |
| | | return; |
| | | } |
| | | startActivity(intent); |
| | | break; |
| | |
| | | if (isLogin) {// 登录后 逻辑 |
| | | intent.setClass(tv_no_network.getContext(), PersonInfoActivity.class); |
| | | } else {// 登录前 |
| | | intent.setClass(tv_no_network.getContext(), LoginActivity.class); |
| | | |
| | | UserUtil.toLogin(tv_no_network.getContext()); |
| | | return; |
| | | } |
| | | startActivity(intent); |
| | | break; |
| | |
| | | |
| | | case R.id.tv_vip_open: |
| | | if (!UserUtil.isLogin(tv_no_network.getContext())) { |
| | | startActivity(new Intent(tv_no_network.getContext(), LoginActivity.class)); |
| | | UserUtil.toLogin(tv_no_network.getContext()); |
| | | return; |
| | | } |
| | | String url = ConfigUtil.getVipLink(tv_no_network.getContext()); |
| | |
| | | String loginid = sp.getString("LoginUid", ""); |
| | | if (StringUtils.isEmpty(loginid)) { |
| | | Toast.makeText(ll_add_attention.getContext(), "登录成功后才能进行关注!", Toast.LENGTH_LONG).show(); |
| | | getContext().startActivity(new Intent(ll_add_attention.getContext(), LoginActivity.class)); |
| | | UserUtil.toLogin(ll_add_attention.getContext()); |
| | | return; |
| | | } |
| | | if (mVideoInfo.getAttention().isAttention()) {//取消关注 |
| | |
| | | final String loginUid = preferences.getString("LoginUid", ""); |
| | | if (StringUtils.isEmpty(loginUid)) { |
| | | SingleToast.showToast(ll_add_attention.getContext(), "登录后才能收藏"); |
| | | startActivity(new Intent(ll_add_attention.getContext(), LoginActivity.class)); |
| | | UserUtil.toLogin(ll_add_attention.getContext()); |
| | | break; |
| | | } |
| | | String uid = preferences.getString("uid", ""); |
| | |
| | | import com.bytedance.sdk.openadsdk.TTAdSdk; |
| | | import com.bytedance.sdk.openadsdk.TTFullScreenVideoAd; |
| | | import com.bytedance.sdk.openadsdk.TTNativeExpressAd; |
| | | import com.funshion.video.parser.FunshionWebPlayerFragment; |
| | | import com.google.gson.FieldNamingPolicy; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | |
| | | } |
| | | |
| | | } else if (playUrl.getResource().getName().contains("风行")) { |
| | | |
| | | if (playUrl.getPlayType() == 0) { |
| | | Toast.makeText(VideoDetailActivity2.this, "此节目不可播!", |
| | | Toast.LENGTH_LONG).show(); |
| | |
| | | } else if (playUrl.getPlayType() == 2) {//SDK播放 |
| | | //播放风行视频 |
| | | //添加风行播放页 |
| | | mFunshionPlayerFragment = new FunshionPlayerFragment(); |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putSerializable("videoInfo", videoInfo); |
| | | bundle.putSerializable("playUrl", playUrl); |
| | | bundle.putInt("position", mPosition); |
| | | bundle.putBoolean("collect", false); |
| | | bundle.putSerializable("resource", resource); |
| | | mFunshionPlayerFragment.setArguments(bundle); |
| | | if (!mFunshionPlayerFragment.isAdded()) { |
| | | getSupportFragmentManager().beginTransaction().replace(R.id.fragment_video_play_container, mFunshionPlayerFragment).commit(); |
| | | } |
| | | fl_video_play_background.setVisibility(View.GONE); |
| | | // mFunshionPlayerFragment = new FunshionPlayerFragment(); |
| | | // Bundle bundle = new Bundle(); |
| | | // bundle.putSerializable("videoInfo", videoInfo); |
| | | // bundle.putSerializable("playUrl", playUrl); |
| | | // bundle.putInt("position", mPosition); |
| | | // bundle.putBoolean("collect", false); |
| | | // bundle.putSerializable("resource", resource); |
| | | // mFunshionPlayerFragment.setArguments(bundle); |
| | | // if (!mFunshionPlayerFragment.isAdded()) { |
| | | // getSupportFragmentManager().beginTransaction().replace(R.id.fragment_video_play_container, mFunshionPlayerFragment).commit(); |
| | | // } |
| | | // fl_video_play_background.setVisibility(View.GONE); |
| | | |
| | | |
| | | // 风行网页播放器 |
| | | // iv_select_play.setVisibility(View.GONE); |
| | | // iv_background.setClickable(false); |
| | | // hideImage(); |
| | | // getSupportFragmentManager().beginTransaction().replace(R.id.fragment_video_play_container, new FunshionWebPlayerFragment("测试标题", "http://www.fun.tv/vplay/g-1018345/")).commit(); |
| | | // return; |
| | | } |
| | | |
| | | } else { |
| | |
| | | Log.i(TAG, "clickBack"); |
| | | setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); |
| | | findViewById(R.id.fl_video_detail).setVisibility(View.VISIBLE); |
| | | fl_video_play_background.setVisibility(View.VISIBLE); |
| | | iv_select_play.setVisibility(View.VISIBLE); |
| | | |
| | | // fl_video_play_background.setVisibility(View.VISIBLE); |
| | | // iv_select_play.setVisibility(View.VISIBLE); |
| | | try { |
| | | Glide.with(getApplicationContext()).load(R.drawable.ic_select_play) |
| | | .into(iv_select_play); |
| | |
| | | (int) ((SystemCommon.getScreenWidth(this) * 9) / 16)); |
| | | findViewById(R.id.fragment_video_play_container1).setLayoutParams( |
| | | params); |
| | | |
| | | if (playUrl != null && playUrl.getResource().getName().contains("爱奇艺")) { |
| | | iv_background.setClickable(true); |
| | | if (mIQYVideoPlayerFragment != null) |
| | |
| | | if (newConfig == null) |
| | | return; |
| | | if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {//横屏 |
| | | tv_back.setVisibility(View.GONE); |
| | | findViewById(R.id.fl_video_detail).setVisibility(View.GONE); |
| | | findViewById(R.id.v_status_bar).setVisibility(View.GONE); |
| | | ViewGroup.LayoutParams params1 = findViewById(R.id.v_status_bar).getLayoutParams(); |
| | |
| | | if (mFunshionPlayerFragment != null) |
| | | mFunshionPlayerFragment.requestLayout(); |
| | | } else { |
| | | tv_back.setVisibility(View.VISIBLE); |
| | | findViewById(R.id.v_status_bar).setVisibility(View.VISIBLE); |
| | | findViewById(R.id.fl_video_detail).setVisibility(View.VISIBLE); |
| | | ViewGroup.LayoutParams params1 = findViewById(R.id.v_status_bar).getLayoutParams(); |
| | |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.login.LoginActivity; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | |
| | | * 登录 |
| | | */ |
| | | private void setLogin() { |
| | | mContext.startActivity(new Intent(mContext, LoginActivity.class)); |
| | | UserUtil.toLogin(mContext); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.weikou.beibeivideo.ui.discover.GoodsFavouriteAdapter; |
| | | import com.weikou.beibeivideo.ui.login.LoginActivity; |
| | | import com.weikou.beibeivideo.util.JsonUtil; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | import com.weikou.beibeivideo.widget.MySwipeRefreshLayout; |
| | | |
| | |
| | | final String loginUid = preferences.getString("LoginUid", ""); |
| | | if (StringUtils.isEmpty(loginUid)) { |
| | | SingleToast.showToast(MyFavouriteActivity.this, "登录后才能收藏"); |
| | | startActivity(new Intent(MyFavouriteActivity.this, LoginActivity.class)); |
| | | UserUtil.toLogin(MyFavouriteActivity.this); |
| | | return; |
| | | } |
| | | deleteCollect(loginUid); |
| | |
| | | |
| | | if (view.getTag() == null) { |
| | | ViewHolder holder = new ViewHolder(); |
| | | holder.iv_cover = (ImageView) view.findViewById(R.id.iv_cover); |
| | | holder.tv_title = (TextView) view.findViewById(R.id.tv_title); |
| | | holder.tv_watch_time = (TextView) view.findViewById(R.id.tv_watch_time); |
| | | holder.btn_delete = (ImageButton) view |
| | | holder.iv_cover = view.findViewById(R.id.iv_cover); |
| | | holder.tv_title = view.findViewById(R.id.tv_title); |
| | | holder.tv_watch_time = view.findViewById(R.id.tv_watch_time); |
| | | holder.btn_delete = view |
| | | .findViewById(R.id.btn_delete_download); |
| | | holder.chb_delete = (CheckBox) view.findViewById(R.id.chb_delete); |
| | | holder.fl_video_select = (FrameLayout) view |
| | | holder.chb_delete = view.findViewById(R.id.chb_delete); |
| | | holder.fl_video_select = view |
| | | .findViewById(R.id.fl_video_select); |
| | | holder.rl_picture = view |
| | | .findViewById(R.id.rl_picture); |
| | |
| | | } |
| | | |
| | | |
| | | public static void saveOnLining(Context context, boolean content) { |
| | | saveConfig("onLining", content+"", context); |
| | | } |
| | | |
| | | |
| | | public static boolean isOnLining(Context context) { |
| | | String onLine= getConfig("onLining", context); |
| | | if(StringUtils.isEmpty(onLine)){ |
| | | return false; |
| | | } |
| | | return Boolean.parseBoolean(onLine); |
| | | } |
| | | |
| | | |
| | | private static void saveConfig(String key, String value, Context context) { |
| | | SharedPreferences.Editor editor = context.getSharedPreferences("config", Context.MODE_PRIVATE).edit(); |
| | | editor.putString(key, value); |
| | |
| | | package com.weikou.beibeivideo.util; |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.content.SharedPreferences; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.umeng.commonsdk.debug.I; |
| | | import com.weikou.beibeivideo.BasicTextHttpResponseHandler; |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.entity.UserInfo; |
| | | import com.weikou.beibeivideo.entity.vo.UserInfoVO; |
| | | import com.weikou.beibeivideo.ui.login.LoginActivity; |
| | | import com.weikou.beibeivideo.ui.login.PhoneLoginActivity; |
| | | import com.weikou.beibeivideo.ui.mine.MyFavouriteActivity; |
| | | import com.weikou.beibeivideo.util.downutil.StringUtils; |
| | | |
| | | import org.apache.http.Header; |
| | |
| | | return true; |
| | | } |
| | | |
| | | public static void toLogin(Context context){ |
| | | Intent intent=new Intent(context, LoginActivity.class); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | context.startActivity(intent); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @JavascriptInterface |
| | | public void login() { |
| | | Intent intent = new Intent(mContext, LoginActivity.class); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | mContext.startActivity(intent); |
| | | UserUtil.toLogin(mContext); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | |
| | | |
| | | @JavascriptInterface |
| | | public void jumpWeb() { |
| | | Intent intent = new Intent(mContext, LoginActivity.class); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | mContext.startActivity(intent); |
| | | |
| | | } |
| | | |
| | | /** |