Просмотр исходного кода

编辑视频页面可以添加话题

zengjiebin лет назад: 7
Родитель
Сommit
17ead199df

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

@@ -448,6 +448,11 @@
             android:screenOrientation="user"
             android:screenOrientation="user"
             android:theme="@style/AppTheme.noTitleBar" />
             android:theme="@style/AppTheme.noTitleBar" />
         <activity
         <activity
+            android:name="com.sheep.gamegroup.view.activity.ActEditVideo"
+            android:configChanges="orientation|keyboardHidden|navigation|screenSize"
+            android:screenOrientation="user"
+            android:theme="@style/AppTheme.noTitleBar" />
+        <activity
             android:name="com.sheep.gamegroup.view.activity.ActInputAndPickerImg"
             android:name="com.sheep.gamegroup.view.activity.ActInputAndPickerImg"
             android:theme="@style/AppTheme.translucent" />
             android:theme="@style/AppTheme.translucent" />
         <activity
         <activity

+ 14 - 1
app/src/main/java/com/sheep/gamegroup/absBase/ApiRefresh.java

@@ -52,7 +52,7 @@ public abstract class ApiRefresh<T> {
     public boolean loadMoreData() {
     public boolean loadMoreData() {
         if (!loadMore) {
         if (!loadMore) {
             loadMore = true;
             loadMore = true;
-            if (ListUtil.size(list) >= per_page * page) {
+            if (hasMore()) {
                 page += 1;
                 page += 1;
                 initData();
                 initData();
             } else {
             } else {
@@ -65,6 +65,11 @@ public abstract class ApiRefresh<T> {
         }
         }
     }
     }
 
 
+    //还有数据没有获取
+    protected boolean hasMore() {
+        return ListUtil.size(list) >= per_page * page;
+    }
+
     public void clear() {
     public void clear() {
         lastMessage = null;
         lastMessage = null;
         list.clear();
         list.clear();
@@ -122,4 +127,12 @@ public abstract class ApiRefresh<T> {
     public void setLoadMore(boolean loadMore) {
     public void setLoadMore(boolean loadMore) {
         this.loadMore = loadMore;
         this.loadMore = loadMore;
     }
     }
+
+    public boolean hasPosition(int position){
+        return ListUtil.hasIndex(list, position);
+    }
+
+    public T getItem(int position){
+        return ListUtil.getItem(list, position);
+    }
 }
 }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -1482,7 +1482,7 @@ public interface ApiService {
 
 
     /**
     /**
      * 小绵羊3.4.5新增 -- 用户视频发布
      * 小绵羊3.4.5新增 -- 用户视频发布
-     * UserAddressReqUserAddressReq
+     * CreateUserVideoReq
      */
      */
     @POST("app/video")
     @POST("app/video")
     Observable<BaseMessage> postVideo(@Body JSONObject jsonObject);
     Observable<BaseMessage> postVideo(@Body JSONObject jsonObject);

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

@@ -54,6 +54,7 @@ import com.sheep.gamegroup.view.activity.ActCommentGameApp;
 import com.sheep.gamegroup.view.activity.ActCreditCardTaskList;
 import com.sheep.gamegroup.view.activity.ActCreditCardTaskList;
 import com.sheep.gamegroup.view.activity.ActCreditCardWeb;
 import com.sheep.gamegroup.view.activity.ActCreditCardWeb;
 import com.sheep.gamegroup.view.activity.ActDownloadWelfareList;
 import com.sheep.gamegroup.view.activity.ActDownloadWelfareList;
+import com.sheep.gamegroup.view.activity.ActEditVideo;
 import com.sheep.gamegroup.view.activity.ActEntertainmentLuckDraw;
 import com.sheep.gamegroup.view.activity.ActEntertainmentLuckDraw;
 import com.sheep.gamegroup.view.activity.ActEveryDayShare;
 import com.sheep.gamegroup.view.activity.ActEveryDayShare;
 import com.sheep.gamegroup.view.activity.ActExchangeCMCC;
 import com.sheep.gamegroup.view.activity.ActExchangeCMCC;
@@ -2258,6 +2259,16 @@ public class Jump2View {
     }
     }
 
 
     /**
     /**
+     * 编辑视频
+     *
+     * @param url 播放地址
+     */
+    public void goActEditVideo(String url) {
+        Activity activity = ActivityManager.getInstance().currentActivity();
+        activity.startActivity(DataUtil.putObject(new Intent(activity, ActEditVideo.class), url));
+    }
+
+    /**
      * 提交自定义字段
      * 提交自定义字段
      *
      *
      * @param activity
      * @param activity

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -1674,6 +1674,11 @@ public class ViewUtil {
             textView.setText(SheepApp.getInstance().getString(stringId, objects));
             textView.setText(SheepApp.getInstance().getString(stringId, objects));
         }
         }
     }
     }
+    public static void setText(TextView textView, String format, Object...objects) {
+        if (textView != null) {
+            textView.setText(String.format(Locale.CHINA, format, objects));
+        }
+    }
 
 
     public static void setText(TextView textView, IContentTypeContainer<Integer, String> contentTypeContainer, int maxWidth) {
     public static void setText(TextView textView, IContentTypeContainer<Integer, String> contentTypeContainer, int maxWidth) {
         switch (contentTypeContainer.getContentType()) {
         switch (contentTypeContainer.getContentType()) {

+ 398 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActEditVideo.java

@@ -0,0 +1,398 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.annotation.SuppressLint;
+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.support.v4.app.Fragment;
+import android.view.GestureDetector;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.TextView;
+import android.widget.VideoView;
+
+import com.kfzs.duanduan.utils.StatusBarUtils;
+import com.sheep.gamegroup.absBase.BaseContainerActivity;
+import com.sheep.gamegroup.model.entity.DiscoveryTopic;
+import com.sheep.gamegroup.util.ActionUtil;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.KeyEventUtil;
+import com.sheep.gamegroup.util.LogUtil;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.fragment.FgtDiscoveryTopic;
+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 ActEditVideo extends BaseContainerActivity 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.video_loading)
+    View video_loading;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_edit_video;
+    }
+
+    @Override
+    public void initView() {
+        super.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.setMediaController(new MediaController(this));
+        videoView.setVideoURI(uri);
+    }
+
+    @Override
+    protected Fragment initFragment() {
+        return new FgtDiscoveryTopic();
+    }
+
+    @SuppressLint("ClickableViewAccessibility")
+    @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 void playOrPause() {
+        if(videoView.isPlaying()){
+            pause();
+        } else {
+            play();
+        }
+    }
+    //播放
+    private void play(){
+        if(videoView == null){
+            return;
+        }
+        videoView.start();
+    }
+    //暂停
+    private void pause(){
+        if(videoView == null){
+            return;
+        }
+        videoView.pause();
+    }
+    //销毁
+    private void destroy(){
+        if(videoView == null){
+            return;
+        }
+        videoView.stopPlayback();
+    }
+
+
+    @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(videoView != null && videoView.isPlaying())
+            isPauseByUser = false;
+        if(video_loading != null)
+            video_loading.setVisibility(View.VISIBLE);
+        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 = ActEditVideo.this.windowWidth;
+            int windowHeight = ActEditVideo.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;
+    }
+
+
+    @BindView(R.id.edit_video_topic_tv)
+    TextView edit_video_topic_tv;
+    @BindView(R.id.edit_video_sure_tv)
+    TextView edit_video_sure_tv;
+    @BindView(R.id.frame_container)
+    View frame_container;
+
+    //添加话题
+    @Override
+    public void doNextAction(Object action) {
+        if(action instanceof DiscoveryTopic){
+            ViewUtil.setText(edit_video_topic_tv, "#%s#", ((DiscoveryTopic) action).getTopic());
+        }
+    }
+
+    //点击话题进行切换
+    public void onClickTopic(View view) {
+        if(ViewUtil.isVisible(frame_container)){
+            ViewUtil.setText(edit_video_sure_tv, "完成");
+        } else {
+            ViewUtil.setText(edit_video_sure_tv, "下一步");
+        }
+        ViewUtil.toggleVisibility(frame_container);
+    }
+
+    //点击返回
+    public void onClickBackImg(View view) {
+        KeyEventUtil.sendKeyDownUp(KeyEvent.KEYCODE_BACK);
+        ActionUtil.getInstance().getAction(ActPublishArticle.class.getSimpleName());//清除掉选中的话题
+    }
+
+    //点击确定
+    public void onClickSure(View view) {
+        if(ViewUtil.isVisible(frame_container)){//首先隐藏话题列表
+            ViewUtil.setVisibility(frame_container, false);
+            ViewUtil.setText(edit_video_sure_tv, "完成");
+        } else {//其次完成编辑
+            G.showToast("完成操作");
+        }
+    }
+}

+ 10 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActPublishArticle.java

@@ -17,6 +17,7 @@ import com.qiniu.android.storage.UpProgressHandler;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.CreateUserVideoReq;
 import com.sheep.gamegroup.model.entity.CreateUserVideoReq;
+import com.sheep.gamegroup.model.entity.DiscoveryTopic;
 import com.sheep.gamegroup.model.entity.InputAndUrlList;
 import com.sheep.gamegroup.model.entity.InputAndUrlList;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.Jump2View;
@@ -103,7 +104,7 @@ public class ActPublishArticle extends BaseActivity {
                     helper.itemView.setOnClickListener(new View.OnClickListener() {
                     helper.itemView.setOnClickListener(new View.OnClickListener() {
                         @Override
                         @Override
                         public void onClick(View view) {
                         public void onClick(View view) {
-                            Jump2View.getInstance().goActPlayVideo(item, false);
+                            Jump2View.getInstance().goActEditVideo(item);
                         }
                         }
                     });
                     });
                 }
                 }
@@ -143,7 +144,7 @@ public class ActPublishArticle extends BaseActivity {
                         inputAndUrlList.getList().add(imageRadioResultEvent.getResult().getOriginalPath());
                         inputAndUrlList.getList().add(imageRadioResultEvent.getResult().getOriginalPath());
                         ViewUtil.notifyDataSetChanged(recyclerView);
                         ViewUtil.notifyDataSetChanged(recyclerView);
                         imageCropBean = imageRadioResultEvent.getResult();
                         imageCropBean = imageRadioResultEvent.getResult();
-
+                        Jump2View.getInstance().goActEditVideo(imageCropBean.getOriginalPath());
                     }
                     }
                 })
                 })
                 .open();
                 .open();
@@ -254,4 +255,11 @@ public class ActPublishArticle extends BaseActivity {
     @IntDef({MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO, MEDIA_TYPE_NONE})
     @IntDef({MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO, MEDIA_TYPE_NONE})
     public @interface Type {
     public @interface Type {
     }
     }
+
+    //添加话题
+    @Override
+    public void doNextAction(Object action) {
+        if(action instanceof DiscoveryTopic)
+            jsonObject.put("topic_id", ((DiscoveryTopic) action).getId());
+    }
 }
 }

+ 14 - 9
app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment6.java

@@ -23,7 +23,6 @@ import com.sheep.jiuyan.samllsheep.base.BaseFragment;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
-import butterknife.BindView;
 import rx.functions.Action1;
 import rx.functions.Action1;
 
 
 /**
 /**
@@ -43,6 +42,8 @@ public abstract class BaseListFragment6<T> extends BaseFragment implements IRefr
     @Override
     @Override
     public void onViewCreated() {
     public void onViewCreated() {
         activity = getActivity();
         activity = getActivity();
+        findView();
+        addApiRefresh(apiRefreshList);
         initView();
         initView();
         initListener();
         initListener();
         switch (refreshDataType()) {
         switch (refreshDataType()) {
@@ -58,23 +59,27 @@ public abstract class BaseListFragment6<T> extends BaseFragment implements IRefr
         }
         }
     }
     }
 
 
+    protected abstract void addApiRefresh(List<ApiRefresh<?>> apiRefreshList);
+
     protected List<ApiRefresh<? extends Object>> apiRefreshList = new ArrayList<>();
     protected List<ApiRefresh<? extends Object>> apiRefreshList = new ArrayList<>();
 
 
     public static final int REFRESH_ON_CREATE = 0;
     public static final int REFRESH_ON_CREATE = 0;
     public static final int REFRESH_ON_RESUME = 1;
     public static final int REFRESH_ON_RESUME = 1;
     public static final int REFRESH_ON_YOURSELF = -1;
     public static final int REFRESH_ON_YOURSELF = -1;
-    @BindView(R.id.title)
-    View title;
-    @BindView(R.id.check_net_ll)
-    View check_net_ll;
-    @BindView(R.id.swipeRefreshLayout)
-    SwipeRefreshLayout swipeRefreshLayout;
-    @BindView(R.id.recyclerView)
-    RecyclerView recyclerView;
+    protected View title;
+    protected View check_net_ll;
+    protected SwipeRefreshLayout swipeRefreshLayout;
+    protected RecyclerView recyclerView;
 
 
     protected BaseQuickAdapter<T, BaseViewHolder> baseQuickAdapter;
     protected BaseQuickAdapter<T, BaseViewHolder> baseQuickAdapter;
 
 
 
 
+    public void findView() {
+        title = findViewById(R.id.title);
+        check_net_ll = findViewById(R.id.check_net_ll);
+        swipeRefreshLayout = findViewById(R.id.swipeRefreshLayout);
+        recyclerView = findViewById(R.id.recyclerView);
+    }
     public void initView() {
     public void initView() {
         ViewUtil.setVisibility(title, false);
         ViewUtil.setVisibility(title, false);
     }
     }

+ 87 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtDiscoveryTopic.java

@@ -0,0 +1,87 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.view.View;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.sheep.gamegroup.absBase.ApiRefresh;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.DiscoveryTopic;
+import com.sheep.gamegroup.util.ActionUtil;
+import com.sheep.gamegroup.view.activity.ActPublishArticle;
+import com.sheep.jiuyan.samllsheep.R;
+
+import org.afinal.simplecache.ApiKey;
+
+import java.util.List;
+
+import io.reactivex.Observable;
+
+/**
+ * Created by realicing on 2018/11/29.
+ * realicing@sina.com
+ * 小绵羊3.4.5新增 -- 为视频添加话题,话题列表
+ */
+public class FgtDiscoveryTopic extends BaseListFragment6<DiscoveryTopic> {
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.common_srl_rv;
+    }
+
+    private ApiRefresh<DiscoveryTopic> mApiRefresh;
+
+    @Override
+    protected void addApiRefresh(List<ApiRefresh<?>> apiRefreshList) {
+        mApiRefresh = new ApiRefresh<DiscoveryTopic>(this) {
+            @Override
+            protected boolean hasMore() {
+                return false;
+            }
+
+            @Override
+            public String getKey(int page, int per_page) {
+                return ApiKey.getVideoTopic;
+            }
+
+            @Override
+            public Observable<BaseMessage> getApi(ApiService apiService) {
+                return apiService.getVideoTopic();
+            }
+
+            @Override
+            public Class<DiscoveryTopic> getTClass() {
+                return DiscoveryTopic.class;
+            }
+        };
+        apiRefreshList.add(mApiRefresh);
+    }
+
+    @Override
+    protected BaseQuickAdapter<DiscoveryTopic, BaseViewHolder> getAdapter() {
+        return new BaseQuickAdapter<DiscoveryTopic, BaseViewHolder>(R.layout.item_discovery_topic, mApiRefresh.getList()) {
+            @Override
+            protected void convert(BaseViewHolder helper, DiscoveryTopic item) {
+                helper.setText(R.id.item_discovery_topic_content, item.getTopic());
+            }
+        };
+    }
+
+    @Override
+    public void initListener() {
+        super.initListener();
+        baseQuickAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                DiscoveryTopic item = mApiRefresh.getItem(position);
+                if(item != null) {
+                    ActionUtil.getInstance().addNextAction(ActPublishArticle.class.getSimpleName(), item);
+                    if(activity instanceof BaseActivity)
+                        ((BaseActivity) activity).doNextAction(item);
+                }
+            }
+        });
+    }
+}

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

@@ -51,7 +51,7 @@ public class FgtUserFocusLogList extends BaseListFragment6<String> {
     };
     };
 
 
     @Override
     @Override
