Forráskód Böngészése

准备发版本3.4.2

zengjiebin 7 éve
szülő
commit
f3779e6096

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

@@ -450,6 +450,9 @@
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActInputAndPickerImg"
             android:theme="@style/AppTheme.translucent" />
+        <activity
+            android:name="com.sheep.gamegroup.view.activity.ActVideoComment"
+            android:theme="@style/AppTheme.fullTranslucent" />
 
         <!-- 友盟start -->
         <meta-data

+ 2 - 0
app/src/main/java/com/lqr/emoji/EmotionKeyboard.java

@@ -1,5 +1,6 @@
 package com.lqr.emoji;
 
+import android.annotation.SuppressLint;
 import android.annotation.TargetApi;
 import android.app.Activity;
 import android.content.Context;
@@ -53,6 +54,7 @@ public class EmotionKeyboard {
     /**
      * 绑定编辑框
      */
+    @SuppressLint("ClickableViewAccessibility")
     public EmotionKeyboard bindToEditText(EditText editText) {
         mEditText = editText;
         mEditText.requestFocus();

+ 6 - 2
app/src/main/java/com/sheep/gamegroup/model/entity/UserComment.java

@@ -1,6 +1,7 @@
 package com.sheep.gamegroup.model.entity;
 
 
+import com.lqr.emoji.EmotionLayout;
 import com.sheep.gamegroup.util.ApiJSONUtil;
 
 /**
@@ -216,8 +217,11 @@ public class UserComment {
     private ShowAll showAll;
 
     public ShowAll getShowAll() {
-        if (showAll == null)
-            showAll = new ShowAll(content);
+        if (showAll == null){
+            boolean hasExp = EmotionLayout.hasExp(content);
+            showAll = new ShowAll(hasExp ? EmotionLayout.changeContent(content) : content);
+            showAll.setHasExp(hasExp);
+        }
         return showAll;
     }
 

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

@@ -100,6 +100,7 @@ import com.sheep.gamegroup.view.activity.ActUserAppHome;
 import com.sheep.gamegroup.view.activity.ActUserCommentDetail;
 import com.sheep.gamegroup.view.activity.ActUserLabelList;
 import com.sheep.gamegroup.view.activity.ActUserNoviceGuidance;
+import com.sheep.gamegroup.view.activity.ActVideoComment;
 import com.sheep.gamegroup.view.activity.ActWebX5;
 import com.sheep.gamegroup.view.activity.ActXianWanWeb;
 import com.sheep.gamegroup.view.activity.ActXiaomiGame;
@@ -2346,4 +2347,12 @@ public class Jump2View {
         Intent intent = new Intent(activity, ActPublishArticle.class);
         activity.startActivity(DataUtil.putObject(intent, type));
     }
+    /**
+     * 小绵羊3.4.5新增--跳转到发布发现内容的界面
+     */
+    public void gotoActVideoComment(int video_id) {
+        Activity activity = ActivityManager.getInstance().currentActivity();
+        Intent intent = new Intent(activity, ActVideoComment.class);
+        activity.startActivity(DataUtil.putObject(intent, video_id));
+    }
 }

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

@@ -623,6 +623,11 @@ public class TestUtil {
         activity.startActivity(intent);
     }
 
+    //3.4.2版本之后的版本
+    public static boolean isGTVersion3_4_2() {
+        return BuildConfig.VERSION_CODE > 3004002;
+    }
+
     /**
      * umen 分享
      */

+ 9 - 42
app/src/main/java/com/sheep/gamegroup/view/activity/ActPlayVideoArticle.java

@@ -8,7 +8,6 @@ import android.net.Uri;
 import android.os.Bundle;
 import android.support.annotation.Nullable;
 import android.support.design.widget.CheckableImageButton;
-import android.support.v4.app.Fragment;
 import android.support.v7.widget.AppCompatCheckedTextView;
 import android.text.TextUtils;
 import android.view.GestureDetector;
@@ -21,7 +20,7 @@ import android.widget.TextView;
 import android.widget.VideoView;
 
 import com.kfzs.duanduan.utils.StatusBarUtils;
-import com.sheep.gamegroup.absBase.BaseContainerActivity;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DiscoveryVideo;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
@@ -33,7 +32,6 @@ import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.util.share.CommonUMShareListener;
 import com.sheep.gamegroup.util.share.ShareLinkConfig;
-import com.sheep.gamegroup.view.fragment.FgtVideoComment;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
@@ -48,7 +46,7 @@ import io.reactivex.schedulers.Schedulers;
  * realicing@sina.com
  * 小绵羊3.4.5新增 -- 视频详情
  */
-public class ActPlayVideoArticle extends BaseContainerActivity implements MediaPlayer.OnInfoListener, MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener, MediaPlayer.OnCompletionListener, View.OnLayoutChangeListener {
+public class ActPlayVideoArticle extends BaseActivity implements MediaPlayer.OnInfoListener, MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener, MediaPlayer.OnCompletionListener, View.OnLayoutChangeListener {
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -84,13 +82,6 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
     @BindView(R.id.video_title_tv)
     TextView video_title_tv;
 
-    @BindView(R.id.frame_container)
-    View frame_container;
-
-    //评论
-    private FgtVideoComment fgtVideoComment;
-
-
     @Override
     protected int getLayoutId() {
         return R.layout.act_play_video_article;
@@ -103,33 +94,21 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
 
     @Override
     public void initView() {
-        super.initView();
         initVolume();
         DiscoveryVideo lastVideo = DataUtil.getObject(getIntent(), DiscoveryVideo.class);
         if (lastVideo == null) {
             video_id = DataUtil.getObject(getIntent(), Integer.class);
-            fgtVideoComment.setVideo_id(video_id);
             loadVideoData(null);
         } else {
             video_id = lastVideo.getId();
-            fgtVideoComment.setVideo_id(video_id);
             user_id = lastVideo.getUser_id();
             video_url = lastVideo.getResource();
             loadVideoData(lastVideo);
         }
         ViewUtil.setImage(video_camera_iv, ViewUtil.getNetImgByName("add_article_camera"));
-        ViewUtil.setVisibility2(frame_container, false);
-    }
-
-    @Override
-    protected Fragment initFragment() {
-        fgtVideoComment = new FgtVideoComment();
-        return fgtVideoComment;
     }
 
     private void loadVideoData(DiscoveryVideo video) {
-        if (fgtVideoComment != null)
-            fgtVideoComment.loadVideoData(video);
         if (video == null) {
             ViewUtil.setText(video_like_tv, ViewUtil.BLOCK);
             ViewUtil.setText(video_comment_tv, ViewUtil.BLOCK);
@@ -153,7 +132,7 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
         videoView.setOnErrorListener(this);
         videoView.setOnCompletionListener(this);
         videoView.addOnLayoutChangeListener(this);
-        videoView.setMediaController(new MediaController(this));
+//        videoView.setMediaController(new MediaController(this));
         videoView.setVideoURI(uri);
     }
 
@@ -190,8 +169,9 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
 
     //评论
     public void onClickVideoComment(View view) {
-        ViewUtil.setVisibility(frame_container, true);
         ViewUtil.setVisibility(video_bottom, false);
+        //跳转评论对话框界面
+        Jump2View.getInstance().gotoActVideoComment(video_id);
     }
 
     private ShareLinkConfig shareLinkConfig;
@@ -251,16 +231,6 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
         }
     }
 
-    @Override
-    public void onBackPressed() {
-        if (ViewUtil.isVisible(frame_container)) {
-            ViewUtil.setVisibility(frame_container, false);
-            ViewUtil.setVisibility(video_bottom, true);
-            return;
-        }
-        super.onBackPressed();
-    }
-
     @SuppressLint("ClickableViewAccessibility")
     @Override
     public void initListener() {
@@ -291,8 +261,6 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
                                 initPlay();
                             }
                             loadVideoData(newVideo);
-                            if (fgtVideoComment != null)
-                                fgtVideoComment.refreshData();
                         }
                     }
 
@@ -345,8 +313,8 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
     }
 
     @Override
