コード例 #1
0
        //@Override
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_dynamiclistview);

            DynamicListView listView = (DynamicListView)FindViewById(Resource.Id.activity_dynamiclistview_listview);

            listView.AddHeaderView(LayoutInflater.From(this).Inflate(Resource.Layout.activity_dynamiclistview_header, listView, false));

            /* Setup the adapter */
            Com.Nhaarman.ListviewAnimations.ArrayAdapter <string> adapter = new MyListAdapter(this);
            SimpleSwipeUndoAdapter  simpleSwipeUndoAdapter = new SimpleSwipeUndoAdapter(adapter, this, new MyOnDismissCallback(adapter, this));
            AlphaInAnimationAdapter animAdapter            = new AlphaInAnimationAdapter(simpleSwipeUndoAdapter);

            animAdapter.setAbsListView(listView);
            //assert animAdapter.getViewAnimator() != null;
            animAdapter.getViewAnimator().setInitialDelayMillis(INITIAL_DELAY_MILLIS);
            listView.SetAdapter(animAdapter);

            /* Enable drag and drop functionality */
            listView.enableDragAndDrop();
            listView.setDraggableManager(new TouchViewDraggableManager(Resource.Id.list_row_draganddrop_touchview));
            listView.setOnItemMovedListener(new MyOnItemMovedListener(adapter, this));

            listView.OnItemLongClickListener = new MyOnItemLongClickListener(listView);

            /* Enable swipe to dismiss */
            listView.enableSimpleSwipeUndo();

            /* Add new items on item click */
            listView.OnItemClickListener = new MyOnItemClickListener(listView, this);
        }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: mcooi77/afr
        /*START MY CODE*/
        //
        //
        private void CreateListItem()
        {
            CalculateAvgUrine();

            ListOfFluidDataPts.Add(new AFRDataPoint(Publictime, realAvgValue.ToString("0.##") + " mL", OngoingRate.ToString("0.##") + " mL/kg/h"));


            //listofmydatapoints = MyList;
            // DeviceListSource.Source = listOfDevices;
            MyDataPtsSource.Source = ListOfFluidDataPts;

            DynamicListView.Focus(FocusState.Programmatic);
            DynamicListView.SelectedIndex = (DynamicListView.Items.Count - 1);
            DynamicListView.ScrollIntoView(DynamicListView.SelectedItem);

            //TEST CODE NEW START

            //ListViewItem NewItem = DynamicListView.ItemContainerGenerator.ContainerFromItem(DynamicListView.SelectedItem) as ListViewItem;

            /*
             * if (rowFormatToggle == true)
             * {
             *  this.Resources[HighlightBrushKey] = Brushes.Red;
             *  //NewItem.Background = new SolidColorBrush(Color.FromArgb(255, 248, 203, 173));
             *  rowFormatToggle = false;
             * }
             * else
             * {
             *  //NewItem.Background = new SolidColorBrush(Color.FromArgb(255, 252, 228, 214));
             *  rowFormatToggle = true;
             * }
             */
            //END NEW TEST CODE
        }
コード例 #3
0
 private void Bind(DynamicListView <T> newElement)
 {
     if (newElement != null)
     {
         this.tableView.ItemsSource  = this.Element.Data;
         newElement.PropertyChanged += ElementPropertyChanged;
     }
 }
コード例 #4
0
 private void Bind(DynamicListView <T> newElement)
 {
     if (newElement != null)
     {
         newElement.PropertyChanging       += ElementPropertyChanging;
         newElement.PropertyChanged        += ElementPropertyChanged;
         newElement.Data.CollectionChanged += DataCollectionChanged;
     }
 }
コード例 #5
0
 private void Unbind(DynamicListView <T> oldElement)
 {
     if (oldElement != null)
     {
         oldElement.PropertyChanging       += ElementPropertyChanging;
         oldElement.PropertyChanged        -= ElementPropertyChanged;
         oldElement.Data.CollectionChanged += DataCollectionChanged;
     }
 }
コード例 #6
0
        private void Unbind(DynamicListView <T> oldElement)
        {
            if (oldElement != null)
            {
                oldElement.PropertyChanged -= ElementPropertyChanged;
            }

            this.tableView.ItemsSource = null;
        }
コード例 #7
0
 public MyOnItemClickListener(DynamicListView listView, DynamicListViewActivity instance)
 {
     mListView = listView;
     minstance = instance;
 }
コード例 #8
0
 public MyOnItemLongClickListener(DynamicListView listView)
 {
     mListView = listView;
 }
コード例 #9
0
 public DynamicListViewWrapper(DynamicListView dynamicListView)
 {
     mDynamicListView = dynamicListView;
 }
コード例 #10
0
 public DynamicListViewWrapper(DynamicListView dynamicListView)
 {
     mDynamicListView = dynamicListView;
 }
コード例 #11
0
        /**
         * Creates a new {@code DragAndDropHandler} for given {@link com.nhaarman.listviewanimations.itemmanipulation.DynamicListView}.
         *
         * @param dynamicListView the {@code DynamicListView} to use.
         */
        public DragAndDropHandler(DynamicListView dynamicListView)
            : this(new DynamicListViewWrapper(dynamicListView))
        {

        }
コード例 #12
0
 /**
  * Creates a new {@code DragAndDropHandler} for given {@link com.nhaarman.listviewanimations.itemmanipulation.DynamicListView}.
  *
  * @param dynamicListView the {@code DynamicListView} to use.
  */
 public DragAndDropHandler(DynamicListView dynamicListView)
     : this(new DynamicListViewWrapper(dynamicListView))
 {
 }