protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     //RequestWindowFeature(WindowFeatures.ActionBar);
     // Set our view from the "main" layout resource
     SetContentView(Resource.Layout.ItemListView);
     ActionBar.SetDisplayShowHomeEnabled(false);
     // Get our button from the layout resource,
     // and attach an event to it
     _listView = FindViewById<ListView>(Resource.Id.listItems);
     _btnAdd = FindViewById<Button>(Resource.Id.btnAdd);
     //_btnAdd.Click += _btnAdd_Click;
     _adapter = new ItemAdapter(this);
     _listView.ItemClick += _listView_ItemClick;
 }
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			SetContentView (Resource.Layout.Main);

			mItemAdapter = new ItemAdapter ();	
			mLayoutManager = new LinearLayoutManager (this);

			mRecyclerView = FindViewById<RecyclerView> (Resource.Id.recyclerView);
			mRecyclerView.SetLayoutManager (mLayoutManager);
			mRecyclerView.SetAdapter (mItemAdapter);

			FetchItems ();
//			LoaderManager.InitLoader (0, null, this);
		}
        private void InitUI()
        {
            SetContentView(Resource.Layout.SearchResult);

            _listView = FindViewById<ListView>(Resource.Id.SearchResultListView);

            _itemsAdapter = new ItemAdapter(this, _items);
            _listView.Adapter = _itemsAdapter;
            _listView.ItemClick += OnItemClick;

            _previousPageButton = FindViewById<Button>(Resource.Id.PreviousButton);
            _previousPageButton.Click += OnPreviousButtonClicked;

            _nextPageButton = FindViewById<Button>(Resource.Id.NextButton);
            _nextPageButton.Click += OnNextButtonClicked;
        }
Exemple #4
0
        private void InitPopularRecyclerView()
        {
            popularManager = new LinearLayoutManager(Activity, LinearLayoutManager.Horizontal, false);
            popular.SetLayoutManager(popularManager);
            popularAdapter = new ItemAdapter(viewModel.GetCachedPopular());
            popular.SetAdapter(popularAdapter);
            var popularScrollListener = new ItemAdapterScollListener(popularManager);

            popularScrollListener.LoadMore += async delegate()
            {
                if (!viewModel.CanLoadMorePopular())
                {
                    return;
                }
                await viewModel.GetPopular().ConfigureAwait(false);
            };
            popular.AddOnScrollListener(popularScrollListener);
        }
Exemple #5
0
        private void InitNowPlayingRecyclerView()
        {
            nowPlayingManager = new LinearLayoutManager(Activity, LinearLayoutManager.Horizontal, false);
            nowPlaying.SetLayoutManager(nowPlayingManager);
            nowPlayingAdapter = new ItemAdapter(viewModel.GetCachedNowPlaying());
            nowPlaying.SetAdapter(nowPlayingAdapter);
            var nowPlayingScrollListener = new ItemAdapterScollListener(nowPlayingManager);

            nowPlayingScrollListener.LoadMore += async delegate()
            {
                if (!viewModel.CanLoadMoreNowPlaying())
                {
                    return;
                }
                await viewModel.GetNowPlaying().ConfigureAwait(false);
            };
            nowPlaying.AddOnScrollListener(nowPlayingScrollListener);
        }
Exemple #6
0
        public override void OnCancel(IDialogInterface dialog)
        {
            string spinnerText = Items.FirstOrDefault(i => i.IsSelected)?.Name;

            if (spinnerText == null)
            {
                spinnerText = DefaultText;
            }

            ArrayAdapter <string> adapterSpinner = new ArrayAdapter <string>(Context, Resource.Layout.item_select_single, Resource.Id.txvItem, new string[] { spinnerText });

            Adapter = adapterSpinner;

            if (ItemAdapter != null)
            {
                ItemAdapter.NotifyDataSetChanged();
            }

            Listener?.OnItemSelected(this, Items.FirstOrDefault(i => i.IsSelected));
        }