-    public void initView() {
+    protected void addApiRefresh(List<ApiRefresh<?>> apiRefreshList) {
         tagList.add("1");
         tagList.add("1");
         tagList.add("2");
         tagList.add("2");
         ApiRefresh<UserFocusLog> apiRefresh1 = new ApiRefresh<UserFocusLog>(this) {
         ApiRefresh<UserFocusLog> apiRefresh1 = new ApiRefresh<UserFocusLog>(this) {
@@ -67,7 +67,7 @@ public class FgtUserFocusLogList extends BaseListFragment6<String> {
 
 
             @Override
             @Override
             public Class<UserFocusLog> getTClass() {
             public Class<UserFocusLog> getTClass() {
-                return null;
+                return UserFocusLog.class;
             }
             }
         };
         };
         ApiRefresh<UserFocusLog> apiRefresh2 = new ApiRefresh<UserFocusLog>(this) {
         ApiRefresh<UserFocusLog> apiRefresh2 = new ApiRefresh<UserFocusLog>(this) {
@@ -108,7 +108,6 @@ public class FgtUserFocusLogList extends BaseListFragment6<String> {
         adpUserFocusLogList2 = new AdpUserFocusLogList(apiRefresh2.getList());
         adpUserFocusLogList2 = new AdpUserFocusLogList(apiRefresh2.getList());
         adpUserFocusLogList.setAction1(action1);
         adpUserFocusLogList.setAction1(action1);
         adpUserFocusLogList2.setAction1(action1);
         adpUserFocusLogList2.setAction1(action1);
-        super.initView();
     }
     }
 
 
     private View headerView;
     private View headerView;

+ 6 - 0
app/src/main/res/drawable/shape_white_20_solid_rectangle_15.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="15dp" />
+    <solid android:color="#33ffffff" />
+</shape>

+ 88 - 0
app/src/main/res/layout/act_edit_video.xml

@@ -0,0 +1,88 @@
+<?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"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:background="#000000"
+    tools:context="com.sheep.gamegroup.view.activity.ActEditVideo">
+
+    <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" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="#99000000"/>
+
+    <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" />
+
+    <ImageView
+        android:id="@+id/video_back_iv"
+        android:layout_width="?attr/actionBarSize"
+        android:layout_height="?attr/actionBarSize"
+        android:layout_marginTop="20dp"
+        android:scaleType="centerInside"
+        android:onClick="onClickBackImg"
+        android:src="@drawable/narrow_back_white"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <TextView
+        android:id="@+id/edit_video_topic_tv"
+        android:layout_width="0dp"
+        android:layout_height="30dp"
+        android:background="@drawable/shape_white_20_solid_rectangle_15"
+        android:gravity="center|start"
+        android:maxLength="100"
+        android:paddingStart="18dp"
+        android:paddingEnd="18dp"
+        android:text="#添加话题#"
+        android:onClick="onClickTopic"
+        android:textColor="#FEFFFF"
+        android:textSize="13sp"
+        app:layout_constraintBottom_toBottomOf="@id/video_back_iv"
+        app:layout_constraintEnd_toStartOf="@id/edit_video_sure_tv"
+        app:layout_constraintStart_toEndOf="@id/video_back_iv"
+        app:layout_constraintTop_toTopOf="@id/video_back_iv" />
+
+    <TextView
+        android:id="@+id/edit_video_sure_tv"
+        android:layout_width="75dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="31dp"
+        android:layout_marginEnd="16dp"
+        android:background="@drawable/selector_button_full_main"
+        android:gravity="center"
+        android:paddingTop="6dp"
+        android:paddingBottom="6dp"
+        android:text="下一步"
+        android:onClick="onClickSure"
+        android:textColor="#FEFFFF"
+        android:textSize="15sp"
+        app:layout_constraintBottom_toBottomOf="@id/video_back_iv"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toEndOf="@id/edit_video_topic_tv"
+        app:layout_constraintTop_toTopOf="@id/video_back_iv" />
+
+    <FrameLayout
+        android:id="@+id/frame_container"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_marginTop="27dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/edit_video_topic_tv" />
+</android.support.constraint.ConstraintLayout>

+ 20 - 0
app/src/main/res/layout/item_discovery_topic.xml

@@ -0,0 +1,20 @@
+<?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">
+
+    <TextView
+        android:id="@+id/item_discovery_topic_content"
+        android:layout_width="wrap_content"
+        android:layout_height="30dp"
+        android:layout_centerHorizontal="true"
+        android:layout_margin="10dp"
+        android:background="@drawable/shape_white_20_solid_rectangle_15"
+        android:gravity="center"
+        android:maxLength="100"
+        android:paddingStart="18dp"
+        android:paddingEnd="18dp"
+        android:text="#添加话题#"
+        android:textColor="#FEFFFF"
+        android:textSize="13sp" />
+</RelativeLayout>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -141,4 +141,5 @@
     <string name="hot_user">热门玩家</string>
     <string name="hot_user">热门玩家</string>
     <!--小绵羊3.4.5新增功能 发布发现-->
     <!--小绵羊3.4.5新增功能 发布发现-->
     <string name="please_say_something">说点什么~</string>
     <string name="please_say_something">说点什么~</string>
+    <string name="jin_x_jin">#%s#</string>
 </resources>
 </resources>