Commit 89afe4b2 89afe4b25ec061b28663b50a138d74a4576601ab by 金学艇

1.优化项目列表

1 parent f5be29dc
Showing 21 changed files with 33 additions and 53 deletions
......@@ -525,7 +525,7 @@ cc.Class({
try {
cc.log("onCheckQueryNewTV start...");
this._cLog.screenI("SubIndex拿到播放播放地址" + options);
// jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "checkQueryNewTV", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", options, "onGetPlayURL", "checkQueryFail");
// jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "checkQueryNewTV", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", options, "onGetPlayURL", "checkQueryFail");
this._ComOperation.initPlayer(0, 0, Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, true, true); //测试
let options = {};
......
......@@ -91,6 +91,9 @@ cc.Class({
},
saveHistory: function () {
if (!this._oSceneContext._cellData) {
return;
}
var oDataCell = JSON.parse(this._oSceneContext._cellData);
var gameHistory = JSON.parse(cc.sys.localStorage.getItem("gameHistoryList"));
if (gameHistory != null) {
......@@ -201,9 +204,9 @@ cc.Class({
return;
}
if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就判断奥比游戏
jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "isExistObiApk", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "callBackExistApk");
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "isExistObiApk", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "callBackExistApk");
} else {
jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "isExistApk", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "callBackExistApk");
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "isExistApk", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "callBackExistApk");
}
},
......@@ -495,13 +498,13 @@ cc.Class({
}
if (this._bIsExistApk == "true") {
if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就启动奥比游戏
jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "startOBiGame", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", Common.TOPDRAW_API_SERVER + this._oSceneContext._downloadUrl, this._oSceneContext._packageName, this._oSceneContext._className, "");
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "startOBiGame", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", Common.TOPDRAW_API_SERVER + this._oSceneContext._downloadUrl, this._oSceneContext._packageName, this._oSceneContext._className, "");
} else {
//这里应该转圈圈等待加载游戏
// cc.find("LoadingLabel", this.node).opacity = 255;
// cc.find("Loading/LoadingIcon", this.node).opacity = 255;
// cc.find("Loading/LoadingIcon", this.node).getComponent(cc.Animation).play();
jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "startGame", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "");
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "startGame", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "");
}
} else {
this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
......
......@@ -41,9 +41,9 @@ cc.Class({
return;
}
if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就启动奥比游戏
jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "startOBiGame", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._downloadUrl, this._oSceneContext._packageName, this._oSceneContext._className, "updateProgress");
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "startOBiGame", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._downloadUrl, this._oSceneContext._packageName, this._oSceneContext._className, "updateProgress");
} else {
jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "startGame", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "updateProgress");
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "startGame", "(Ljava/lang/String;Ljava/lang/String;)V", this._oSceneContext._packageName, "updateProgress");
}
},
......@@ -101,7 +101,7 @@ cc.Class({
case Common.ANDROID_KEY.back:
this._bIsFocusInit = true;
if (this._oSceneContext._downloadUrl && this._oSceneContext._downloadUrl != "undefined") { //如果有下载地址就启动奥比游戏
jsb.reflection.callStaticMethod("com/topdraw/melody/TopdrawSDKWrapper", "closeDownloadObiApk", "()V");
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/common/TopdrawSDKWrapper", "closeDownloadObiApk", "()V");
}
this.backAScene();
break;
......
const player = "com/topdraw/component/CocosMediaPlayer";
const player = "org/cocos2dx/javascript/component/CocosMediaPlayer";
const CALLBACK_FUNCS = {
INFO: null,
......
......@@ -31,7 +31,7 @@
<application
android:allowBackup="true"
android:name="com.topdraw.melody.MelodyApplication"
android:name="org.cocos2dx.javascript.common.MelodyApplication"
android:label="@string/app_name"
android:icon="@mipmap/icon">
......
......@@ -26,7 +26,6 @@ package org.cocos2dx.javascript;
import org.cocos2dx.lib.Cocos2dxActivity;
import org.cocos2dx.lib.Cocos2dxGLSurfaceView;
import org.cocos2dx.lib.Cocos2dxJavascriptJavaBridge;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
......@@ -37,27 +36,21 @@ import android.os.Bundle;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Environment;
import android.os.Handler;
import android.provider.Settings;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.topdraw.component.CocosMediaPlayer;
import org.cocos2dx.javascript.component.CocosMediaPlayer;
import com.topdraw.forfun.R;
import com.topdraw.melody.CommonUtils;
import com.topdraw.melody.MelodyApplication;
import com.topdraw.melody.TopdrawSDKWrapper;
import org.cocos2dx.javascript.common.CommonUtils;
import org.cocos2dx.javascript.common.MelodyApplication;
import org.cocos2dx.javascript.common.TopdrawSDKWrapper;
public class AppActivity extends Cocos2dxActivity {
private static String TAG = "AppActivity";
......
package com.topdraw.melody;
package org.cocos2dx.javascript.common;
import android.content.Context;
import android.os.Environment;
import android.os.Handler;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
/**
......
package com.topdraw.melody;
package org.cocos2dx.javascript.common;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Environment;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
......@@ -21,8 +19,6 @@ import com.topdraw.forfun.R;
import com.topdraw.sdk.*;
import java.io.File;
import java.io.IOException;
import java.util.*;
import org.cocos2dx.javascript.AppActivity;
import org.json.JSONArray;
......
package com.topdraw.component;
package org.cocos2dx.javascript.component;
import android.app.Activity;
import android.content.Context;
......@@ -7,7 +7,7 @@ import android.os.Message;
import android.util.Log;
import android.widget.FrameLayout;
import com.topdraw.component.player.AndroidMediaPlayer;
import org.cocos2dx.javascript.component.player.AndroidMediaPlayer;
//import com.topdraw.component.player.NewTVMediaPlayer;
//import com.topdraw.component.player.VitamioMediaPlayer;
......
package com.topdraw.component.player;
package org.cocos2dx.javascript.component.player;
import android.content.Context;
import android.graphics.PixelFormat;
......@@ -10,8 +10,8 @@ import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.FrameLayout;
import com.topdraw.component.CocosMediaPlayer;
import com.topdraw.component.IMediaPlayer;
import org.cocos2dx.javascript.component.CocosMediaPlayer;
import org.cocos2dx.javascript.component.IMediaPlayer;
import java.io.IOException;
......
......@@ -6,8 +6,8 @@
//import android.util.Log;
//import android.widget.FrameLayout;
//
//import com.topdraw.component.CocosMediaPlayer;
//import com.topdraw.component.IMediaPlayer;
//import CocosMediaPlayer;
//import IMediaPlayer;
//
//import org.json.JSONException;
//import org.json.JSONObject;
......
package com.topdraw.component.player;//package com.topdraw.component.player;
package org.cocos2dx.javascript.component.player;//package com.topdraw.component.player;
//
//import android.content.Context;
//import android.graphics.PixelFormat;
......@@ -8,8 +8,8 @@ package com.topdraw.component.player;//package com.topdraw.component.player;
//import android.view.SurfaceView;
//import android.widget.FrameLayout;
//
//import com.topdraw.component.CocosMediaPlayer;
//import com.topdraw.component.IMediaPlayer;
//import CocosMediaPlayer;
//import IMediaPlayer;
//
//import java.io.IOException;
//
......