Преглед изворни кода

测试模式下可通过对话框弹出各种下载操作

zengjiebin пре 8 година
родитељ
комит
198341dd52

+ 12 - 0
app/src/main/java/com/kfzs/duanduan/react/ReactUtil.java

@@ -17,6 +17,18 @@ public class ReactUtil {
     /**
      * 是否进入rn调试模式
      */
+    public static final boolean isSmallDebug() {
+        File sdDir = null;
+        boolean sdCardExist = Environment.getExternalStorageState()
+                .equals(android.os.Environment.MEDIA_MOUNTED); //判断sd卡是否存在
+        if (sdCardExist) {
+            sdDir = Environment.getExternalStorageDirectory();//获取跟目录
+        }
+        return sdDir != null && new File(sdDir, "smallSheep.debug").exists();
+    }
+    /**
+     * 是否进入rn调试模式
+     */
     public static final boolean isRnDebug() {
         File sdDir = null;
         boolean sdCardExist = Environment.getExternalStorageState()

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java

@@ -26,6 +26,7 @@ import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
 import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
 import com.kfzs.duanduan.adp.AdpCommonRecy;
+import com.kfzs.duanduan.react.ReactUtil;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.RecyleObj;
 import com.sheep.gamegroup.model.entity.RecyleType;
@@ -260,7 +261,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
 
 
     public static void setDebugDownLoad(final Context context, View view, final TaskEty taskEty) {
-        if(BuildConfig.DEBUG){
+        if(BuildConfig.DEBUG || ReactUtil.isSmallDebug()){
             view.setOnLongClickListener(new View.OnLongClickListener() {
                 @Override
                 public boolean onLongClick(View view) {