コード例 #1
0
ファイル: DataLoader.cs プロジェクト: azezone/NGUIComptent
    /// <summary>
    /// 获取历史数据
    /// </summary>
    public void GetTabHistoryJsonData()
    {
        JPageRequest request = new JPageRequest();

        request.request = mURLTabHistory;
        request.tag     = Constant.TAB_PAGE_HTTPTAG;
        JPageRequestParams param = new JPageRequestParams();

        param.pageCategory = "";
        param.offset       = "";
        //param.vRFormat = vRFormat;
        request.param = param;

        string requestJson = JsonUtility.ToJson(request);

        //string funcName = "AddTabPageDataOnce";

        string[] tParam = new string[3];
        tParam[0] = gameObject.name;
        tParam[1] = "AddTabPageDataOnceCallBack";
        tParam[2] = requestJson;

#if !UNITY_EDITOR && UNITY_ANDROID
        AndroidInterface.CallAndroidFunction(mAndroidHttpRequest, tParam);
#elif UNITY_EDITOR || UNITY_IOS
        AddTabPageDataOnceCallBack(LoadJsonStrFromFile(historyJFileName));
#endif
    }
コード例 #2
0
ファイル: DataLoader.cs プロジェクト: azezone/NGUIComptent
    /// <summary>
    /// 获取搜索结果
    /// </summary>
    /// <param name="keyword"></param>
    public void GetSearchJsonData(string keyword, string goname, string funname)
    {
        JSearchRequest request = new JSearchRequest();

        request.request = mURLSearch;
        JSearchRequestParams param = new JSearchRequestParams();

        param.keyWords = keyword;
        request.param  = param;

        string requestJson = JsonUtility.ToJson(request);
        string u3dName     = goname;
        string funcName    = funname;

        string[] tParam = new string[3];
        tParam[0] = u3dName;
        tParam[1] = funcName;
        tParam[2] = requestJson;

#if !UNITY_EDITOR && UNITY_ANDROID
        AndroidInterface.CallAndroidFunction(mAndroidHttpRequest, tParam);
#elif UNITY_EDITOR
        string      mainJsonStr = LoadJsonStrFromFile(mainpageJFileName);
        JMainPage   page        = JsonUtility.FromJson <JMainPage>(mainJsonStr);
        JSearchData data        = new JSearchData();
        //page.data.feedStream
        data.videoList = new JFeedItem[20];
        for (int i = 0; i < data.videoList.Length; i++)
        {
            data.videoList[i] = page.data.feedStream[0];
        }
        CacheVoiceSearchData.Instance.FeedList = data;
#endif
    }
コード例 #3
0
 public static void CheckUpdate(string androidUrl)
 {
     AndroidInterface.CallRegister("checkUpdate", new object[]
     {
         androidUrl
     });
 }
コード例 #4
0
ファイル: DataLoader.cs プロジェクト: azezone/NGUIComptent
    /// <summary>
    /// 获取热搜关键字
    /// </summary>
    public void GetHotWordsJsonData()
    {
        JGetHotWordsRequest request = new JGetHotWordsRequest();

        request.request = mURLHotWords;

        string requestJson = JsonUtility.ToJson(request);
        string u3dName     = gameObject.name;
        string funcName    = "GetHotWordsJsonDataCallBack";

        string[] tParam = new string[3];
        tParam[0] = u3dName;
        tParam[1] = funcName;
        tParam[2] = requestJson;

#if !UNITY_EDITOR && UNITY_ANDROID
        AndroidInterface.CallAndroidFunction(mAndroidHttpRequest, tParam);
#elif UNITY_EDITOR
        JKeyWordsData data = new JKeyWordsData();
        data.hotKeywords    = new string[4];
        data.hotKeywords[0] = "五十度灰";
        data.hotKeywords[1] = "钢铁侠";
        data.hotKeywords[2] = "蜘蛛侠";
        data.hotKeywords[3] = "变形金刚";
        CacheVoiceSearchData.Instance.HotWords = data;
#endif
    }
コード例 #5
0
 public void GetChannelName()
 {
     LogSystem.LogWarning(new object[]
     {
         "GetChannelName"
     });
     AndroidInterface.GetChannelName();
 }
コード例 #6
0
 public void Init(PlatformUtils.InitFinishedCallBack callback)
 {
     this.initFinishedCallBack = callback;
     if (this.androidInterface == null)
     {
         this.androidInterface = base.gameObject.AddComponent <AndroidInterface>();
     }
     this.GetChannelAnySDK();
 }
