Пример #1
0
        /// <summary>
        /// 页面事件
        /// </summary>
        protected override void InitEvents()
        {
            // 返回
            FindViewById <ImageButton>(Resource.Id.imgBtn_back).Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            // 点击头部菜单
            FindViewById <TextView>(Resource.Id.tv_ing).Click += (sender, e) =>
            {
                SetSelected(0);
                mViewPager.SetCurrentItem(0, true);
            };
            FindViewById <TextView>(Resource.Id.tv_will).Click += (sender, e) =>
            {
                SetSelected(1);
                mViewPager.SetCurrentItem(1, true);
            };
            FindViewById <TextView>(Resource.Id.tv_end).Click += (sender, e) =>
            {
                SetSelected(2);
                mViewPager.SetCurrentItem(2, true);
            };

            mViewPager.AddOnPageChangeListener(this);
        }
Пример #2
0
 protected override void InitEvents()
 {
     // 返回
     FindViewById <ImageButton>(Resource.Id.imgBtn_back).Click += (sender, e) =>
     {
         CurrActivity.Finish();
         OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
     };
 }
Пример #3
0
        /// <summary>
        /// 退出登录
        /// </summary>
        public void DoLogout()
        {
            SharedPreferencesUtil.SetParam(CurrActivity, AppConfig.SP_USERINFO, "");

            Intent intent = new Intent(CurrActivity, typeof(Login));

            StartActivity(intent);
            CurrActivity.Finish();
            CurrActivity.OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
        }
        /// <summary>
        /// 初始化事件
        /// </summary>
        protected override void InitEvents()
        {
            // 返回
            FindViewById <ImageButton>(Resource.Id.imgBtn_back).Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            llAdd.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(ShopManagerAddActivity));
                StartActivity(intent);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };
        }
Пример #5
0
        protected override void InitEvents()
        {
            // 返回
            FindViewById <ImageButton>(Resource.Id.imgBtn_back).Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            llAdd.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(TeacherAddActivity));
                intent.PutExtra("scopeName", scopeName);
                StartActivity(intent);
                OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };

            mSwipeRefreshLayout.SetOnRefreshListener(this);

            RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this);

            mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener));

            // 加载更多
            var onScrollListener = new XamarinRecyclerViewOnScrollListener(linearLayoutManager);

            onScrollListener.LoadMoreEvent += (object sender, EventArgs e) =>
            {
                if (totalCount > teacherList.Count)
                {
                    if (!loadingData)
                    {
                        loadingData = true;
                        GetTeacherListByScope();
                    }
                }
                else if (totalCount == teacherList.Count)
                {
                    Toast.MakeText(this, "没有更多了", ToastLength.Short).Show();
                }
            };
            mRecyclerView.AddOnScrollListener(onScrollListener);
        }
Пример #6
0
        protected override void InitEvents()
        {
            // 返回
            imgbtnBack.Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            // 选择教研组
            rlGroup.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(TeacherScopeSelectActivity));
                intent.PutExtra("scopeId", tScopeCode);
                StartActivityForResult(intent, 1);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };

            // 选择角色
            rlRole.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(TeacherRoleSelectActivity));
                intent.PutExtra("roleId", tType);
                StartActivityForResult(intent, 0);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };

            btnAdd.Click += (sender, e) =>
            {
                DoSave(true);
            };

            tvSave.Click += (sender, e) =>
            {
                DoSave(false);
            };

            btnDelete.Click += (sender, e) =>
            {
                var callbackFunc = new AppUtils.ShowDialogClick(CallbackFun);
                AppUtils.ShowDialog(CurrActivity, "提示", "您确认要删除此信息吗?", 2, callbackFunc);
            };
        }
