private void SetupInventory() { RefreshPurchasedItems(); SetDescriptionText(); //FindViewById<ScrollView>(Resource.Id.googleStoreActive).Visibility = ViewStates.Visible; //FindViewById<TextView>(Resource.Id.googleStoreNotActive).Visibility = ViewStates.Gone; _taskListView = FindViewById <ListView>(Resource.Id.taskListView); var adapter = new StoreListAdapter(this, _taskProducts, GetSaleForTask, TaskIsEnabled); adapter.ItemClick += AdapterOnItemClick; _taskListView.Adapter = new MultiItemRowListAdapter(this, adapter, 3, 1); _taskListView.JustifyListViewHeightBasedOnChildren(); _bonusListView = FindViewById <ListView>(Resource.Id.bonusListView); var bonusAdapter = new StoreListAdapter(this, _bonusProducts, GetSaleForBonus, BonusIsEnabled); bonusAdapter.ItemClick += AdapterOnItemClick; _bonusListView.Adapter = new MultiItemRowListAdapter(this, bonusAdapter, 3, 1); _bonusListView.JustifyListViewHeightBasedOnChildren(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_store_list); _viewModel = App.Container.GetInstance <StoreListViewModel>(); _refreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.SwipeRefreshLayout); _storeRecyclerView = FindViewById <RecyclerView>(Resource.Id.StoreRecyclerView); _createButton = FindViewById <Button>(Resource.Id.CreateButton); _progressBar = FindViewById <ProgressBar>(Resource.Id.ProgressBar); _storeListAdapter = new StoreListAdapter(_viewModel); _storeRecyclerView.SetAdapter(_storeListAdapter); _storeRecyclerView.SetLayoutManager(new LinearLayoutManager(this)); _viewModel.PropertyChanged += _viewModel_PropertyChanged; _refreshLayout.Refresh += _swipeRefreshLayout_Refresh; _viewModel.RefreshListCommand?.Execute(null); }
private void SetupInventory() { try { RefreshPurchasedItems(); SetDescriptionText(); SetUpProducts(); TaskListAdapter = new StoreListAdapter(this, _allErshProducts.Where(product => product.Type == StringConst.Task)); _taskListView.Adapter = new MultiItemRowListAdapter(this, TaskListAdapter, 3, 1); _taskListView.JustifyListViewHeightBasedOnChildren(); BonusListAdapter = new StoreListAdapter(this, _allErshProducts.Where(product => product.Type == StringConst.Bonus)); _bonusListView.Adapter = new MultiItemRowListAdapter(this, BonusListAdapter, 3, 1); _bonusListView.JustifyListViewHeightBasedOnChildren(); _googleStoreActive.Visibility = ViewStates.Visible; _googleStoreNotActive.Visibility = ViewStates.Gone; } catch (Exception exception) { GaService.TrackAppException(this.Class, "SetupInventory", exception, false); } }
private void SetupInventory() { RefreshPurchasedItems(); SetDescriptionText(); //FindViewById<ScrollView>(Resource.Id.googleStoreActive).Visibility = ViewStates.Visible; //FindViewById<TextView>(Resource.Id.googleStoreNotActive).Visibility = ViewStates.Gone; _taskListView = FindViewById<ListView>(Resource.Id.taskListView); var adapter = new StoreListAdapter(this, _taskProducts, GetSaleForTask, TaskIsEnabled); adapter.ItemClick += AdapterOnItemClick; _taskListView.Adapter = new MultiItemRowListAdapter(this, adapter, 3, 1); _taskListView.JustifyListViewHeightBasedOnChildren(); _bonusListView = FindViewById<ListView>(Resource.Id.bonusListView); var bonusAdapter = new StoreListAdapter(this, _bonusProducts, GetSaleForBonus, BonusIsEnabled); bonusAdapter.ItemClick += AdapterOnItemClick; _bonusListView.Adapter = new MultiItemRowListAdapter(this, bonusAdapter, 3, 1); _bonusListView.JustifyListViewHeightBasedOnChildren(); }