コード例 #1
0
        public override void OnWindowFocusChanged(bool hasFocus)
        {
            base.OnWindowFocusChanged(hasFocus);

            if (MainHeaderBottom <= 0)
            {
                var   llTabContainer = FindViewById <View>(Resource.Id.llTabContainer);
                int[] locations      = new int[2];
                llTabContainer.GetLocationInWindow(locations);
                MainHeaderBottom = locations[1] - StatusBarTintHelper.GetStatusBarHeight();
            }

            //  llHeader.LayoutParameters.Height = MainHeaderBottom  + (int)MainApp.ThisApp.Resources.GetDimension(Resource.Dimension.fixedbar_height);
        }
コード例 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            StatusBarTintHelper.SetStatusBarColor(this);

            //// Create your application here
            SetContentView(Resource.Layout.settings_board_activity);

            llRootView = FindViewById <LinearLayout>(Resource.Id.llRootView);

            FindViewById <LinearLayout>(Resource.Id.llStatusBarStub).LayoutParameters =
                new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, StatusBarTintHelper.GetStatusBarHeight());

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar_actionbar);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
            wvContent = FindViewById <WebView>(Resource.Id.wvContent);
            wvContent.Settings.JavaScriptEnabled = true;
            wvContent.AddJavascriptInterface(this, "wst");

            var HtmlTemplate = "";

            using (var sr = new StreamReader(MainApp.ThisApp.Assets.Open("wst.html")))
            {
                HtmlTemplate = sr.ReadToEnd();
            }

            var taskName = this.Intent.GetStringExtra(SettingsBoardActivity.FunctionKey);

            taskId = Guid.Parse(this.Intent.GetStringExtra("taskid"));

            HtmlTemplate = HtmlTemplate.Replace("##任务名称##", taskName);



            wvContent.LoadDataWithBaseURL(
                "file:///android_asset/html/",
                HtmlTemplate,
                "text/html",
                "utf-8",
                null);
            _nfcAdapter = NfcAdapter.GetDefaultAdapter(this);
        }
コード例 #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            this.Window.SetSoftInputMode(SoftInput.AdjustResize);

            StatusBarTintHelper.SetStatusBarColor(this);

            AsyncUIOperationRepeater.INSTATNCE.RegisterAsyncTaskActivity(this);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.login_activity);

            rlRoot = FindViewById <RelativeLayout>(Resource.Id.rlRoot);
            ivLogo = FindViewById <ImageView>(Resource.Id.ivLogo);
            flSoftKeyboardProber = FindViewById <FrameLayout>(Resource.Id.flSoftKeyboardProber);
            frgForm = FindViewById <FrameLayout>(Resource.Id.frgForm);

                        #if PREVIEW
            FindViewById <ImageView>(Resource.Id.ivLogo).LongClick += delegate {
                AllowDebug = true;
                Toast.MakeText(this, "Allow Debug", ToastLength.Short).Show();
            };
                        #endif

            //*
            rlRoot.Click += delegate
            {
                HideSoftKeyboard();
            };
            //*/

            rlRoot.ViewTreeObserver.AddOnGlobalLayoutListener(this);

            if (savedInstanceState != null)
            {
                asyncTaskActivityUUID = savedInstanceState.GetString(
                    AsyncUIOperationRepeater.ASYNC_ACTIVITY_GUID);
            }

            if (DataCache.INSTATNCE.ServiceCountryList != null)
            {
                InitActivity();
            }
        }
