예제 #1
0
        protected override void OnCreate()
        {
            LinearLayout layout = new LinearLayout(Context)
            {
                LayoutParameters = new ViewGroup.LayoutParams(MatchParent, MatchParent)
            };
            int pd = 6.Dip();

            layout.SetPadding(pd, pd, pd, pd);
            layout.Orientation = Orientation.Vertical;
            SetContentView(layout);

            TextView tv = new TextView(Context);

            tv.SetText(Resource.String.enter_fraction_name);
            layout.AddView(tv);

            NameEdit = new EditText(Context);
            NameEdit.SetMaxEms(30);
            NameEdit.SetColor(new Color(Context.GetColor(Resource.Color.colorPrimaryDark)));
            NameEdit.SetSingleLine();
            layout.AddView(NameEdit);

            Title          = "Создание фракции";
            TitleColor     = new Color(Context.GetColor(Resource.Color.colorPrimaryDark));
            TitleTextColor = Color.White;
            AddButton("Close", view => {
                return(true);
            });
        }
        public void AddItem(Fraction item)
        {
            LinearLayout main = new LinearLayout(this);

            main.SetGravity(GravityFlags.Center | GravityFlags.Left);
            main.SetPadding(5.Dip(), 15.Dip(), 5.Dip(), 15.Dip());
            main.Click += delegate {
                OpenFractionInfoActivity(item);
            };
            Main.AddView(main);

            TextView name = new TextView(this)
            {
                Text    = item.Name,
                Gravity = GravityFlags.Center | GravityFlags.Left
            };

            name.SetTypefaceStyle(TypefaceStyle.Bold);
            main.AddView(name);
        }