コード例 #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.CustomerDetails, container, false);

            viewCust = view;

            InitActionBar();

            view.FindViewById <FrameLayout>(Resource.Id.realtabcontent).Visibility = ViewStates.Gone;

            customer = CustomerInfo.GetCustomer(Activity, this.ObjectId);

            tbCustCode = (TextView)view.FindViewById(Resource.Id.tbCustomerCode);
            tbCustName = (TextView)view.FindViewById(Resource.Id.tbCustomerName);

            tbCustCode.Text = customer.Code;
            tbCustName.Text = customer.Name;

            statisticTabMonthly = StatisticTabMonthly.NewInstance(this.ObjectId);
            statisticTabByDate  = StatisticTabByDate.NewInstance(this.ObjectId, customerNames);

            mTabHost             = (TabHost)view.FindViewById(Resource.Id.tabhost);
            mTabHost.TabChanged += TabHostHandleTabChanged;
            mTabHost.Setup();
            InitializeTab(view);

            GC.Collect();
            return(view);
        }
コード例 #2
0
        public static StatisticTabMonthly NewInstance(long objId)
        {
            var detailsFrag = new StatisticTabMonthly {
                Arguments = new Bundle()
            };

            detailsFrag.Arguments.PutLong("ObjectId", objId);

            return(detailsFrag);
        }
コード例 #3
0
        static TableLayout CreateTableReport(View view, StatisticList statList)
        {
            TableLayout.LayoutParams fillParams = new TableLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent, 1.0f);
            TableLayout tblLayout = new TableLayout(view.Context);

            tblLayout.LayoutParameters  = fillParams;
            tblLayout.StretchAllColumns = true;

            TableRow rowHeader = new TableRow(view.Context);

            rowHeader.SetBackgroundResource(Resource.Drawable.actionbar_background);

            TextView tvItemKategH = new TextView(view.Context);

            tvItemKategH.Text = view.Resources.GetText(Resource.String.tvHeaderItemKategory);
            SetHeaderCellStyle(tvItemKategH);
            rowHeader.AddView(tvItemKategH);

            TextView tvAmountCurrH = new TextView(view.Context);

            tvAmountCurrH.Text    = DateTime.Now.ToString("MMM yyyy");
            tvAmountCurrH.Gravity = GravityFlags.Right;
            SetHeaderCellStyle(tvAmountCurrH);
            rowHeader.AddView(tvAmountCurrH);

            TextView tvAmountPrevH = new TextView(view.Context);

            tvAmountPrevH.Text    = DateTime.Now.AddYears(-1).ToString("MMM yyyy");
            tvAmountPrevH.Gravity = GravityFlags.Right;
            SetHeaderCellStyle(tvAmountPrevH);
            rowHeader.AddView(tvAmountPrevH);

            tblLayout.AddView(rowHeader);

            foreach (Statistic st in statList)
            {
                TableRow row = new TableRow(view.Context);
                row.SetBackgroundResource(Resource.Drawable.button_selector);

                TextView tvItemKateg = new TextView(view.Context);
                tvItemKateg.Text = st.ItemKategDesc;
                StatisticTabMonthly.SetCellStyle(tvItemKateg);
                row.AddView(tvItemKateg);

                TextView tvAmountCurr = new TextView(view.Context);
                tvAmountCurr.Gravity = GravityFlags.Right;
                tvAmountCurr.Text    = st.AmountCurrText;
                StatisticTabMonthly.SetCellStyle(tvAmountCurr);
                row.AddView(tvAmountCurr);

                TextView tvAmountPrev = new TextView(view.Context);
                tvAmountPrev.Gravity = GravityFlags.Right;
                tvAmountPrev.Text    = st.AmountPrevText;
                StatisticTabMonthly.SetCellStyle(tvAmountPrev);
                row.AddView(tvAmountPrev);

                tblLayout.AddView(row);
            }

            return(tblLayout);
        }