コード例 #7
0
    public void Awake()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        androidInterface = new AndroidInterface();
        if (androidInterface != null)
        {
            Debug.Log("androidInterface aleard Create");
        }
#endif
    }
コード例 #8
0
    private void AndroidLoadLocalvideoImg(string imgurl, string videourl)
    {
        string[] tParam = new string[4];
        tParam[0] = this.gameObject.name;
        tParam[1] = "LoadImg";
        tParam[2] = imgurl;
        tParam[3] = videourl;

        AndroidInterface.CallAndroidFunction("getLocalVideoThumbnail", tParam);
    }
コード例 #9
0
    private void AndroidLoadImg(string url)
    {
        string[] tParam = new string[4];
        tParam[0] = this.gameObject.name;
        tParam[1] = "LoadImg";
        tParam[2] = url;
        tParam[3] = mParam;

        AndroidInterface.CallAndroidFunction("imageRequest", tParam);
    }
コード例 #10
0
 public static void StartInit(string objName, int screenOrientation, bool isDebug, int isAnysdk)
 {
     AndroidInterface.CallRegister("init", new object[]
     {
         objName,
         screenOrientation,
         isDebug,
         isAnysdk
     });
 }
コード例 #11
0
    public void OnGetChannelAnySDKCallBack(string str)
    {
        Config.bANYSDK = "ANYSDK".Equals(str);
        LogSystem.LogWarning(new object[]
        {
            "OnGetChannelAnySDKCallBack::",
            str,
            " ",
            Config.bANYSDK
        });
        int isAnysdk = (!Config.bANYSDK) ? 0 : 1;

        AndroidInterface.StartInit(Config.MessageName, 0, Config.debug, isAnysdk);
        if (!Config.bANYSDK)
        {
            this.GetChannelName();
        }
    }
コード例 #12
0
ファイル: DataLoader.cs プロジェクト: azezone/NGUIComptent
    /// <summary>
    /// 获取主页数据
    /// </summary>
    public void GetMainPageJsonData()
    {
        JMainPageRequest request = new JMainPageRequest();

        request.request = mURLMainPage;
        request.tag     = mURLMainPage;
        string requestJson = JsonUtility.ToJson(request);

        string[] tParam = new string[3];
        tParam[0] = this.gameObject.name;
        tParam[1] = "GetMainPageJsonDataCallBack";
        tParam[2] = requestJson;

#if !UNITY_EDITOR && UNITY_ANDROID
        AndroidInterface.CallAndroidFunction(mAndroidHttpRequest, tParam);
#elif UNITY_EDITOR || UNITY_IOS
        GetMainPageJsonDataCallBack(LoadJsonStrFromFile(mainpageJFileName));
#endif
    }
コード例 #13
0
ファイル: DataLoader.cs プロジェクト: azezone/NGUIComptent
    /// <summary>
    /// 根据剧集或者合集id来获取详细数据
    /// </summary>
    /// <param name="videosetId"></param>
    public void GetVideoList(string videosetId, string goname, string funname)
    {
        JVideoSetRequest tmp = new JVideoSetRequest();

        tmp.request = mURLVideoList;
        tmp.tag     = videosetId;
        JVideoSetParam jParam = new JVideoSetParam();

        jParam.setId = videosetId;
        tmp.param    = jParam;


        string param = JsonUtility.ToJson(tmp);

        string[] tParam = new string[3];
        tParam[0] = goname;
        tParam[1] = funname;
        tParam[2] = param;

#if !UNITY_EDITOR && UNITY_ANDROID
        AndroidInterface.CallAndroidFunction("httpRequest", tParam);
#endif
    }
