Exemple #1
0
        public override void OnPause()
        {
            base.OnPause();
            var webViewContainer = RootLayout.FindViewById <RelativeLayout>(Resource.Id.webViewContainer);

            X5WebViewHelper.AttachedWebView(WebViewKey, webViewContainer);
        }
Exemple #2
0
        public void Init(IQFrameworkContainer container)
        {
            mRootLayout = new RootLayout();

            mFrameworkInfoLayout = new RootLayout();

            var frameworkData    = mPackageDatas.Find(packageData => packageData.Name == "Framework");
            var frameworkVersion = string.Format("QFramework:{0}", frameworkData.Version);

            mFrameworkInfoLayout
            // Framework 层
            .HorizontalLayout()
            .Label(150)
            .Text.Value(frameworkVersion)
            .End()
            .Toggle()
            .Text.Value("Version Check")
            .On.Bind(() => VersionCheck)
            .End()
            .End()     // end horizontal
                       // 工具栏
            .Toolbar(ToolbarIndex, ToolbarNames)
            .Index.Bind(() => ToolbarIndex)
            .End()
            .End();

            mFrameworkInfoLayout.BindViewModel(this);
        }
        /// <summary>
        /// Initializes this page to show whether at startup or from the settings page as about page
        /// </summary>
        /// <param name="asAbout"></param>
        public void Initialize(bool asAbout = false)
        {
            Titlebar.IsVisible      = true;
            WelcomContent.IsVisible = !asAbout;

            if (asAbout)
            {
                aboutModel     = new AboutModel();
                BindingContext = aboutModel;

                Titlebar.LeftButton.IsVisible = true;
                Titlebar.LeftButton.SetDynamicResource(StyleProperty, "BackButton");
                Titlebar.RightButton.IsVisible = false;
                LeftPageType = typeof(SettingsPage);

                RootLayout.RaiseChild(AboutContent);
            }
            else
            {
                Title = AppResource.AboutUpper;
                LblTitle.TextColor     = Color.FromHex("#F8A752");
                BtnToS.IsVisible       = true;
                BtnNext.IsVisible      = true;
                BtnVisitPage.IsVisible = true;

                RootLayout.RaiseChild(WelcomContent);
            }
        }
Exemple #4
0
        protected override bool ShouldRender()
        {
            var shouldRender = base.ShouldRender();

            if (shouldRender)
            {
                RootLayout.Update();
            }
            return(base.ShouldRender());
        }
Exemple #5
0
        /// <summary>
        /// 保存是否开启默认应用设置
        /// </summary>
        protected void SaveDefaultApp()
        {
            var ret = DictHelper.SaveSettings(new BootstrapDict[] {
                new BootstrapDict()
                {
                    Category = "网站设置",
                    Name     = "默认应用程序",
                    Code     = Model.DefaultApp ? "1" : "0"
                }
            });

            RootLayout?.OnWebFooterChanged(Model.Footer);
            ShowMessage("保存默认应用程序", ret);
        }
Exemple #6
0
        /// <summary>
        /// 保存网站页脚
        /// </summary>
        protected void SaveWebFooter()
        {
            var ret = DictHelper.SaveSettings(new BootstrapDict[] {
                new BootstrapDict()
                {
                    Category = "网站设置",
                    Name     = "网站页脚",
                    Code     = Model.Footer
                }
            });

            RootLayout?.OnWebFooterChanged(Model.Footer);
            ShowMessage("保存网站页脚", ret);
        }
        /// <summary>
        /// 保存網站標題
        /// </summary>
        protected void SaveWebTitle()
        {
            var ret = DictHelper.SaveSettings(new BootstrapDict[] {
                new BootstrapDict()
                {
                    Category = "網站設置",
                    Name     = "網站標題",
                    Code     = Model.Title
                }
            });

            RootLayout?.OnWebTitleChanged(Model.Title);
            ShowMessage("保存網站標題", ret);
        }
Exemple #8
0
        /// <summary>
        /// 保存显示名称方法
        /// </summary>
        protected void SaveDisplayName(EditContext context)
        {
            if (!string.IsNullOrEmpty(User.UserName))
            {
                var ret = UserHelper.SaveDisplayName(User.UserName, DisplayName);
                if (ret)
                {
                    User.DisplayName = DisplayName;
                    RootLayout?.OnDisplayNameChanged(DisplayName);
                }

                // 弹窗提示是否保存成功
                var result = ret ? "成功" : "失败";
                ShowMessage($"保存显示名称{result}", ret);
            }
        }
Exemple #9
0
 public void Dispose()
 {
     RootLayout?.SetTopSection(null);
 }
Exemple #10
0
 protected override void OnInitialized()
 {
     RootLayout.SetTopSection(this);
     base.OnInitialized();
 }
Exemple #11
0
 public void Init(IQFrameworkContainer container)
 {
     mRootLayout = new RootLayout();
 }