コード例 #4
0
        protected override void OnResume()
        {
            base.OnResume();
            AsyncUIOperationRepeater.INSTATNCE.RegisterAsyncTaskActivity(this);
            AsyncUIOperationRepeater.INSTATNCE.ExecutePendingUIOperation(this);

            llHeader.LayoutParameters.Height = MainHeaderBottom
                                               + StatusBarTintHelper.GetStatusBarHeight()
                                               + (int)MainApp.ThisApp.Resources.GetDimension(Resource.Dimension.fixedbar_height);

            if (dlRightDrawer.IsDrawerOpen(flRightDrawerPanelContainer))
            {
                hrcAdaptor.RefreshHisoryList();
                tvNoHistoryMessageInDrawer.Visibility =
                    hrcAdaptor.ItemCount == 0
                        ? ViewStates.Visible : ViewStates.Gone;
            }
        }
コード例 #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            if (savedInstanceState != null)
            {
                checkedColorIndex = savedInstanceState.GetInt(CheckedColorIndexKey, 0);
            }
            else
            {
                checkedColorIndex = 0;
            }

            StatusBarTintHelper.SetStatusBarColor(this);

            // Create your application here
            SetContentView(Resource.Layout.annotations_newtag_activity);

            llRootView        = FindViewById <LinearLayout>(Resource.Id.llRootView);
            etTagName         = FindViewById <EditText>(Resource.Id.etTagName);
            llColorsContainer = FindViewById <LinearLayout>(Resource.Id.llColorsContainer);

            llRootView.Click += delegate
            {
                HideSoftKeyboard();
            };

            etTagName.AddTextChangedListener(new TagNameWatcher(this));

            FindViewById <LinearLayout>(Resource.Id.llStatusBarStub).LayoutParameters =
                new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, StatusBarTintHelper.GetStatusBarHeight());

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar_actionbar);
            SetSupportActionBar(toolbar);

            toolbar.SetNavigationIcon(Resource.Drawable.cancel_icon);
            Title = MainApp.ThisApp.Resources.GetString(Resource.String.AnnotationNewTagPage_NewTag);
        }
コード例 #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            StatusBarTintHelper.SetStatusBarColor(this);

            // Create your application here
            SetContentView(Resource.Layout.annotations_edittags_activity);

            llRootView = FindViewById <LinearLayout>(Resource.Id.llRootView);

            FindViewById <View>(Resource.Id.ivAddTag).Click += delegate
            {
                var intent = new Intent(this, typeof(NewTagActivity));
                StartActivity(intent);
            };

            FindViewById <LinearLayout>(Resource.Id.llStatusBarStub).LayoutParameters =
                new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, StatusBarTintHelper.GetStatusBarHeight());

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar_actionbar);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            Title = MainApp.ThisApp.Resources.GetString(Resource.String.AnnotationEditTagsPage_EditTags);

            //------------------------
            rcAnnotationList = FindViewById <RecyclerView>(Resource.Id.rcAnnotationList);
            var llm = new LinearLayoutManager(this);

            llm.Orientation = LinearLayoutManager.Vertical;
            llm.ScrollToPosition(0);
            rcAnnotationList.SetLayoutManager(llm);

            var tagm = new RecyclerViewTouchActionGuardManager();

            tagm.SetInterceptVerticalScrollingWhileAnimationRunning(true);
            tagm.Enabled = true;

            var ddm = new RecyclerViewDragDropManager();

            ddm.SetInitiateOnLongPress(true);
            ddm.SetInitiateOnMove(false);

            var sm = new RecyclerViewSwipeManager();

            sm.UserHandleSwipeUi = true;

            var sa = new EditTagsListAdaptor(this);

            sa.SetTagList(tagList);

            RecyclerView.Adapter wrappedAdapter = ddm.CreateWrappedAdapter(sa);
            wrappedAdapter = sm.CreateWrappedAdapter(wrappedAdapter);

            GeneralItemAnimator ia = new SwipeDismissItemAnimator();

            rcAnnotationList.SetAdapter(wrappedAdapter);
            rcAnnotationList.SetItemAnimator(ia);

            tagm.AttachRecyclerView(rcAnnotationList);
            sm.AttachRecyclerView(rcAnnotationList);
            ddm.AttachRecyclerView(rcAnnotationList);
        }