コード例 #14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            ActionBar.Hide();
            this.Window.ClearFlags(WindowManagerFlags.Fullscreen);             //to hide
            SetContentView(Resource.Layout.Main);
            androidSetup();


            enterSolve.Click += (object sender, EventArgs e) =>
            {
                androidMatAppProcess();
            };

            enterClear.Click += (object sender, EventArgs e) =>
            {
                sol.resetExpressionList();
                sol = new StringObserver();
                AndroidInterface.resetTheDisplayList();
                sol.theVariableList     = new List <string>();
                theStringInput.Text     = "";
                theVariableAdapter      = new VariableListAdapter(this, sol.theVariableList);
                theVariableList.Adapter = theVariableAdapter;
                if (prefix)
                {
                    theVariableAdapter      = new VariableListAdapter(this, thePrefixList);
                    theVariableList.Adapter = theVariableAdapter;
                }
                if (constants)
                {
                    theVariableAdapter      = new VariableListAdapter(this, theConstantList);
                    theVariableList.Adapter = theVariableAdapter;
                }
                if (functions)
                {
                    theVariableAdapter      = new VariableListAdapter(this, theSimpleFunctionList);
                    theVariableList.Adapter = theVariableAdapter;
                }
                if (matfunctions)
                {
                    theVariableAdapter      = new VariableListAdapter(this, theMatrixFunctions);
                    theVariableList.Adapter = theVariableAdapter;
                }
            };

            plus.Click += (object sender, EventArgs e) =>
            {
                int pos = theStringInput.SelectionStart;
                theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "+");
                theStringInput.SetSelection(pos + 1);
            };

            minus.Click += (object sender, EventArgs e) =>
            {
                int pos = theStringInput.SelectionStart;
                theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "-");
                theStringInput.SetSelection(pos + 1);
            };

            multiply.Click += (object sender, EventArgs e) =>
            {
                int pos = theStringInput.SelectionStart;
                theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "*");
                theStringInput.SetSelection(pos + 1);
            };

            divide.Click += (object sender, EventArgs e) =>
            {
                int pos = theStringInput.SelectionStart;
                theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "/");
                theStringInput.SetSelection(pos + 1);
            };

            power.Click += (object sender, EventArgs e) =>
            {
                int pos = theStringInput.SelectionStart;
                theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "^(");
                theStringInput.SetSelection(pos + 2);
            };
            semiColon.Click += (object sender, EventArgs e) =>
            {
                int pos = theStringInput.SelectionStart;
                theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, ";");
                theStringInput.SetSelection(pos + 1);
            };

            smallBraketEnd.Click += (object sender, EventArgs e) =>
            {
                int pos = theStringInput.SelectionStart;
                theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, ")");
                theStringInput.SetSelection(pos + 1);
            };

            factorial.Click += (object sender, EventArgs e) =>
            {
                int pos = theStringInput.SelectionStart;
                theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "!");
                theStringInput.SetSelection(pos + 1);
            };

            smallBraketStart.Click += (object sender, EventArgs e) =>
            {
                int pos = theStringInput.SelectionStart;
                theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "(");
                theStringInput.SetSelection(pos + 1);
            };

            squareBraketEnd.Click += (object sender, EventArgs e) =>
            {
                int pos = theStringInput.SelectionStart;
                theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "]");
                theStringInput.SetSelection(pos + 1);
            };

            squareBraketStart.Click += (object sender, EventArgs e) =>
            {
                int pos = theStringInput.SelectionStart;
                theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "[");
                theStringInput.SetSelection(pos + 1);
            };

            cleanInput.Click += (object sender, EventArgs e) =>
            {
                theStringInput.Text = "";
            };

            theVariableList.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
            {
                string toBeAdded = string.Empty;
                if (variable)
                {
                    toBeAdded = (sol.theVariableList[e.Position]);
                }
                else if (prefix)
                {
                    toBeAdded = (thePrefixList[e.Position]);
                }
                else if (constants)
                {
                    toBeAdded = (theConstantList[e.Position]);
                    toBeAdded = MatApp.theConstantList.constantInputManager(toBeAdded);
                }
                else if (functions)
                {
                    toBeAdded = theSimpleFunctionList[e.Position];
                    toBeAdded = (cUnderstander.binCommandInputManager(toBeAdded));
                }
                else if (matfunctions)
                {
                    toBeAdded = theMatrixFunctions[e.Position];
                    toBeAdded = cUnderstander.matrixFunctionInputManager(toBeAdded);
                }
                int pos = theStringInput.SelectionStart;

                string theIn = theStringInput.Text;
                if (!string.IsNullOrWhiteSpace(theIn) && theIn.Length != theStringInput.SelectionStart)
                {
                    theIn = theIn.Remove(theStringInput.SelectionStart);
                }
                MatappAI.InputIntelligence intel = new MatappAI.InputIntelligence(theIn, toBeAdded);
                intel.constants    = MatApp.theConstantList.getConstantListForIntelligence();
                intel.variables    = sol.theVariableList;
                intel.prefix       = thePrefixList;
                intel.function     = theSimpleFunctionList;
                intel.matfunctions = theMatrixFunctionListForIntelligence;
                intel.Process();
                string r = intel.getResult();
                theStringInput.Text = theStringInput.Text.Insert(pos, r);
                theStringInput.SetSelection(pos + r.Length);
            };


            ShowVariable.Click += (object sender, EventArgs e) =>
            {
                variable     = true; constants = false; prefix = false; functions = false;
                matfunctions = false;                  //
                if (theStringInput.Text == "")
                {
                    theStringInput.Hint = "ƒ(x)";
                }
                androidSideBarButtonAction();
                theVariableAdapter      = new VariableListAdapter(this, sol.theVariableList);
                theVariableList.Adapter = theVariableAdapter;
            };

            ShowPrefix.Click += (object sender, EventArgs e) =>
            {
                variable     = false; constants = false; prefix = true; functions = false;
                matfunctions = false;
                if (theStringInput.Text == "")
                {
                    theStringInput.Hint = "ƒ(x)";
                }
                androidSideBarButtonAction();
                theVariableAdapter      = new VariableListAdapter(this, thePrefixList);
                theVariableList.Adapter = theVariableAdapter;
            };

            ShowConstants.Click += (object sender, EventArgs e) =>
            {
                variable     = false; constants = true; prefix = false; functions = false;
                matfunctions = false;
                if (theStringInput.Text == "")
                {
                    theStringInput.Hint = "ƒ(x)";
                }
                androidSideBarButtonAction();
                theVariableAdapter      = new VariableListAdapter(this, theConstantList);
                theVariableList.Adapter = theVariableAdapter;
            };

            ShowFunctions.Click += (object sender, EventArgs e) =>
            {
                variable     = false; constants = false; prefix = false; functions = true;
                matfunctions = false;
                if (theStringInput.Text == "")
                {
                    theStringInput.Hint = "ƒ(x)";
                }
                androidSideBarButtonAction();
                theVariableAdapter      = new VariableListAdapter(this, theSimpleFunctionList);
                theVariableList.Adapter = theVariableAdapter;
            };

            ShowMatrixFunctions.Click += (object sender, EventArgs e) =>
            {
                variable     = false; constants = false; prefix = false; functions = false;
                matfunctions = true;
                if (theStringInput.Text == "")
                {
                    theStringInput.Hint = "[ 3 3 ; 3 3] a 2x2 matrix";
                }
                androidSideBarButtonAction();
                theVariableAdapter      = new VariableListAdapter(this, theMatrixFunctions);
                theVariableList.Adapter = theVariableAdapter;
            };


            theStringInput.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
            {
                if (theSolutionOutput.Alpha == 0 && theReportMessageView.Alpha == 1)
                {
                    theSolutionOutput.Animate().AlphaBy(1.0f).SetDuration(500).Start();
                    theReportMessageView.Animate().AlphaBy(-1.0f).SetDuration(500).Start();
                }
            };
        }        // end method on create