-    protected void onResume() {
-        super.onResume();
+    protected void onStart() {
+        super.onStart();
         if (!isPauseByUser)
             play();
     }
@@ -355,8 +323,8 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
     private boolean isPauseByUser;
 
     @Override
-    protected void onPause() {
-        super.onPause();
+    protected void onStop() {
+        super.onStop();
         if (videoView != null && videoView.isPlaying())
             isPauseByUser = false;
         if (video_loading != null)
@@ -395,7 +363,6 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
             LogUtil.println("mGestureListener", "onSingleTapConfirmed");
             ViewUtil.toggleVisibility(video_top);
             ViewUtil.setVisibility(video_bottom, ViewUtil.isVisible(video_top));
-            ViewUtil.setVisibility(frame_container, false);
 //            if(isPlaying)
 //                isPauseByUser = true;
 //            playOrPause();

+ 23 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActVideoComment.java

@@ -0,0 +1,23 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.support.v4.app.Fragment;
+
+import com.sheep.gamegroup.absBase.BaseContainerActivity;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.view.fragment.FgtVideoComment;
+
+/**
+ * Created by realicing on 2018/11/28.
+ * realicing@sina.com
+ */
+public class ActVideoComment extends BaseContainerActivity {
+
+
+    @Override
+    protected Fragment initFragment() {
+        FgtVideoComment fgtVideoComment = new FgtVideoComment();
+        int video_id = DataUtil.getObject(getIntent(), Integer.class);
+        fgtVideoComment.setVideo_id(video_id);
+        return fgtVideoComment;
+    }
+}

+ 5 - 3
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtFindChild.java

@@ -25,6 +25,7 @@ import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DownloadUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.ViewHolder;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
@@ -276,7 +277,8 @@ public class FgtFindChild extends BaseListFragment2<Article> {
         public CommonRecycler(List<Article> list) {
             super(SheepApp.getInstance(), list);
             commonConverter = new CommonConverter();
-            newsConverter = new NewsConverter();
+            if(TestUtil.isGTVersion3_4_2())
+                newsConverter = new NewsConverter();
         }
 
         @Override
@@ -287,7 +289,7 @@ public class FgtFindChild extends BaseListFragment2<Article> {
 
         @Override
         public int getViewIdByType(int type) {//type来源于 getItemViewType 返回的值
-            if (type == 2) {
+            if (type == 2 && newsConverter != null) {
                 return R.layout.find_item_news;
             }
             return R.layout.find_item;
@@ -298,7 +300,7 @@ public class FgtFindChild extends BaseListFragment2<Article> {
             if (item == null) {
                 return;
             }
-            if (item.getType() == 2) {
+            if (item.getType() == 2 && newsConverter != null) {
                 newsConverter.convert(holder, item);
             } else {
                 commonConverter.convert(holder, item);

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

@@ -35,7 +35,6 @@ import com.sheep.gamegroup.util.share.ShareLinkConfig;
 import com.sheep.gamegroup.view.activity.ActMsg;
 import com.sheep.gamegroup.view.activity.PersonalCenterAct;
 import com.sheep.gamegroup.view.adapter.AdpUserCenterModule;
-import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
@@ -157,7 +156,7 @@ public class FgtPersonalCenter extends BaseFragment {
         ViewUtil.setVisibility(audit_failed_oval, false);
         initUserModuleItemView();
         //是否显示我的关注
-        ViewUtil.setVisibility(fgt_person_center_my_focus, TestUtil.isTest() || BuildConfig.VERSION_CODE > 3004002);
+        ViewUtil.setVisibility(fgt_person_center_my_focus, TestUtil.isTest() || TestUtil.isGTVersion3_4_2());
     }
 
     private void initData() {

+ 7 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtVideoComment.java

@@ -72,7 +72,7 @@ public class FgtVideoComment extends BaseListFragment4<UserComment> {
         //初始化 表情键盘协调工具
         initEmotionKeyboard();
         initSticker();
-
+        refreshData();
     }
 
     //用户评论一个用户对游戏的评论
@@ -135,6 +135,12 @@ public class FgtVideoComment extends BaseListFragment4<UserComment> {
         return UserComment.class;
     }
 
+    @Override
+    public void notifyDataSetChanged() {
+        super.notifyDataSetChanged();
+        if(lastMessage != null)
+            ViewUtil.setText(video_comment_title_tv, R.string.total_x_comment, String.valueOf(lastMessage.getTotal()));
+    }
 
     private void initSticker() {
         elEmotion.attachEditText(input_comment_input);

+ 0 - 6
app/src/main/res/layout/act_play_video_article.xml

@@ -27,10 +27,4 @@
 
     <include layout="@layout/include_article_video_bottom" />
 
-    <FrameLayout
-        android:id="@+id/frame_container"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:visibility="gone"/>
-
 </android.support.constraint.ConstraintLayout>

+ 1 - 1
app/src/main/res/layout/include_article_video_bottom.xml

@@ -43,7 +43,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginBottom="17dp"
-        android:drawableStart="@drawable/ic_but_share_white"
+        android:drawableStart="@mipmap/ic_share"
         android:drawablePadding="9dp"
         android:onClick="onClickVideoShare"
         android:padding="8dp"

BIN
app/src/main/res/mipmap-xxhdpi/ic_share.webp


+ 12 - 0
app/src/main/res/values/gamegroup_styles.xml

@@ -131,6 +131,18 @@
         <item name="android:background">@color/transparent</item>
         <item name="android:backgroundDimAmount">0.6</item>
     </style>
+    <!--全屏透明背景-->
+    <style name="AppTheme.fullTranslucent" parent="@style/AppTheme.fullScreen">
+         <!--背景颜色及和透明程度-->  
+        <item name="android:windowBackground">@color/transparent</item>  
+        <!--是否去除边框-->  
+        <item name="android:windowFrame">@null</item>  
+        <!--是否模糊-->  
+        <item name="android:backgroundDimEnabled">true</item>  
+        <item name="android:windowIsTranslucent">true</item>
+        <item name="android:background">@color/transparent</item>
+        <item name="android:backgroundDimAmount">0</item>
+    </style>
     <style name="style_nomal_tv">
         <item name="android:layout_width">wrap_content</item>
         <item name="android:layout_height">wrap_content</item>