Example #1
0
 public ApprovalDetalisListAdapter(ApprovalDetailList approvalList, AnimatedExpandableListView _lvApprovalDetailList, ApprovalDetailActivity _activity) : base(_activity)
 {
     MatchItems           = _approvalList = approvalList;
     _context             = _activity;
     lvApprovalDetailList = _lvApprovalDetailList;
     bitopiApplication    = (BitopiApplication)_context.ApplicationContext;
 }
Example #2
0
 public TNAMyTaskListAdapter(MyTaskList myTaskList, AnimatedExpandableListView _lvMyTask,
                             TNAMyTaskActivity _activity) : base(_activity)
 {
     MatchItems        = _MyTaskList = myTaskList;
     _context          = _activity;
     lvMyTask          = _lvMyTask;
     bitopiApplication = (BitopiApplication)_context.ApplicationContext;
     adapter           = this;
 }
Example #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            _listView             = FindViewById <AnimatedExpandableListView>(Resource.Id.expandableListView);
            _listView.GroupClick += ListView_GroupClick;

            _adapter = new ExpandableListViewAdapter(this, new List <GroupItem>());
            _listView.SetAdapter(_adapter);

            _records = new List <GroupItem>();
            _records = GetListGroupItem(DummyData());

            _adapter.DataSource = _records;
            _adapter.NotifyDataSetChanged();
        }
Example #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            builder = new Android.App.AlertDialog.Builder(this);
            builder.SetMessage("Hello, World!");

            builder.SetNegativeButton("Cancel", (s, e) => { /* do something on Cancel click */ });


            base.OnCreate(savedInstanceState);
            _approvalList     = new ApprovalDetailList(this);
            _approvalType     = (ApprovalType)(Convert.ToInt16(Intent.GetStringExtra("ApprovalType")));
            _approvalRoleType = (ApprovalRoleType)(Convert.ToInt16(Intent.GetStringExtra("ApprovalRoleType")));

            SupportRequestWindowFeature(WindowCompat.FeatureActionBar);
            SupportActionBar.SetDisplayShowCustomEnabled(true);
            SupportActionBar.SetCustomView(Resource.Layout.custom_actionbar);
            rltitle = FindViewById <RelativeLayout>(Resource.Id.rltitle);


            SetContentView(Resource.Layout.ApprovalDetailList);

            lvApprovalDetailList = FindViewById <AnimatedExpandableListView>(Resource.Id.lvApprovalsDetails);
            _chkApproveAll       = FindViewById <CheckBox>(Resource.Id.chkSelectAll);
            rlMsg            = FindViewById <RelativeLayout>(Resource.Id.rlMsg);
            rlapprovalDetail = FindViewById <RelativeLayout>(Resource.Id.rlapprovalDetail);

            if (bitopiApplication.ApprovalRoleType == ApprovalRoleType.Recommend)
            {
                (FindViewById <Button>(Resource.Id.btnApproveAll)).Text    = "RECOMMEND SELECTED";
                (FindViewById <Button>(Resource.Id.btnNotApproveAll)).Text = "NOT RECOMMEND SELECTED";
            }
            else
            {
                (FindViewById <Button>(Resource.Id.btnApproveAll)).Text    = "APPROVE SELECTED";
                (FindViewById <Button>(Resource.Id.btnNotApproveAll)).Text = "NOT APPROVE SELECTED";
            }
            (FindViewById <Button>(Resource.Id.btnApproveAll)).Click += (s, e) =>
            {
                builder.SetMessage("Do you want to " + (bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve ? "Approve" : "Recommend ") + _approvalList.Where(t => t.isApproved == true).Count() + " Approval");

                builder.SetPositiveButton("OK", (sender, evnt) =>
                {
                    var progressDialog = ProgressDialog.Show(this, null, "", true);
                    _approvalList.SaveSelected((bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve ? "Approved" : "Recommended"), (numberOfSuccessFullOperation) =>
                    {
                        progressDialog.Dismiss();
                        var tempApprovalList = _approvalList.Where(t => t.isDeleted == false).ToList();
                        _approvalList        = new ApprovalDetailList(this);
                        tempApprovalList.ForEach(st => _approvalList.Add(st));
                        _approvalListAdapter.SetData(_approvalList);
                        _approvalListAdapter.NotifyDataSetChanged();
                        Toast.MakeText(this, "Total " + numberOfSuccessFullOperation + " Approval has been " + ((bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve) ? "Approved" : "Recommended"), ToastLength.Long).Show();
                        if (numberOfSuccessFullOperation > 0 && _approvalList.Count == 0)
                        {
                            rlMsg.Visibility            = ViewStates.Visible;
                            rlapprovalDetail.Visibility = ViewStates.Gone;
                        }
                    });

                    /* do something on OK click */
                });
                builder.Create().Show();
            };
            (FindViewById <Button>(Resource.Id.btnNotApproveAll)).Click += (s, e) =>
            {
                builder.SetMessage("Do you want to " + ((bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve) ? "Reject" : "Not Recommend ") + _approvalList.Where(t => t.isApproved == true).Count() + " Approval");

                builder.SetPositiveButton("OK", (sender, evnt) =>
                {
                    var progressDialog = ProgressDialog.Show(this, null, "", true);
                    _approvalList.SaveSelected((bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve) ? "Rejected" : "NotRecommend", (numberOfSuccessFullOperation) =>
                    {
                        progressDialog.Dismiss();
                        var tempApprovalList = _approvalList.Where(t => t.isDeleted == false).ToList();
                        _approvalList        = new ApprovalDetailList(this);
                        tempApprovalList.ForEach(st => _approvalList.Add(st));
                        _approvalListAdapter.SetData(_approvalList);
                        _approvalListAdapter.NotifyDataSetChanged();
                        Toast.MakeText(this, "Total " + numberOfSuccessFullOperation + " Approval has been " + ((bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve) ? "Rejected" : "Not Recommended"), ToastLength.Long).Show();
                        if (numberOfSuccessFullOperation > 0 && _approvalList.Count == 0)
                        {
                            rlMsg.Visibility            = ViewStates.Visible;
                            rlapprovalDetail.Visibility = ViewStates.Gone;
                        }
                    });
                });
                builder.Create().Show();
            };
            RLleft_drawer = FindViewById <RelativeLayout>(Resource.Id.RLleft_drawer);
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            FindViewById <ImageButton>(Resource.Id.btnDrawermenu).Visibility = ViewStates.Visible;
            FindViewById <ImageButton>(Resource.Id.btnDrawermenu).Click     += (s, e) =>
            {
                if (mDrawerLayout.IsDrawerOpen(RLleft_drawer))
                {
                    mDrawerLayout.CloseDrawer(RLleft_drawer);
                }
                else
                {
                    mDrawerLayout.OpenDrawer(RLleft_drawer);
                }
            };

            //base.LoadDrawerView();
        }
