Przeglądaj źródła

视频播放功能完善

zengjiebin 7 lat temu
rodzic
commit
d8ad94af86

+ 2 - 0
app/src/main/AndroidManifest.xml

@@ -432,6 +432,8 @@
             android:name="com.sheep.gamegroup.view.activity.MiddleScreenShotAct"
             android:screenOrientation="user"
             android:theme="@style/MyDialogActivityTheme" />
+        <activity android:name="com.sheep.gamegroup.view.activity.ActPlayVideo"
+            android:screenOrientation="user" />
 
         <!-- 友盟start -->
         <meta-data

+ 6 - 0
app/src/main/java/com/sheep/gamegroup/util/GlideImageLoader.java

@@ -46,6 +46,12 @@ public class GlideImageLoader {
                 .load(url)
                 .into(imageView);
     }
+    public static void setImage(ImageView imageView, String url, int id) {
+        Glide.with(SheepApp.getInstance())
+                .load(url)
+                .apply(new RequestOptions().placeholder(id))
+                .into(imageView);
+    }
     public static void setImageDisHardConfig(ImageView imageView, String url) {
         Glide.with(SheepApp.getInstance())
                 .load(url)

+ 11 - 0
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -72,6 +72,7 @@ import com.sheep.gamegroup.view.activity.ActPay;
 import com.sheep.gamegroup.view.activity.ActPlayGameList;
 import com.sheep.gamegroup.view.activity.ActPlayGameRecommendList;
 import com.sheep.gamegroup.view.activity.ActPlayGameUserLikeList;
+import com.sheep.gamegroup.view.activity.ActPlayVideo;
 import com.sheep.gamegroup.view.activity.ActReservation;
 import com.sheep.gamegroup.view.activity.ActSearchApp;
 import com.sheep.gamegroup.view.activity.ActSearchAppOrTask;
@@ -2194,4 +2195,14 @@ public class Jump2View {
                 break;
         }
     }
+
+    /**
+     * 播放视频
+     *
+     * @param url 播放地址
+     */
+    public void goActPlayVideo(String url) {
+        Activity activity = ActivityManager.getInstance().currentActivity();
+        activity.startActivity(DataUtil.putObject(new Intent(activity, ActPlayVideo.class), url));
+    }
 }

+ 49 - 28
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -18,7 +18,6 @@ import android.media.MediaPlayer;
 import android.net.Uri;
 import android.os.Build;
 import android.provider.MediaStore;
-import android.support.v4.app.ActivityOptionsCompat;
 import android.support.v4.app.FragmentActivity;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.widget.GridLayoutManager;
@@ -54,7 +53,6 @@ import com.jcodecraeer.xrecyclerview.XRecyclerView;
 import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.mdad.sdk.mdsdk.common.AdData;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
-import com.sheep.gamegroup.absBase.IContentContainer;
 import com.sheep.gamegroup.absBase.IContentTypeContainer;
 import com.sheep.gamegroup.absBase.ITag;
 import com.sheep.gamegroup.dateview.DatePickerDialog;
@@ -64,7 +62,6 @@ import com.sheep.gamegroup.model.entity.Container;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.GameAccountEntity;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
-import com.sheep.gamegroup.model.entity.HomeListEntity;
 import com.sheep.gamegroup.model.entity.PayEntity;
 import com.sheep.gamegroup.model.entity.RobTask;
 import com.sheep.gamegroup.model.entity.TaskEty;
@@ -85,7 +82,6 @@ import com.sheep.gamegroup.view.fragment.FgtPersonalCenter;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.ui.activity.PlayVideoActivity;
 import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
@@ -1457,6 +1453,15 @@ public class ViewUtil {
         }
     }
 