コード例 #7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            StatusBarTintHelper.SetStatusBarColor(this);

            if (savedInstanceState != null)
            {
                asyncTaskActivityGUID = savedInstanceState.GetString(
                    AsyncUIOperationRepeater.ASYNC_ACTIVITY_GUID);
                //if (NavigationManager.Instance.Records.Count == 0)
                //{
                //    // We need not restore data while navigation manager has valid record list.
                //    var navigationCache = FileCacheHelper.ReadCacheFile(
                //        CacheCatagory, string.Format(NavigationCacheFile, asyncTaskActivityGUID));
                //    if (navigationCache != null)
                //    {
                //        NavigationManager.Instance.RestoreRecords(navigationCache);
                //    }

                //    var indexCache = FileCacheHelper.ReadCacheFile(
                //        CacheCatagory, string.Format(IndexCacheFile, asyncTaskActivityGUID));
                //    if (indexCache != null)
                //    {
                //        DataCache.INSTATNCE.IndexList =
                //            JsonConvert.DeserializeObject<PublicationIndexStatus>(indexCache);
                //    }
                //}
            }

            if (string.IsNullOrEmpty(asyncTaskActivityGUID))
            {
                asyncTaskActivityGUID = Guid.NewGuid().ToString();
            }

            SetContentView(Resource.Layout.content_activity);

            //legalDefinePopup = new LegalDefinePopup(this, OnUserDismissLegalDefinePopup);

            FindViewById <LinearLayout>(Resource.Id.llStatusBarStub).LayoutParameters =
                new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, StatusBarTintHelper.GetStatusBarHeight());

            // Fake Update
            //publication.Value.UpdateCount = 3;

            if (Publication == null)
            {
                CloseContent();
                return;
            }


            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar_actionbar);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.Title = Publication.Value.Name;

            dlRightDrawer = FindViewById <DrawerLayout>(Resource.Id.dlRightDrawer);
            flRightDrawerPanelContainer = FindViewById <FrameLayout>(Resource.Id.flRightDrawerPanelContainer);
            llHeader = FindViewById <LinearLayout>(Resource.Id.llHeader);
            tvNoHistoryMessageInDrawer = FindViewById <TextView>(Resource.Id.tvNoHistoryMessageInDrawer);

            // Set the shadow layer of drawer layout to totally transparent
            dlRightDrawer.SetScrimColor(Color.Transparent);
            dlRightDrawer.DrawerStateChanged += (object sender, DrawerLayout.DrawerStateChangedEventArgs e) =>
            {
                if (e.NewState == 1)
                {
                    // STATE_DRAGGING
                    // Indicates that a drawer is currently being dragged by the user.
                    hrcAdaptor.RefreshHisoryList();
                    tvNoHistoryMessageInDrawer.Visibility = hrcAdaptor.ItemCount == 0 ? ViewStates.Visible : ViewStates.Gone;
                }
            };

            //rcHistoryList = FindViewById<RecyclerView>(Resource.Id.rcHistoryList);
            //historylistLayoutManager = new LinearLayoutManager(this);
            //historylistLayoutManager.Orientation = LinearLayoutManager.Vertical;
            //rcHistoryList.SetLayoutManager(historylistLayoutManager);
            //hrcAdaptor = new HistoryListAdaptor(
            //    this,
            //    Resource.Layout.content_historylist_item,
            //    OnRecentHistoryItemClick);
            //rcHistoryList.SetAdapter(hrcAdaptor);

            frgContainer = FindViewById <FrameLayout>(Resource.Id.frgContainer);
            var mainFragment = SupportFragmentManager.FindFragmentById(Resource.Id.frgContainer) as ContentMainFragment;

            if (mainFragment == null)
            {
                mainFragment = new ContentMainFragment();
                SupportFragmentManager.BeginTransaction().Add(Resource.Id.frgContainer, mainFragment).Commit();
            }

            SetResult(Result.Canceled);

            AsyncUIOperationRepeater.INSTATNCE.RegisterAsyncTaskActivity(this);
            Android.Util.Log.Info("DBG", "ContentActivity[" + asyncTaskActivityGUID + "] Created.");
        }
