Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.ItemEditActivity);
            toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbarMain);
            if (null != toolbar)
            {
                toolbar.SetBackgroundColor(Color.Gray);
                toolbar.SetTitleTextColor(Color.White);
                SetSupportActionBar(toolbar);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetTitle(Resource.String.item_edit_string);
            }

            database     = FirebaseDatabase.Instance;
            rowDataRef   = database.GetReferenceFromUrl(Intent.GetStringExtra("rowReference"));
            rowSchemaRef = database.GetReferenceFromUrl(Intent.GetStringExtra("tableSource")).Child("columns");
            rowSchemaRef.AddChildEventListener(columnListener);

            colorRef = database.GetReferenceFromUrl(Intent.GetStringExtra("colorSource"));


            deleteButton = FindViewById <RelativeLayout>(Resource.Id.relativeLayoutDelete);
            editButton   = FindViewById <RelativeLayout>(Resource.Id.relativeLayoutCustomize);

            editContentLayout = FindViewById <LinearLayout>(Resource.Id.linearLayoutEditContent);

            if (colorRef != null)
            {
                colorRef.AddValueEventListener(colorListener);
            }

            deleteButton.SetOnClickListener(this);
            editButton.SetOnClickListener(this);

            row = new RowModel(columns, rowDataRef);

            editContentLayout.AddView(row.GetEditView(this).GetView(), 0);
        }