コード例 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            HivescaleDB.Instance = new HivescaleDB(GetDbPath());

            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ActivityFeed);

            list                = FindViewById <ListView> (Resource.Id.list);
            list.ItemClick     += ItemSelected;
            list.ItemLongClick += RemoveContent;

            FloatingActionButton fab = FindViewById <FloatingActionButton> (Resource.Id.fab);

            fab.AttachToListView(list);
            fab.Click += AddContent;

            SetUpActionBar();

            List <Shame> shames = HivescaleDB.Instance.GetShames();

            foreach (Shame s in shames)
            {
                Shames.Add(s);
            }
        }
コード例 #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var root = inflater.Inflate(Resource.Layout.fragment_conversations, container, false);
            var list = root.FindViewById <ListView>(Resource.Id.conversations_list);

            list.ItemClick += OnConversationClick;
            list.Adapter    = new ConverstationAdapter(Activity, viewModel);

            var friendGrid = root.FindViewById <GridView> (Resource.Id.grid);

            friendGrid.ItemClick += FriendClicked;
            friendGrid.Adapter    = new FriendAdapter(Activity, viewModel);

            selectFriend = root.FindViewById <LinearLayout> (Resource.Id.new_conversation);

            var cancelFriends = root.FindViewById <Button> (Resource.Id.cancel);

            cancelFriends.Click += (sender, e) => {
                fab.Show();
                selectFriend.Visibility = ViewStates.Gone;
            };

            fab        = root.FindViewById <FloatingActionButton>(Resource.Id.fab);
            fab.Click += OnStartNewConversationClick;
            fab.AttachToListView(list);

            refresher          = root.FindViewById <SwipeRefreshLayout> (Resource.Id.refresher);
            refresher.Refresh += (sender, e) => viewModel.ExecuteLoadConversationsCommand();


            return(root);
        }