+    public static void setImageLoading(ImageView imageView, String pictures) {
+        if (imageView != null && !TextUtils.isEmpty(pictures)) {
+            if (pictures.contains(";")) {
+                pictures = pictures.split(";")[0];
+            }
+            GlideImageLoader.setImage(imageView, pictures, R.drawable.loading_01);
+        }
+    }
+
     public static void setImage(ImageView imageView, String pictures, int radius) {
         if (imageView != null && !TextUtils.isEmpty(pictures)) {
             if (pictures.contains(";")) {
@@ -1501,8 +1506,9 @@ public class ViewUtil {
             textView.setText(TextUtils.isEmpty(msg) ? "" : msg);
         }
     }
+
     public static void setText(TextView textView, IContentTypeContainer<Integer, String> contentTypeContainer) {
-        switch (contentTypeContainer.getContentType()){
+        switch (contentTypeContainer.getContentType()) {
             case StringUtils.CONTENT_TYPE_FONT:
                 setText(textView, contentTypeContainer.getContentResult());
                 break;
@@ -1527,50 +1533,65 @@ public class ViewUtil {
         }
     }
 
-    public static void setVideoAndFull(final VideoView videoView, View fullView, final View loading, String url) {
-        if (videoView == null || url == null) {
+    /**
+     * 设置视频播放和播放按钮与占位图
+     * @param videoView
+     * @param placeHolderlView 占位图片
+     * @param control 控制播放的按钮
+     * @param url
+     */
+    public static void setVideoAndFull(final VideoView videoView, final ImageView placeHolderlView, final ImageView control, final String url) {
+        if (videoView == null || control == null || url == null) {
             return;
         }
-        final Activity activity = ActivityManager.getInstance().currentActivity();
-        videoView.setVideoURI(Uri.parse(url));
-        videoView.setOnClickListener(new View.OnClickListener() {
+        View.OnClickListener onClickListener = new View.OnClickListener() {
             @Override
             public void onClick(View v) {
+                videoView.setVisibility(View.VISIBLE);
+                placeHolderlView.setVisibility(View.INVISIBLE);
                 if (videoView.isPlaying()) {
                     videoView.pause();
+                    control.setImageResource(R.drawable.ic_play_but_image);
                 } else if (!videoView.isPlaying()) {
                     videoView.start();
+                    control.setImageResource(R.drawable.loading_01);
                 }
             }
-        });
+        };
+        control.setOnClickListener(onClickListener);
+        videoView.setOnClickListener(onClickListener);
         videoView.setOnInfoListener(new MediaPlayer.OnInfoListener() {
             @Override
             public boolean onInfo(MediaPlayer mediaPlayer, int what, int extra) {
-                if(!mediaPlayer.isLooping())
+                LogUtil.println("setVideoAndFull", "onInfo what = " + what + " extra = " + extra);
+                if (!mediaPlayer.isLooping())
                     mediaPlayer.setLooping(true);
-                LogUtil.println("onInfo what = " + what + " extra = " + extra);
-                if(MediaPlayer.MEDIA_INFO_BUFFERING_START == what){
-                    if(loading != null)
-                        loading.setVisibility(View.GONE);
-//                        btnJoin.setVisibility(View.GONE);
+                switch (what) {
+                    case MediaPlayer.MEDIA_INFO_BUFFERING_START:
+                        LogUtil.println("setVideoAndFull", "onInfo", "正在缓冲");
+                        control.setImageResource(R.drawable.loading_01);
+                        control.setVisibility(View.VISIBLE);
+                        break;
+                    case MediaPlayer.MEDIA_INFO_BUFFERING_END:
+                    case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
+                        LogUtil.println("setVideoAndFull", "onInfo", "缓冲完成");
+                        //缓存完成,继续播放
+                        control.setVisibility(View.GONE);
+                        break;
                 }
                 return false;
             }
         });
-        Uri uri = Uri.parse(url);
-        videoView.setVideoURI(uri);
-        videoView.start();
-        videoView.requestFocus();
-        if (fullView == null) {
-            return;
-        }
-        fullView.setOnClickListener(new View.OnClickListener() {
+        videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
             @Override
-            public void onClick(View v) {
-                activity.startActivity(new Intent(activity, PlayVideoActivity.class),
-                        ActivityOptionsCompat.makeSceneTransitionAnimation(activity, videoView, "video").toBundle());
+            public void onPrepared(MediaPlayer mediaPlayer) {
+                LogUtil.println("setVideoAndFull", "onPrepared");
+                if (placeHolderlView != null)
+                    placeHolderlView.setVisibility(View.GONE);
             }
         });
+        Uri uri = Uri.parse(url);
+        videoView.setVideoURI(uri);
     }
 
     public static void setTextRetainMost2(TextView textView, float f) {

+ 347 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActPlayVideo.java

@@ -0,0 +1,347 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.content.Context;
+import android.media.AudioManager;
+import android.media.MediaPlayer;
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.GestureDetector;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.ImageView;
+import android.widget.VideoView;
+
+import com.kfzs.duanduan.utils.StatusBarUtils;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.LogUtil;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import butterknife.BindView;
+
+/**
+ * Created by realicing on 2018/11/9.
+ * realicing@sina.com
+ * 视频播放
+ */
+public class ActPlayVideo extends BaseActivity implements MediaPlayer.OnInfoListener, MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener, MediaPlayer.OnCompletionListener, View.OnLayoutChangeListener {
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        StatusBarUtils.setTranslucent(this);
+        super.onCreate(savedInstanceState);
+    }
+
+    @BindView(R.id.videoView)
+    VideoView videoView;
+    @BindView(R.id.play_or_pause)
+    ImageView play_or_pause;
+    @BindView(R.id.video_loading)
+    View video_loading;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_play_video;
+    }
+
+    @Override
+    public void initView() {
+        initVolume();
+        String url = DataUtil.getObject(getIntent(), String.class);
+        Uri uri = Uri.parse(url);
+        videoView.setOnInfoListener(this);
+        videoView.setOnPreparedListener(this);
+        videoView.setOnErrorListener(this);
+        videoView.setOnCompletionListener(this);
+        videoView.addOnLayoutChangeListener(this);
+        videoView.setVideoURI(uri);
+    }
+
+    @Override
+    public void initListener() {
+        mGestureDetector = new GestureDetector(getApplicationContext(), mGestureListener);
+        View.OnTouchListener listener = new View.OnTouchListener() {
+            @Override
+            public boolean onTouch(View v, MotionEvent event) {
+                return onTouchEvent(event);
+            }
+        };
+        videoView.setOnTouchListener(listener);
+    }
+    private GestureDetector mGestureDetector;
+
+    private boolean isPlaying;
+    //播放或者暂停
+    private void playOrPause() {
+        if(isPlaying){
+            pause();
+        } else {
+            play();
+        }
+    }
+    //播放
+    private void play(){
+        if(videoView == null){
+            return;
+        }
+        play_or_pause.setVisibility(View.GONE);
+        videoView.start();
+        isPlaying = true;
+    }
+    //暂停
+    private void pause(){
+        if(videoView == null){
+            return;
+        }
+        play_or_pause.setVisibility(View.VISIBLE);
+        videoView.pause();
+        isPlaying = false;
+    }
+    //销毁
+    private void destroy(){
+        if(videoView == null){
+            return;
+        }
+        play_or_pause.setVisibility(View.VISIBLE);
+        videoView.stopPlayback();
+        isPlaying = false;
+    }
+
+
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        return mGestureDetector.onTouchEvent(event);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if(!isPauseByUser)
+            play();
+    }
+    //是否是用户手机暂停
+    private boolean isPauseByUser;
+    @Override
+    protected void onPause() {
+        super.onPause();
+        if(isPlaying)
+            isPauseByUser = false;
+        pause();
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        destroy();
+    }
+
+//    //滑动方向
+//    private int direction = 0;
+//    //左右滑动
+//    public static final int DIRECTION_LEFT_RIGHT = 1;
+//    //上下滑动
+//    public static final int DIRECTION_TOP_BOTTOM = 2;
+    private GestureDetector.SimpleOnGestureListener mGestureListener = new GestureDetector.SimpleOnGestureListener() {
+        @Override
+        public boolean onDown(MotionEvent e) {
+            LogUtil.println("mGestureListener", "onDown");
+//            direction = 0;
+            return super.onDown(e);
+        }
+
+        @Override
+        public void onLongPress(MotionEvent e) {
+            LogUtil.println("mGestureListener", "onLongPress");
+            super.onLongPress(e);
+        }
+
+        @Override
+        public boolean onSingleTapConfirmed(MotionEvent e) {
+            LogUtil.println("mGestureListener", "onSingleTapConfirmed");
+            if(isPlaying)
+                isPauseByUser = true;
+            playOrPause();
+            return super.onSingleTapConfirmed(e);
+        }
+        @Override
+        public boolean onScroll(MotionEvent e1, MotionEvent e2,
+                                float distanceX, float distanceY) {
+            float mOldX = e1.getX(), mOldY = e1.getY();
+            int y = (int) e2.getRawY();
+            int windowWidth = ActPlayVideo.this.windowWidth;
+            int windowHeight = ActPlayVideo.this.windowHeight;
+            int lineMiddle = windowWidth / 2;
+            if (mOldX > lineMiddle)// 左边滑动
+                onBrightnessSlide((mOldY - y) / windowHeight);
+            else if (mOldX < lineMiddle)// 右边滑动
+                onVolumeSlide((mOldY - y) / windowHeight);
+            return super.onScroll(e1, e2, distanceX, distanceY);
+        }
+
+
+//        @Override
+//        public boolean onScroll(MotionEvent event1, MotionEvent event2, float distanceX, float distanceY) {
+//            LogUtil.println("mGestureListener", distanceX, distanceY);
+//            if (event1 == null || event2 == null) {
+//                return super.onScroll(event1, event2, distanceX, distanceY);
+//            }
+//            if (direction == 0) {
+//                float a = Math.abs(distanceY);
+//                float b = Math.abs(distanceX);
+//                if (a > b) {
+//                    LogUtil.println("mGestureListener", "上下滑动");
+//                    direction = DIRECTION_TOP_BOTTOM;
+//                } else if (b > a) {
+//                    LogUtil.println("mGestureListener", "左右滑动");
+//                    direction = DIRECTION_LEFT_RIGHT;
+//                }
+//            }
+//            return super.onScroll(event1, event2, distanceX, distanceY);
+//        }
+//
+//        @Override
+//        public boolean onFling(MotionEvent event1, MotionEvent event2, float velocityX, float velocityY) {
+//            LogUtil.println("mGestureListener", velocityX, velocityY);
+//            if (event1 == null || event2 == null) {
+//                return super.onFling(event1, event2, velocityX, velocityY);
+//            }
+//            final int FLING_MIN_DISTANCE = 100, FLING_MIN_VELOCITY = 200;
+//            if (event1.getX() - event2.getX() > FLING_MIN_DISTANCE
+//                    && Math.abs(velocityX) > FLING_MIN_VELOCITY) {
+//                // Fling left
+//                LogUtil.println("mGestureListener", "Fling left");
+//                //音量增益减
+//            } else if (event2.getX() - event1.getX() > FLING_MIN_DISTANCE
+//                    && Math.abs(velocityX) > FLING_MIN_VELOCITY) {
+//                // Fling right
+//                LogUtil.println("mGestureListener", "Fling rigth");
+//                //音量增益加
+//            } else if (event2.getY() - event1.getY() > FLING_MIN_DISTANCE
+//                    && Math.abs(velocityY) > FLING_MIN_VELOCITY) {
+//                if (direction == DIRECTION_LEFT_RIGHT) {
+//                    // Fling down
+//                    LogUtil.println("mGestureListener", "Fling down");
+//                    //频道减
+//                }
+//            } else if (event1.getY() - event2.getY() > FLING_MIN_DISTANCE
+//                    && Math.abs(velocityY) > FLING_MIN_VELOCITY) {
+//                if (direction == DIRECTION_LEFT_RIGHT) {
+//                    // Fling up
+//                    LogUtil.println("mGestureListener", "Fling up");
+//                    //频道加
+//                }
+//            }
+////            return super.onFling(event1, event2, velocityX, velocityY);
+//            return false;
+//        }
+    };
+    private AudioManager mAudioManager;
+    private int mMaxVolume;//最大音量
+    private int mVolume;//当前音量
+    private void initVolume(){
+        mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
+        if(mAudioManager != null)
+            mMaxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
+    }
+    //滑动改变音量
+    private void onVolumeSlide(float percent) {
+        if (mVolume == -1) {
+            mVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
+            if (mVolume < 0)
+                mVolume = 0;
+
+            // 显示
+//                mOperationBg.setImageResource(R.drawable.video_volumn_bg);
+//                mVolumeBrightnessLayout.setVisibility(View.VISIBLE);
+        }
+
+        int index = (int) (percent * mMaxVolume) + mVolume;
+        if (index > mMaxVolume)
+            index = mMaxVolume;
+        else if (index < 0)
+            index = 0;
+
+        // 变更声音
+        mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, index, 0);
+        // 变更进度条
+//            ViewGroup.LayoutParams lp = mOperationPercent.getLayoutParams();
+//            lp.width = findViewById(R.id.operation_full).getLayoutParams().width * index / mMaxVolume;
+//            mOperationPercent.setLayoutParams(lp);
+    }
+    private float mBrightness = -1;
+    //滑动改变亮度
+    private void onBrightnessSlide(float percent) {
+        if (mBrightness < 0) {
+            mBrightness = getWindow().getAttributes().screenBrightness;
+            if (mBrightness <= 0.00f)
+                mBrightness = 0.50f;
+            if (mBrightness < 0.01f)
+                mBrightness = 0.01f;
+
+            // 显示
+//                mOperationBg.setImageResource(R.drawable.video_brightness_bg);
+//                mVolumeBrightnessLayout.setVisibility(View.VISIBLE);
+        }
+        WindowManager.LayoutParams lpa = getWindow().getAttributes();
+        lpa.screenBrightness = mBrightness + percent;
+        if (lpa.screenBrightness > 1.0f)
+            lpa.screenBrightness = 1.0f;
+        else if (lpa.screenBrightness < 0.01f)
+            lpa.screenBrightness = 0.01f;
+        getWindow().setAttributes(lpa);
+
+//            ViewGroup.LayoutParams lp = mOperationPercent.getLayoutParams();
+//            lp.width = (int) (findViewById(R.id.operation_full).getLayoutParams().width * lpa.screenBrightness);
+//            mOperationPercent.setLayoutParams(lp);
+    }
+    @Override
+    public boolean onInfo(MediaPlayer mediaPlayer, int what, int extra) {
+        LogUtil.println("ActPlayVideo", "onInfo what = " + what + " extra = " + extra);
+        if (!mediaPlayer.isLooping())
+            mediaPlayer.setLooping(true);
+        switch (what) {
+            case MediaPlayer.MEDIA_INFO_BUFFERING_START:
+                LogUtil.println("ActPlayVideo", "onInfo", "正在缓冲");
+                if(video_loading != null)
+                    video_loading.setVisibility(View.VISIBLE);
+                break;
+            case MediaPlayer.MEDIA_INFO_BUFFERING_END:
+            case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
+                LogUtil.println("ActPlayVideo", "onInfo", "缓冲完成");
+                //缓存完成,继续播放
+                if(video_loading != null)
+                    video_loading.setVisibility(View.GONE);
+                break;
+        }
+        return false;
+    }
+    @Override
+    public void onPrepared(MediaPlayer mediaPlayer) {
+        LogUtil.println("ActPlayVideo", "onPrepared");
+        if(video_loading != null)
+            video_loading.setVisibility(View.GONE);
+    }
+
+    @Override
+    public boolean onError(MediaPlayer mediaPlayer, int what, int extra) {
+        LogUtil.println("ActPlayVideo", "onInfo what = " + what + " extra = " + extra);
+        return false;
+    }
+
+    @Override
+    public void onCompletion(MediaPlayer mediaPlayer) {
+        LogUtil.println("ActPlayVideo", "onCompletion");
+    }
+
+    private int windowWidth = G.WIDTH;
+    private int windowHeight = G.HEIGHT;
+    @Override
+    public void onLayoutChange(View view, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
+        LogUtil.println("ActPlayVideo", "onLayoutChange", left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom);
+        this.windowWidth = left + right;
+        this.windowHeight = top + bottom;
+    }
+}

+ 15 - 12
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpNoviceGuidance.java

@@ -1,21 +1,19 @@
 package com.sheep.gamegroup.view.adapter;
 
-import android.app.Activity;
 import android.content.Context;
-import android.content.Intent;
-import android.support.v4.app.ActivityOptionsCompat;
 import android.text.TextUtils;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
+import android.widget.VideoView;
 
 import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
 import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
 import com.sheep.gamegroup.model.entity.NoviceGuidance;
-import com.sheep.gamegroup.util.ActivityManager;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.ui.activity.PlayVideoActivity;
 
 import java.util.List;
 
@@ -29,16 +27,18 @@ public class AdpNoviceGuidance extends RecyclerViewAdapter<NoviceGuidance> {
     }
 
     @Override
-    public void convert(ViewHolder viewHolder, NoviceGuidance item, int position) {
+    public void convert(ViewHolder viewHolder, final NoviceGuidance item, int position) {
         TextView item_novice_guidance_title = viewHolder.itemView.findViewById(R.id.item_novice_guidance_title);
 //        VideoView item_novice_guidance_video = viewHolder.itemView.findViewById(R.id.item_novice_guidance_video);
         final ImageView item_novice_guidance_video_image = viewHolder.itemView.findViewById(R.id.item_novice_guidance_video_image);
+//        final ImageView item_novice_guidance_video_control = viewHolder.itemView.findViewById(R.id.item_novice_guidance_video_control);
         final ImageView item_novice_guidance_video_full = viewHolder.itemView.findViewById(R.id.item_novice_guidance_video_full);
         TextView item_novice_guidance_content = viewHolder.itemView.findViewById(R.id.item_novice_guidance_content);
 
         ViewUtil.setVisibility(item_novice_guidance_title, !TextUtils.isEmpty(item.getTitle()));
         ViewUtil.setVisibility(item_novice_guidance_content, !TextUtils.isEmpty(item.getContent()));
 //        ViewUtil.setVisibility(item_novice_guidance_video, !TextUtils.isEmpty(item.getVideo_url()));
+//        ViewUtil.setVisibility(item_novice_guidance_video_control, !TextUtils.isEmpty(item.getVideo_url()));
         ViewUtil.setVisibility(item_novice_guidance_video_image, !TextUtils.isEmpty(item.getVideo_url()));
         ViewUtil.setVisibility(item_novice_guidance_video_full, !TextUtils.isEmpty(item.getVideo_url()));
 
@@ -46,16 +46,19 @@ public class AdpNoviceGuidance extends RecyclerViewAdapter<NoviceGuidance> {
         ViewUtil.setImage(item_novice_guidance_video_image, item.getVideo_url());
         ViewUtil.setText(item_novice_guidance_title, item.getTitle());
         ViewUtil.setText(item_novice_guidance_content, item);
-//        ViewUtil.setVideoAndFull(item_novice_guidance_video, item_novice_guidance_video_full, item_novice_guidance_loading, item.getVideo_url());
+//        ViewUtil.setVideoAndFull(item_novice_guidance_video, item_novice_guidance_video_image, item_novice_guidance_video_control, item.getVideo_url());
+//        item_novice_guidance_video_control.setOnClickListener(new View.OnClickListener() {
+//            @Override
+//            public void onClick(View v) {
+//                Jump2View.getInstance().goActPlayVideo(item.getVideo_url());
+//            }
+//        });
         item_novice_guidance_video_full.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                final Activity activity = ActivityManager.getInstance().currentActivity();
-                activity.startActivity(new Intent(activity, PlayVideoActivity.class),
-                        ActivityOptionsCompat.makeSceneTransitionAnimation(activity, item_novice_guidance_video_image, "video").toBundle());
+                Jump2View.getInstance().goActPlayVideo(item.getVideo_url());
             }
         });
-    }
 //        if(!viewHolderList.contains(viewHolder) && !TextUtils.isEmpty(item.getVideo_url()))
 //            viewHolderList.add(viewHolder);
 //    }
@@ -79,5 +82,5 @@ public class AdpNoviceGuidance extends RecyclerViewAdapter<NoviceGuidance> {
 //                item_novice_guidance_video.stopPlayback();
 //        }
 //        viewHolderList.clear();
-//    }
+    }
 }

+ 3 - 2
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPersonalCenter.java

@@ -17,6 +17,7 @@ import android.widget.PopupWindow;
 import android.widget.TextView;
 
 import com.bumptech.glide.Glide;
+import com.bumptech.glide.request.RequestOptions;
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.BaseViewHolder;
 import com.google.gson.Gson;
@@ -257,8 +258,8 @@ public class FgtPersonalCenter extends BaseFragment {
      */
     private void bindUserCenterModule(BaseViewHolder helper, final UserCenterModule item) {
         if (item.getDisplay() == 1) {
-            ViewUtil.updateTag((TextView) helper.getView(R.id.my_item_text), item);
-            helper.setVisible(R.id.my_item_tag, item.getTag() == 0);
+            helper.setText(R.id.my_item_text, item.getTitle());
+            ViewUtil.updateTag((TextView) helper.getView(R.id.my_item_tag), item);
             Glide.with(this).load(item.getIcon()).into((ImageView) helper.getView(R.id.my_item_img));
             helper.getView(R.id.my_item_but).setOnClickListener(new View.OnClickListener() {
                 @Override

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtUserNoviceGuidance.java

@@ -53,6 +53,7 @@ public class FgtUserNoviceGuidance extends BaseListFragment2<NoviceGuidance> {
             noviceGuidance = new NoviceGuidance();
             noviceGuidance.setContent(getString(R.string.new_nav_tips_title));
         }
+        list.clear();
         list.add(noviceGuidance);
         super.loadList(addList);
     }
@@ -61,7 +62,7 @@ public class FgtUserNoviceGuidance extends BaseListFragment2<NoviceGuidance> {
     protected Class<NoviceGuidance> getTClass() {
         return NoviceGuidance.class;
     }
-
+//
 //    @Override
 //    public void notifyDataSetChanged() {
 //        if(adapter != null){

+ 36 - 0
app/src/main/res/layout/act_play_video.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout 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">
+
+    <VideoView
+        android:id="@+id/videoView"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toTopOf="parent"/>
+
+    <ImageView
+        android:id="@+id/play_or_pause"
+        android:layout_width="51dp"
+        android:layout_height="51dp"
+        android:focusable="false"
+        android:focusableInTouchMode="false"
+        android:src="@drawable/ic_play_but_image"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <com.github.ybq.android.spinkit.SpinKitView
+        android:id="@+id/video_loading"
+        style="@style/SpinKitView.Large.ThreeBounce"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        app:SpinKit_Color="@color/colorAccent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+</android.support.constraint.ConstraintLayout>

+ 3 - 1
app/src/main/res/layout/fgt_personalcenter_layout.xml

@@ -34,9 +34,11 @@
                 android:id="@+id/my_module_list"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:background="@color/white"
+                android:paddingStart="5dp"
+                android:paddingEnd="5dp"
                 tools:layoutManager="android.support.v7.widget.GridLayoutManager"
                 tools:listitem="@layout/item_my_list_but"
-                android:background="@color/white"
                 tools:spanCount="4" />
 
         </LinearLayout>

+ 12 - 9
app/src/main/res/layout/item_my_list_but.xml

@@ -19,17 +19,20 @@
         <ImageView
             android:id="@+id/my_item_img"
             android:layout_width="match_parent"
-            android:paddingStart="16dp"
-            android:paddingEnd="16dp"
-            android:layout_height="wrap_content"
-            android:scaleType="fitXY"
-            android:adjustViewBounds="true" />
+            android:layout_height="0dp"
+            android:minHeight="56dp"
+            android:layout_weight="1"
+            android:paddingStart="20dp"
+            android:paddingEnd="20dp"
+            android:scaleType="fitCenter"
+            android:src="@drawable/icon" />
 
         <TextView
             android:id="@+id/my_item_text"
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="15dp"
+            android:layout_marginTop="10dp"
+            android:gravity="center"
             android:text="试玩赚钱"
             android:textColor="@color/black_6_3"
             android:textSize="14sp" />
@@ -37,9 +40,9 @@
 
     <TextView
         android:id="@+id/my_item_tag"
-        android:layout_width="35dp"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_toEndOf="@+id/my_item_img_text"
+        android:layout_alignEnd="@id/my_item_img_text"
         android:gravity="center"
         android:padding="2dp"
         android:text="试玩"

+ 23 - 10
app/src/main/res/layout/item_novice_guidance.xml

@@ -21,15 +21,16 @@
 
 
     <!--<VideoView-->
-        <!--android:id="@+id/item_novice_guidance_video"-->
-        <!--android:layout_width="match_parent"-->
-        <!--android:layout_height="140dp"-->
-        <!--android:layout_marginStart="16dp"-->
-        <!--android:layout_marginTop="16dp"-->
-        <!--android:layout_marginEnd="16dp"-->
-        <!--app:layout_constraintEnd_toEndOf="parent"-->
-        <!--app:layout_constraintStart_toStartOf="parent"-->
-        <!--app:layout_constraintTop_toBottomOf="@id/item_novice_guidance_title" />-->
+    <!--android:id="@+id/item_novice_guidance_video"-->
+    <!--android:layout_width="match_parent"-->
+    <!--android:layout_height="wrap_content"-->
+    <!--android:layout_marginStart="16dp"-->
+    <!--android:layout_marginTop="16dp"-->
+    <!--android:layout_marginEnd="16dp"-->
+    <!--app:layout_constraintEnd_toEndOf="parent"-->
+    <!--app:layout_constraintStart_toStartOf="parent"-->
+    <!--app:layout_constraintTop_toBottomOf="@id/item_novice_guidance_title" />-->
+
     <ImageView
         android:id="@+id/item_novice_guidance_video_image"
         android:layout_width="match_parent"
@@ -37,12 +38,24 @@
         android:layout_marginStart="16dp"
         android:layout_marginTop="16dp"
         android:layout_marginEnd="16dp"
-        android:scaleType="fitXY"
         android:adjustViewBounds="true"
+        android:minHeight="140dp"
+        android:scaleType="fitXY"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/item_novice_guidance_title" />
 
+    <!--<ImageView-->
+        <!--android:id="@+id/item_novice_guidance_video_control"-->
+        <!--android:layout_width="51dp"-->
+        <!--android:layout_height="51dp"-->
+        <!--android:padding="8dp"-->
+        <!--android:src="@drawable/ic_play_but_image"-->
+        <!--app:layout_constraintBottom_toBottomOf="@id/item_novice_guidance_video_image"-->
+        <!--app:layout_constraintEnd_toEndOf="@id/item_novice_guidance_video_image"-->
+        <!--app:layout_constraintStart_toStartOf="@id/item_novice_guidance_video_image"-->
+        <!--app:layout_constraintTop_toTopOf="@id/item_novice_guidance_video_image" />-->
+
     <ImageView
         android:id="@+id/item_novice_guidance_video_full"
         android:layout_width="33dp"