hanjing пре 6 година
родитељ
комит
9c4b236be5

+ 2 - 0
app/src/main/java/com/sheep/gamegroup/model/api/IWeb.java

@@ -37,4 +37,6 @@ public interface IWeb {
     String getWebTitle();
 
     void setCookies(String url, Map<String, String> params);
+
+    void onShareResult();
 }

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/module/webview/fragment/FgtWeb.java

@@ -684,6 +684,11 @@ public class FgtWeb extends BaseFgtWeb {
         }
     }
 
+    @Override
+    public void onShareResult() {
+        loadJs("onShareResult()");
+    }
+
     public static String getWXRefreshToken(Context context, String host) {
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
             CookieSyncManager.createInstance(context);

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/module/webview/fragment/FgtWebX5.java

@@ -695,6 +695,11 @@ public class FgtWebX5 extends BaseFgtWebX5 {
         CookieSyncManager.createInstance(getContext()).sync();
     }
 
+    @Override
+    public void onShareResult() {
+        loadJs("onShareResult()");
+    }
+
     public static String getWXRefreshToken(Context context, String host) {
         CookieSyncManager.createInstance(context);
         CookieManager cookieManager = CookieManager.getInstance();

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ActModifyThird.java

@@ -264,7 +264,7 @@ public class ActModifyThird extends BaseActivity {
         UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.WEIXIN, new UMAuthListener() {
             @Override
             public void onStart(SHARE_MEDIA platform) {
-                showProgress();
+//                showProgress();
             }
 
             @Override

+ 24 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ActWebX5.java

@@ -14,12 +14,14 @@ import com.sheep.jiuyan.samllsheep.Config;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
 import com.snail.antifake.jni.EmulatorDetectUtil;
 import com.umeng.socialize.UMShareAPI;
+import com.umeng.socialize.UMShareListener;
+import com.umeng.socialize.bean.SHARE_MEDIA;
 
 /**
  * web页面--含有所有js及url后添加authorization
  * Created by zengjiebin on 2018/4/27.
  */
-public class ActWebX5 extends BaseContainerActivity {
+public class ActWebX5 extends BaseContainerActivity implements UMShareListener {
 
     protected WebParams webParams;
 
@@ -92,4 +94,25 @@ public class ActWebX5 extends BaseContainerActivity {
         }
     }
 
+    @Override
+    public void onStart(SHARE_MEDIA share_media) {
+
+    }
+
+    @Override
+    public void onResult(SHARE_MEDIA share_media) {
+        if (fragment instanceof IWeb) {
+            ((IWeb) fragment).onShareResult();
+        }
+    }
+
+    @Override
+    public void onError(SHARE_MEDIA share_media, Throwable throwable) {
+
+    }
+
+    @Override
+    public void onCancel(SHARE_MEDIA share_media) {
+
+    }
 }

+ 11 - 6
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java

@@ -253,6 +253,10 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
     View video_player_layer;
     @BindView(R.id.video_task_tip)
     TextView video_task_tip;
+    @BindView(R.id.recharge_game_bar)
+    View recharge_game_bar;
+    @BindView(R.id.watch_video_bar)
+    View watch_video_bar;
 
     //是否需要在onResume中刷新页面
     private boolean isFresh = false;
@@ -391,10 +395,8 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
         ViewUtil.setVisibility(task_detail_reward, !taskReleaseEty.isShop());
         ViewUtil.setVisibility(about_merchandise_tile, taskReleaseEty.isShop());
         ViewUtil.setText(most_discount_tv, "最高抵扣" + taskReleaseEty.getShop_amount() + "元");
-        ViewUtil.setVisibility(watch_video_tag, taskReleaseEty.getVideo_amount() > 0);
-        ViewUtil.setVisibility(watch_video_ico, taskReleaseEty.getVideo_amount() > 0);
-        ViewUtil.setVisibility(recharge_game_tag, taskEty.getBenchmark() == 4);
-        ViewUtil.setVisibility(recharge_game_ico, taskEty.getBenchmark() == 4);
+        ViewUtil.setVisibility(watch_video_bar, taskReleaseEty.getVideo_amount() > 0);
+        ViewUtil.setVisibility(recharge_game_bar, taskEty.getBenchmark() == 4);
         ViewUtil.setImageRes(watch_video_ico, taskReleaseEty.getVideo_award() == 1 ? R.mipmap.icon_select : R.mipmap.text_delete);
         ViewUtil.setImageRes(recharge_game_ico, taskReleaseEty.isAuto_progress() ? R.mipmap.icon_select : R.mipmap.text_delete);
         if (taskReleaseEty.getVideo_amount() > 0) {
@@ -798,7 +800,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
             public void call(Object o) {
                 if (o instanceof Integer) {
                     type = (int) o;
-                    if(type ==0 && isDownloadImmeditely){
+                    if (type == 0 && isDownloadImmeditely) {
                         onClickFirstBtn();
                         isDownloadImmeditely = false;
                     }
@@ -856,12 +858,15 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
     @OnClick({R.id.detail_task_tv, R.id.web_text, R.id.ll_infos, R.id.btn_task_item,
             R.id.btn_up_imag, R.id.detail_share_friend_tv, R.id.task_detail_cancel,
             R.id.task_detail_pay_vip_tv, R.id.task_detail_vip_cl, R.id.ignore_video_btn,
-            R.id.video_player_layer})
+            R.id.video_player_layer, R.id.play_video_btn})
     public void onViewClicked(View view) {
         try {
             switch (view.getId()) {
                 case R.id.video_player_layer:
                     break;
+                case R.id.play_video_btn:
+                    startPlayVideo(taskEty.getVideo_url());
+                    break;
                 case R.id.detail_task_tv://查看任务截图
                     lookScreenShot();
                     break;

+ 4 - 4
app/src/main/res/drawable/rounder_e2f4fe_5.xml

@@ -3,10 +3,10 @@
     android:shape="rectangle">
 
     <corners
-        android:topLeftRadius="5dp"
-        android:topRightRadius="5dp"
-        android:bottomLeftRadius="5dp"
-        android:bottomRightRadius="5dp"/>
+        android:topLeftRadius="13dp"
+        android:topRightRadius="13dp"
+        android:bottomLeftRadius="13dp"
+        android:bottomRightRadius="13dp"/>
 
     <solid
         android:color="@color/blue_E2F4FE"/>

+ 39 - 4
app/src/main/res/layout/task_detail_layout.xml

@@ -427,10 +427,10 @@
                         </LinearLayout>
 
                         <LinearLayout
+                            android:id="@+id/watch_video_bar"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_marginTop="14dp"
-                            android:background="@drawable/rounder_e2f4fe_5"
+                            android:layout_marginTop="8dp"
                             android:gravity="center_vertical"
                             android:orientation="horizontal"
                             android:padding="8dp">
@@ -449,12 +449,32 @@
                                 android:layout_height="14dp"
                                 android:layout_marginLeft="4dp"
                                 android:src="@mipmap/icon_select" />
-
+                            <View
+                                android:layout_weight="1"
+                                android:layout_width="match_parent"
+                                android:layout_height="14dp"/>
+                            <TextView
+                                android:id="@+id/play_video_btn"
+                                android:text="观看教程"
+                                android:textSize="13sp"
+                                android:textColor="#2ebef2"
+                                android:gravity="center"
+                                android:background="@drawable/rounder_e2f4fe_13"
+                                android:layout_width="72dp"
+                                android:layout_height="26dp" />
+                        </LinearLayout>
+                        <LinearLayout
+                            android:id="@+id/recharge_game_bar"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="8dp"
+                            android:gravity="center_vertical"
+                            android:orientation="horizontal"
+                            android:padding="8dp">
                             <TextView
                                 android:id="@+id/recharge_game_tag"
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
-                                android:layout_marginLeft="14dp"
                                 android:text="游戏充值"
                                 android:textColor="#666666"
                                 android:textSize="13sp" />
@@ -466,6 +486,21 @@
                                 android:layout_marginLeft="4dp"
                                 android:src="@mipmap/text_delete" />
                         </LinearLayout>
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="8dp"
+                            android:gravity="center_vertical"
+                            android:orientation="horizontal"
+                            android:padding="8dp">
+                            <TextView
+                                android:id="@+id/task_complete_tag"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="完成下面任务"
+                                android:textColor="#666666"
+                                android:textSize="13sp" />
+                        </LinearLayout>
                     </LinearLayout>
                 </LinearLayout>