Exemple #12
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            RootLayout = inflater.Inflate(Resource.Layout.HomeMainVw, container, false);
            var barTableTextView = RootLayout.FindViewById <TextView>(Resource.Id.BarTitle);

            barTableTextView.Text = "我的";
            PageUrl          = "/User";
            PageId           = "我的个人中心";
            ParentWebViewKey = "";
            ParentPageId     = "";
            ParentPageUrl    = "";
            var pageParam = new PageParam()
            {
                PageUrl       = PageUrl,
                PageId        = PageId,
                ParentPageId  = "",
                ParentPageUrl = ""
            };

            if (AnalyticAgreement.PageParam.ContainsKey(pageParam.PageId))
            {
                AnalyticAgreement.PageParam[pageParam.PageId] = pageParam;
            }
            else
            {
                AnalyticAgreement.PageParam.Add(pageParam.PageId, pageParam);
            }
            if (X5WebViewHelper.PageActivity.ContainsKey(pageParam.PageId))
            {
                X5WebViewHelper.PageActivity[pageParam.PageId] = this.Activity;
            }
            else
            {
                X5WebViewHelper.PageActivity.Add(PageId, this.Activity);
            }
            //webView设置
            pageParam.WebViewKey = X5WebViewHelper.WebViewInit(PageId);
            WebViewKey           = pageParam.WebViewKey;


            //var router = "{ path: '" + pageParam.PageUrl + "', params: { PageId: '" + PageId + "' }}";
            if (string.IsNullOrWhiteSpace(pageParam.OpenParam))
            {
                pageParam.OpenParam = "";
            }
            pageParam.OpenParam = pageParam.OpenParam.Replace("'", "```").Replace("\"", "~~~");
            var router = pageParam.PageUrl + "/" + pageParam.OpenParam;

            AnalyticAgreement.AgreementProvider.ExecuteJavaScript(pageParam.PageId, $@"window.AppBridge.Router.push(""{router}"")");
            AnalyticAgreement.AgreementProvider.ExecuteJavaScript(pageParam.PageId, $@"window.AppBridge.SetPageId(""{pageParam.ParentPageId}"",""{pageParam.PageId}"")");

            //隐藏导航条
            var rlTitle = RootLayout.FindViewById <RelativeLayout>(Resource.Id.rlTitle);

            rlTitle.Visibility = ViewStates.Gone;
            //隐藏返回按钮
            var btnReturn = RootLayout.FindViewById <LinearLayout>(Resource.Id.btnReturn);

            btnReturn.Visibility = ViewStates.Gone;
            //隐藏右侧按钮
            var txtRight = RootLayout.FindViewById <TextView>(Resource.Id.txtRight);

            txtRight.Visibility = ViewStates.Gone;

            return(RootLayout);
        }
Exemple #13
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            RootLayout = inflater.Inflate(Resource.Layout.HomeMainVw, container, false);
            var barTableTextView = RootLayout.FindViewById <TextView>(Resource.Id.BarTitle);

            barTableTextView.Text = "LCL";
            PageUrl          = "/LCL";
            PageId           = "ÎÒµÄÊ×Ò³";
            ParentWebViewKey = "";
            ParentPageId     = "";
            ParentPageUrl    = "";
            var pageParam = new PageParam()
            {
                PageUrl       = PageUrl,
                PageId        = PageId,
                ParentPageId  = "",
                ParentPageUrl = ""
            };

            if (AnalyticAgreement.PageParam.ContainsKey(pageParam.PageId))
            {
                AnalyticAgreement.PageParam[pageParam.PageId] = pageParam;
            }
            else
            {
                AnalyticAgreement.PageParam.Add(pageParam.PageId, pageParam);
            }
            if (X5WebViewHelper.PageActivity.ContainsKey(pageParam.PageId))
            {
                X5WebViewHelper.PageActivity[pageParam.PageId] = this.Activity;
            }
            else
            {
                X5WebViewHelper.PageActivity.Add(PageId, this.Activity);
            }
            //webViewÉèÖÃ
            pageParam.WebViewKey = X5WebViewHelper.WebViewInit(PageId);
            WebViewKey           = pageParam.WebViewKey;

            //var router = "{ path: '" + pageParam.PageUrl + "', params: { PageId: '" + PageId + "' }}";
            if (string.IsNullOrWhiteSpace(pageParam.OpenParam))
            {
                pageParam.OpenParam = "";
            }
            pageParam.OpenParam = pageParam.OpenParam.Replace("'", "```").Replace("\"", "~~~");
            var router = pageParam.PageUrl + "/" + pageParam.OpenParam;
            var js     = $@"window.AppBridge.Router.push(""{router}"")";

            AnalyticAgreement.AgreementProvider.ExecuteJavaScript(pageParam.PageId, js);
            AnalyticAgreement.AgreementProvider.ExecuteJavaScript(pageParam.PageId, $@"window.AppBridge.SetPageId(""{pageParam.ParentPageId}"",""{pageParam.PageId}"")");


            //Òþ²Øµ¼º½Ìõ
            var rlTitle = RootLayout.FindViewById <RelativeLayout>(Resource.Id.rlTitle);

            rlTitle.Visibility = ViewStates.Gone;
            //Òþ²Ø·µ»Ø°´Å¥
            var btnReturn = RootLayout.FindViewById <LinearLayout>(Resource.Id.btnReturn);

            btnReturn.Visibility = ViewStates.Gone;
            //Òþ²ØÓҲఴť
            var txtRight = RootLayout.FindViewById <TextView>(Resource.Id.txtRight);

            txtRight.Visibility = ViewStates.Gone;
            //ÓҲఴťÃû×Ö
            txtRight.Text = "ÏûÏ¢";
            //ÓҲఴťÏìÓ¦
            var btnRight = RootLayout.FindViewById <LinearLayout>(Resource.Id.btnRight);

            btnRight.Click += (sender, args) =>
            {
                //var intent = new Intent(this.Activity, typeof(ChatMain));
                //intent.PutExtra("pram", "1");
                //StartActivity(intent);
                new ChatMain(PageId);
            };

            return(RootLayout);
        }