|
...
|
...
|
@@ -21,6 +21,7 @@ import android.webkit.WebViewClient; |
|
|
|
|
|
|
|
import com.agg.h5game.tools.AggH5Log;
|
|
|
|
import com.agg.h5game.tools.AggH5Tools;
|
|
|
|
import com.agg.h5game.tools.MResource;
|
|
|
|
import com.agg.h5game.tools.ParamsTools;
|
|
|
|
import com.stss.sdk.InitResult;
|
|
|
|
import com.stss.sdk.PayResult;
|
|
...
|
...
|
@@ -59,7 +60,7 @@ public class AggH5MainActivity extends Activity { |
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
mContext = this;
|
|
|
|
|
|
|
|
setContentView(R.layout.activity_main);
|
|
|
|
setContentView(MResource.getIdByName(mContext, "layout", "activity_main"));
|
|
|
|
initView();
|
|
|
|
initSDK();
|
|
|
|
|
|
...
|
...
|
@@ -67,7 +68,7 @@ public class AggH5MainActivity extends Activity { |
|
|
|
if (!TextUtils.isEmpty(gameUrl)) {
|
|
|
|
h5game = gameUrl;
|
|
|
|
}
|
|
|
|
h5game = String.format(h5game, STSSConstants.sdkParams.getGame_id(),"0");
|
|
|
|
h5game = String.format(h5game, STSSConstants.sdkParams.getGame_id(), STSSConstants.sdkParams.getCurrChannel());
|
|
|
|
String newH5Url = h5game + "?" + ParamsTools.getParams(mContext, currToken);
|
|
|
|
AggH5Log.d(TAG, newH5Url);
|
|
|
|
webView.loadUrl(newH5Url);
|
|
...
|
...
|
@@ -75,7 +76,7 @@ public class AggH5MainActivity extends Activity { |
|
|
|
|
|
|
|
private void initView() {
|
|
|
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
|
|
|
webView = findViewById(R.id.webview);
|
|
|
|
webView = findViewById(MResource.getIdByName(mContext, "id", "webview"));
|
|
|
|
webView.addJavascriptInterface(new AggH5AndroidToJs(), "AggH5Game");
|
|
|
|
|
|
|
|
//页面缩放,适应手机屏幕
|
|
...
|
...
|
@@ -112,7 +113,12 @@ public class AggH5MainActivity extends Activity { |
|
|
|
public void onPageFinished(WebView view, String url) {
|
|
|
|
super.onPageFinished(view, url);
|
|
|
|
AggH5Log.d(TAG, "url for finish: " + url);
|
|
|
|
login();
|
|
|
|
new Handler().postDelayed(new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
login();
|
|
|
|
}
|
|
|
|
}, 1500);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
...
|
...
|
|