Example #5
0
 public CustomOnFocusChangeListener(TNAMyTaskListAdapter adapter, int position, AnimatedExpandableListView lvMyTask)
 {
     this.adapter  = adapter;
     this.position = position;
     this.lvMyTask = lvMyTask;
 }
Example #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            //bitopiApplication = (BitopiApplication)this.ApplicationContext;
            builder = new Android.App.AlertDialog.Builder(this);
            builder.SetMessage("Hello, World!");

            builder.SetNegativeButton("Cancel", (s, e) => { /* do something on Cancel click */ });


            base.OnCreate(savedInstanceState);
            _MyTaskList       = new MyTaskList(this);
            _approvalType     = (ApprovalType)(Convert.ToInt16(Intent.GetStringExtra("ApprovalType")));
            _approvalRoleType = (ApprovalRoleType)(Convert.ToInt16(Intent.GetStringExtra("ApprovalRoleType")));

            SupportRequestWindowFeature(WindowCompat.FeatureActionBar);
            SupportActionBar.SetDisplayShowCustomEnabled(true);
            SupportActionBar.SetCustomView(Resource.Layout.custom_actionbar);
            rltitle      = FindViewById <RelativeLayout>(Resource.Id.rltitle);
            tvHeaderName = FindViewById <TextView>(Resource.Id.tvHeaderName);

            SetContentView(Resource.Layout.TNAMyTaskList);

            lvMyTask         = FindViewById <AnimatedExpandableListView>(Resource.Id.lvMyTask);
            tvMsg            = FindViewById <TextView>(Resource.Id.tvMsg);
            tvMsg.Visibility = ViewStates.Gone;
            _chkApproveAll   = FindViewById <CheckBox>(Resource.Id.chkSelectAll);
            rlMsg            = FindViewById <RelativeLayout>(Resource.Id.rlMsg);
            rlapprovalDetail = FindViewById <RelativeLayout>(Resource.Id.rlapprovalDetail);
            switch (bitopiApplication.MyTaskType)
            {
            case MyTaskType.UNSEEN:
                tvMsg.Text        = "You don't have any unseen Task";
                tvHeaderName.Text = "My Unseen Task";


                break;

            case MyTaskType.SEEN:
                tvMsg.Text        = "You don't have any seen Task";
                tvHeaderName.Text = "My Seen Task";
                break;

            case MyTaskType.COMPLETED:
                tvMsg.Text        = "You don't have any completed Task";
                tvHeaderName.Text = "My Completed Task";
                break;
            }
            RLleft_drawer = FindViewById <RelativeLayout>(Resource.Id.RLleft_drawer);
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            FindViewById <ImageButton>(Resource.Id.btnDrawermenu).Visibility = ViewStates.Visible;
            FindViewById <ImageButton>(Resource.Id.btnDrawermenu).Click     += (s, e) =>
            {
                if (mDrawerLayout.IsDrawerOpen(RLleft_drawer))
                {
                    mDrawerLayout.CloseDrawer(RLleft_drawer);
                }
                else
                {
                    mDrawerLayout.OpenDrawer(RLleft_drawer);
                }
            };

            //LoadDrawerView();
        }