Exemple #7
0
        public void Handle(ItemAdapter item)
        {
            item.IncrementQuality();

            if (item.SellIn < 11)
            {
                item.IncrementQuality();
            }

            if (item.SellIn < 6)
            {
                item.IncrementQuality();
            }

            if (item.SellIn < 0)
            {
                item.SetQualityToZero();
            }

            item.DecrementSellin();
        }
Exemple #8
0
        private void HandleCellClick(DataGridView dgv, int column, int row)
        {
            if (column == -1 || row == -1)
            {
                return;
            }

            if (column == dgv.Columns["Item"].Index)
            {
                dgv.BeginEdit(true);
                ((ComboBox)dgv.EditingControl).DroppedDown = true;
            }
            else if (column == dgv.Columns["Effect"].Index)
            {
                ItemAdapter itemAdapter = ((dgv.DataSource as BindingSource).DataSource as ItemAdapter[])[row];
                if (itemAdapter.IsEquipment)
                {
                    EffectEditorDialog eed = new EffectEditorDialog(itemAdapter.ItemInstance);
                    eed.ShowDialog();
                }
            }
        }
        public ItemAdapter PopulateItems(Activity activity, int resourceId, int textsomething)
        {
            if (itemLock == false)
            {
                JavaList<ItemSingle> activeItems = new JavaList<ItemSingle>();
                if (item != null)
                {

                    System.Collections.IEnumerator itemEnum = item.GetEnumerator();
                    itemEnum.Reset();
                    int i = 0;
                    while (itemEnum.MoveNext())
                    {
                        Item active = (Item)itemEnum.Current;
                        activeItems.Add(new ItemSingle(active.No_,active.Description,active.Unit_List_Price,active.Unit_Price,active.Sales_Unit_of_Measure,i));
                        i++;
                    }
                }
                ItemAdapter items = new ItemAdapter(activity, resourceId, textsomething, activeItems);
                return items;
            }
            else
            {
                return null;
            }
        }
 public bool CanHandle(ItemAdapter item) => item.Name.Equals("Aged Brie");
 public bool CanHandle(ItemAdapter item) => true;
        static void Main(string[] args)
        {
            Console.WriteLine("Program Initialized !!!");

            ItemAdapter itemAdapter = new ItemAdapter();
        }
 public bool CanHandle(ItemAdapter item) => item.Name.Equals("Sulfuras, Hand of Ragnaros");
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_fly_refresh);

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);
            toolbar.NavigationClick += (sender, e) => { Finish(); };

            /************************************************************
            * 关键代码-开始
            ************************************************************/

            mFlyView          = FindViewById <FlyView>(Resource.Id.flyview);
            mScenceView       = FindViewById <MountanScenceView>(Resource.Id.mountan);
            mFlyRefreshHeader = FindViewById <FlyRefreshHeader>(Resource.Id.flyrefresh);
            mFlyRefreshHeader.SetUp(mScenceView, mFlyView);                      //绑定场景和纸飞机
            mRefreshLayout = FindViewById(Resource.Id.refreshLayout) as IRefreshLayout;
            mRefreshLayout.SetReboundInterpolator(new ElasticOutInterpolator()); //设置回弹插值器,会带有弹簧震动效果
            mRefreshLayout.SetReboundDuration(800);                              //设置回弹动画时长
            mRefreshLayout.SetOnRefreshListener(new CustomOnRefreshListener(this));

            //设置 让 AppBarLayout 和 RefreshLayout 的滚动同步 并不保持 toolbar 位置不变
            appBar = FindViewById <AppBarLayout>(Resource.Id.app_bar);
            mRefreshLayout.SetOnMultiPurposeListener(new CustomOnMultiPurposeListener(this));

            /************************************************************
            * 关键代码-结束
            ************************************************************/

            mRefreshLayout = FindViewById(Resource.Id.refreshLayout) as IRefreshLayout;
            if (isFirstEnter)
            {
                isFirstEnter = false;
                mRefreshLayout.AutoRefresh();//第一次进入触发自动刷新,演示效果
            }

            /**
             * 初始化列表数据
             */
            initDataSet();
            mAdapter       = new ItemAdapter(this);
            mLayoutManager = new LinearLayoutManager(this);
            mListView      = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            mListView.SetLayoutManager(mLayoutManager);
            mListView.SetAdapter(mAdapter);
            mListView.SetItemAnimator(new SampleItemAnimator());
            mToolbarLayout = FindViewById <CollapsingToolbarLayout>(Resource.Id.toolbar_layout);
            mActionButton  = FindViewById <FloatingActionButton>(Resource.Id.fab);
            //设置点击 ActionButton 时候触发自动刷新 并改变主题颜色
            mActionButton.Click += (sender, e) => {
                updateTheme();
                mRefreshLayout.AutoRefresh();
            };

            // 监听 AppBarLayout 的关闭和开启 给 FlyView(纸飞机) 和 ActionButton 设置关闭隐藏动画
            appBar.OffsetChanged += (sender, e) => {
                var   appBarLayout   = e.AppBarLayout;
                var   verticalOffset = e.VerticalOffset;
                int   scrollRange    = appBarLayout.TotalScrollRange;
                float fraction       = 1f * (scrollRange + verticalOffset) / scrollRange;
                if (fraction < 0.1 && misAppbarExpand)
                {
                    misAppbarExpand = false;
                    mActionButton.Animate().ScaleX(0).ScaleY(0);
                    mFlyView.Animate().ScaleX(0).ScaleY(0);
                    ValueAnimator animator = ValueAnimator.OfInt(mListView.PaddingTop, 0);
                    animator.SetDuration(300);
                    animator.Update += (senderr, ee) => {
                        mListView.SetPadding(0, (int)ee.Animation.AnimatedValue, 0, 0);
                    };
                    animator.Start();
                }
                if (fraction > 0.8 && !misAppbarExpand)
                {
                    misAppbarExpand = true;
                    mActionButton.Animate().ScaleX(1).ScaleY(1);
                    mFlyView.Animate().ScaleX(1).ScaleY(1);
                    ValueAnimator animator = ValueAnimator.OfInt(mListView.PaddingTop, DensityUtil.Dp2px(25));
                    animator.SetDuration(300);
                    animator.Update += (senderr, ee) => {
                        mListView.SetPadding(0, (int)ee.Animation.AnimatedValue, 0, 0);
                    };
                    animator.Start();
                }
            };

            //状态栏透明和间距处理
            StatusBarUtil.immersive(this);
            StatusBarUtil.setPaddingSmart(this, toolbar);
            //        StatusBarUtil.setPaddingSmart(this, findViewById(R.id.profile));
            //        StatusBarUtil.setPaddingSmart(this, findViewById(R.id.blurview));
        }
Exemple #15
0
 public bool CanHandle(ItemAdapter item) => item.Name.Equals("Backstage passes to a TAFKAL80ETC concert");
Exemple #16
0
 public ItemRepository(IProgressConnection connection)
 {
     this.adapter = new ItemAdapter(connection);
     this.Cono    = this.adapter.Cono;
     this.OnCreated();
 }
Exemple #17
0
 public bool CanHandle(ItemAdapter item) => item.Name.Equals("Conjured Mana Cake");
 private void btnAddOnClick(Object sender, EventArgs e)
 {
     if (actv_Item.Text.Contains(" "))
     {
         item_list_adapter = (ItemAdapter)actv_Item.Adapter;
         Item_Order_Popup(actv_Item.Text.Substring(0, actv_Item.Text.IndexOf(" ")),inflater,container,savedInstanceState);
     }
 }
 public void Handle(ItemAdapter item)
 {
     item.IncrementQuality();
 }