Пример #7
0
        protected override void InitEvents()
        {
            // 返回
            FindViewById <ImageButton>(Resource.Id.imgBtn_back).Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            tv_btn1.SetOnClickListener(this);
            tv_btn2.SetOnClickListener(this);
            tv_btn3.SetOnClickListener(this);

            //开课中/全部切换事件
            FindViewById <ImageButton>(Resource.Id.imgBtn_lessonIng).Click += (sender, e) =>
            {
                var imgButton = (sender as ImageButton);
                SetClassStatusImg(imgButton, "clickButton");
            };
        }
Пример #8
0
        protected override void InitEvents()
        {
            // 返回
            ((ImageButton)FindViewById(Resource.Id.imgBtn_back)).Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            llBox.RemoveAllViews();
            List <TeacherRoleEntity> roleList = AppUtils.GetTeacherRoleList();

            foreach (var role in roleList)
            {
                var itemBox     = LayoutInflater.From(CurrContext).Inflate(Resource.Layout.item_role_select, llBox, false);
                var itemWrapper = itemBox.FindViewById <RelativeLayout>(Resource.Id.ll_wrapper);
                var roleLabel   = itemBox.FindViewById <TextView>(Resource.Id.iv_role_label);
                var roleIcon    = itemBox.FindViewById <ImageView>(Resource.Id.iv_role_icon);

                roleLabel.Text = role.RoleName;
                roleIcon.SetImageResource(Resource.Drawable.icn_selected);

                if (role.RoleId == roleId)
                {
                    roleIcon.Visibility = ViewStates.Visible;
                    roleLabel.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                }

                llBox.AddView(itemBox);

                itemWrapper.Click += (sender, e) =>
                {
                    fromIntent.SetClass(this, typeof(TeacherAddActivity));
                    fromIntent.PutExtra("roleId", role.RoleId.ToString());
                    fromIntent.PutExtra("roleName", role.RoleName);
                    SetResult(Result.Ok, fromIntent);
                    Finish();
                    OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
                };
            }
        }
Пример #9
0
        protected override void InitEvents()
        {
            // 取消
            FindViewById <TextView>(Resource.Id.tv_cancel).Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            // 选择学区
            rlArea.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(AreaSelectActivity));
                intent.PutExtra("sname", currAssistant.AreaName);
                StartActivityForResult(intent, 0);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };

            btnAdd.Click += (sender, e) =>
            {
                DoSave(true);
            };

            tvSave.Click += (sender, e) =>
            {
                if (isNewAdd)
                {
                    DoSave(false);
                }
                else
                {
                    DoUpdate();
                }
            };

            btnDelete.Click += (sender, e) =>
            {
                var callbackFunc = new AppUtils.ShowDialogClick(CallbackFun);
                AppUtils.ShowDialog(CurrActivity, "提示", "您确认要删除此账号吗?", 2, callbackFunc);
            };
        }
Пример #10
0
        /// <summary>
        /// 初始化事件
        /// </summary>
        protected override void InitEvents()
        {
            // 返回
            imgbtnBack.Click += (sender, e) =>
            {
                CurrActivity.Finish();
                OverridePendingTransition(Resource.Animation.left_in, Resource.Animation.right_out);
            };

            // 选择负责校区
            rlAreas.Click += (sender, e) =>
            {
                Intent intent = new Intent(CurrActivity, typeof(AreaSelectMultiActivity));
                if (currShopManager != null)
                {
                    intent.PutExtra("areaCodes", AreaCodes);
                }
                StartActivityForResult(intent, 1);
                CurrActivity.OverridePendingTransition(Resource.Animation.right_in, Resource.Animation.left_out);
            };
            //保存并继续添加
            btnAdd.Click += (sender, e) =>
            {
                DoSave(true);
            };
            //完成
            tvSave.Click += (sender, e) =>
            {
                DoSave(false);
            };
            //删除
            btnDelete.Click += (sender, e) =>
            {
                var callbackFunc = new AppUtils.ShowDialogClick(CallbackFun);
                AppUtils.ShowDialog(CurrActivity, "提示", "您确认要删除此信息吗?", 2, callbackFunc);
            };
        }