コード例 #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //RegisterRecentHistoryChangeCallback();

            StatusBarTintHelper.SetStatusBarColor(this);

            Android.Util.Log.Info("DBG", "Set MyPublicationsActivity[" + asyncTaskActivityGUID + "].");

            // Create your application here
            SetContentView(Resource.Layout.mypublications_activity);

            FindViewById <LinearLayout>(Resource.Id.llStatusBarStub).LayoutParameters =
                new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, StatusBarTintHelper.GetStatusBarHeight());

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar_actionbar);
            SetSupportActionBar(toolbar);

            dlRightDrawer = FindViewById <DrawerLayout>(Resource.Id.dlRightDrawer);
            flRightDrawerPanelContainer = FindViewById <FrameLayout>(Resource.Id.flRightDrawerPanelContainer);
            llHeader = FindViewById <LinearLayout>(Resource.Id.llHeader);
            tvNoHistoryMessageInDrawer = FindViewById <TextView>(Resource.Id.tvNoHistoryMessageInDrawer);

            // Set the shadow layer of drawer layout to totally transparent
            dlRightDrawer.SetScrimColor(Color.Transparent);
            dlRightDrawer.DrawerStateChanged += (object sender, DrawerLayout.DrawerStateChangedEventArgs e) =>
            {
                if (e.NewState == 1)
                {
                    // STATE_DRAGGING
                    // Indicates that a drawer is currently being dragged by the user.
                    hrcAdaptor.RefreshHisoryList();
                    tvNoHistoryMessageInDrawer.Visibility = hrcAdaptor.ItemCount == 0 ? ViewStates.Visible : ViewStates.Gone;
                }
            };

            rcHistoryList                        = FindViewById <RecyclerView>(Resource.Id.rcHistoryList);
            historylistLayoutManager             = new LinearLayoutManager(this);
            historylistLayoutManager.Orientation = LinearLayoutManager.Vertical;
            rcHistoryList.SetLayoutManager(historylistLayoutManager);
            hrcAdaptor = new HistoryListAdaptor(
                this,
                Resource.Layout.content_historylist_item,
                OnRecentHistoryItemClick);
            rcHistoryList.SetAdapter(hrcAdaptor);
            rcHistoryList.Visibility = ViewStates.Invisible;

            var frgContainer = SupportFragmentManager.FindFragmentById(Resource.Id.frgContainer);

            if (frgContainer == null)
            {
                var publicationsMainFragment = new PublicationsMainFragment();
                SupportFragmentManager.BeginTransaction().Add(Resource.Id.frgContainer, publicationsMainFragment).Commit();
            }

            if (savedInstanceState != null)
            {
                asyncTaskActivityGUID = savedInstanceState.GetString(
                    AsyncUIOperationRepeater.ASYNC_ACTIVITY_GUID);
                if (savedInstanceState.GetBoolean(IsPublicationFilterShowingDropDown))
                {
                    Task.Run(delegate
                    {
                        Thread.Sleep(100);
                        Application.SynchronizationContext.Post(_ =>
                        {
                            if (PublicationListFragment != null)
                            {
                                PublicationListFragment.ForceShowPublicationFilterDropDown();
                            }
                        }, null);
                    });
                }
            }

            if (string.IsNullOrEmpty(asyncTaskActivityGUID))
            {
                asyncTaskActivityGUID = Guid.NewGuid().ToString();
            }

            AsyncUIOperationRepeater.INSTATNCE.RegisterAsyncTaskActivity(this);
            Android.Util.Log.Info("DBG", "MyPublicationsActivity[" + asyncTaskActivityGUID + "] Created.");
        }