コード例 #15
0
    public void GetChannelUniqueName()
    {
        string channelUniqueName = AndroidInterface.GetChannelUniqueName();

        this.OnGetChannelUniqueNameCallback(channelUniqueName);
    }
コード例 #16
0
 public void CheckUpdate(PlatformUtils.CheckUpdateHandler callback, string iosUrl, string androidUrl)
 {
     this.checkUpdateHandler = callback;
     AndroidInterface.CheckUpdate(androidUrl);
 }
コード例 #17
0
 public void GetCurrentVersion()
 {
     AndroidInterface.GetAppVersion();
 }
コード例 #18
0
 public static void GetAppVersion()
 {
     AndroidInterface.CallRegister("getAppVersion", new object[0]);
 }
コード例 #19
0
 public static string GetChannelAdressId()
 {
     return(AndroidInterface.getCallRegister("getChannelAdressId"));
 }
コード例 #20
0
 public static string GetChannelUniqueName()
 {
     return(AndroidInterface.getCallRegister("getChannelUniqueName"));
 }
コード例 #21
0
 public static void GetChannelName()
 {
     AndroidInterface.CallRegister("getChannelName", new object[0]);
 }
コード例 #22
0
    public void GetChannelAnySDK()
    {
        string callRegister = AndroidInterface.getCallRegister("getChannelAnySDK");

        this.OnGetChannelAnySDKCallBack(callRegister);
    }
コード例 #23
0
    public void GetChannelAdressId()
    {
        string channelAdressId = AndroidInterface.GetChannelAdressId();

        this.OnGetChannelAdressIdCallback(channelAdressId);
    }
コード例 #24
0
 public void U3DGetAllMemorySize()
 {
     AndroidInterface.CallRegister("getAllMemorySize", new object[0]);
 }