Commit abf592aa authored by LiLiuZhou's avatar LiLiuZhou

Merge branch 'master' of gitlab.huolea.com:wangxuewei/musicbigwatermelon

parents 58d7062f 35e79f27
fileFormatVersion: 2
guid: e726c6009fdaa8040b670dae4de8ad0b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
package com.ym.unityandroid.webview;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Build;
import android.util.AttributeSet;
import android.webkit.WebView;
public class UnityCustomWebView extends WebView {
public UnityCustomWebView(Context context) {
super(getFixedContext(context));
}
public UnityCustomWebView(Context context, AttributeSet attrs) {
super(getFixedContext(context), attrs);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public UnityCustomWebView(Context context, AttributeSet attrs, int defStyleAttr) {
super(getFixedContext(context), attrs, defStyleAttr);
}
public UnityCustomWebView(Context context, AttributeSet attrs, int defStyleAttr, boolean privateBrowsing) {
super(getFixedContext(context), attrs, defStyleAttr, privateBrowsing);
}
public static Context getFixedContext(Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
setWebContentsDebuggingEnabled(true);
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return context.createConfigurationContext(new Configuration());
} else {
return context;
}
}
}
fileFormatVersion: 2
guid: dca9c2dd0eedf764d9aabbf83647e07f
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
package com.ym.unityandroid.webview;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Message;
import android.view.View;
import android.webkit.DownloadListener;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.unity3d.player.R;
public class UnityWebActivity extends Activity {
private String url;
private UnityCustomWebView webView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.unity_activity_web);
url = getIntent().getStringExtra("url");
//title = getIntent().getStringExtra("title");
webView = findViewById(R.id.activity_webview);
initTitle();
initWebView();
webView.loadUrl(url);
}
private void initWebView() {
WebSettings webSettings = webView.getSettings();
webSettings.setSupportZoom(true); //支持缩放,默认为true。是下面那个的前提。
webSettings.setBuiltInZoomControls(true); //设置内置的缩放控件。若为false,则该WebView不可缩放
webSettings.setDisplayZoomControls(false); //隐藏原生的缩放控件
webSettings.setAllowFileAccess(true); //设置可以访问文件
webSettings.setJavaScriptCanOpenWindowsAutomatically(true); //支持通过JS打开新窗口
webSettings.setLoadsImagesAutomatically(true); //支持自动加载图片
webSettings.setDefaultTextEncodingName("utf-8");//设置编码格式
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true);
// webView.getSettings().setDefaultFontSize(56);
// webView.getSettings().setMinimumFontSize(40);//设置最小字体
// 建议禁止缓存加载,以确保在攻击发生时可快速获取最新的滑动验证组件进行对抗。
webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
// 设置不使用默认浏览器,而直接使用WebView组件加载页面。
// 设置WebView组件支持加载JavaScript。
webView.getSettings().setJavaScriptEnabled(true);
// 建立JavaScript调用Java接口的桥梁。
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
try {
// API 7, LocalStorage/SessionStorage
webSettings.setDomStorageEnabled(true);
webSettings.setDatabaseEnabled(true);
// webSettings.setDatabasePath(HcAppliContext.get().filesDir.absolutePath + "/webcache");
// API 7, Web SQL Database, 需要重载方法(WebChromeClient)才能生效,无法只通过反射实现
} catch (Exception e) {
}
webView.setWebChromeClient(new WebChromeClient(){
@Override
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
WebView.WebViewTransport transport = (WebView.WebViewTransport)resultMsg.obj;
transport.setWebView(webView);
resultMsg.sendToTarget();
return true;
}
});
webView.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse(url));
startActivity(intent);
}
});
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url!=null){
if (shouldOverrideUrlLoadingByApp(url)) {
return true;
}
}
return super.shouldOverrideUrlLoading(view, url);
}
});
}
private void initTitle() {
findViewById(R.id.iv_user_toolbar_back).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
}
@Override
protected void onResume() {
super.onResume();
if (webView != null) {
webView.loadUrl("javascript:onResume()");
}
}
@Override
protected void onPause() {
super.onPause();
if (webView != null) {
webView.loadUrl("javascript:onPause()");
}
}
@Override
protected void onDestroy() {
super.onDestroy();
if (webView != null) {
webView.destroy();
}
}
private boolean shouldOverrideUrlLoadingByApp(String url){
try {
if (!url.startsWith("http") && !url.startsWith("https") && !url.startsWith("ftp")) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
if (isInstall(intent)) {
this.startActivity(intent);
return true;
}
} else {
return false;
}
} catch (Exception e ) {
return false;
}
return false;
}
//判断app是否安装
public static Boolean isInstall(Intent intent) {
return false;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 8c70ddc179db3e64192da43e41d152d9
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/id_rl_toolbar"
android:layout_width="match_parent"
android:layout_height="50dp">
<ImageView
android:id="@+id/iv_user_toolbar_back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:src="@mipmap/arrow_left" />
<TextView
android:id="@+id/tv_user_toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="#000000"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<com.ym.unityandroid.webview.UnityCustomWebView
android:id="@+id/activity_webview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
fileFormatVersion: 2
guid: 15ef9b5fad1b531438af19bdbda506e4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 823eccbbcfeb9bd49907b19a89b23d24
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 4e2628f00351e354eb2f11b4904388fb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<!--为了适配所有路径可以设置 path = "." -->
<external-path name="download" path="." />
<external-files-path name="external_file" path="." />
<external-cache-path name="external_cache" path="." />
<files-path name="files" path="." />
<cache-path name="cache" path="." />
</paths>
fileFormatVersion: 2
guid: a0ab4bd32e8dc744f82d0dcd762eab51
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -25,37 +25,4 @@ public class GameController : MonoBehaviour ...@@ -25,37 +25,4 @@ public class GameController : MonoBehaviour
//红线高度 //红线高度
public float RedLinePosY => ColliderAdapter.Instance.RedLinePosY; public float RedLinePosY => ColliderAdapter.Instance.RedLinePosY;
<<<<<<< HEAD
/// <summary>
/// 获取接下来将要掉落的音符组及所属歌曲
/// </summary>
public void GetNextNoteList(int song_id)
{
Dictionary<string, object> paras = new Dictionary<string, object>();
paras.Add("song_id", song_id);
HttpTool.Instance._Get("app/v1/watermelon/notes", paras, new Action<List<string>>((result) =>
{
Debug.unityLogger.Log("");
}), new Action<string, string>((code, msg) =>
{
Debug.unityLogger.Log("获取下一组生成的球 " + code + " msg " + msg);
}));
}
=======
/// <summary>
/// 获取提现列表
/// 类型(1 合成提现,3大额提现)
/// </summary>
public void GetWithdrawList(int type)
{
Dictionary<string, object> paras = new Dictionary<string, object>();
paras.Add("type", type);
HttpTool.Instance._Get("app/v1/watermelon/list_wd", paras, new Action<WithDrawBean>((result) =>
{
>>>>>>> 71cb07ae8564a188b735be49fa9ff46c44542906
} }
...@@ -27,14 +27,6 @@ public class HomeInfoControl : MonoBehaviour ...@@ -27,14 +27,6 @@ public class HomeInfoControl : MonoBehaviour
#endif #endif
EventCenter.Getinstance().EventTrigger("RegisterPanel"); EventCenter.Getinstance().EventTrigger("RegisterPanel");
<<<<<<< HEAD
//GameController.GetInstance().GetWithdrawList(1);
GameController.GetInstance().GetReward();
=======
GameController.GetInstance().GetWithdrawList(1);
>>>>>>> 71cb07ae8564a188b735be49fa9ff46c44542906
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment