public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int i)
        {
            WeaponsViewHolder vh = viewHolder as WeaponsViewHolder;

            // データ表示
            if (MainWeapons != null && MainWeapons.Count > i && MainWeapons[i] != null)
            {
                vh.MainWeaponTextView.Text = this.MainWeapons[i].Name;
                vh.MainWeaponImageView.SetImageResource(
                    ResourceConverter.GetDrawableID(this.Context, MainWeapons[i].FileName));
                vh.SubWeaponImageView.SetImageResource(
                    ResourceConverter.GetDrawableID(this.Context, MainWeapons[i].SubWeapon.FileName));
                vh.SpecialWeaponImageView.SetImageResource(
                    ResourceConverter.GetDrawableID(this.Context, MainWeapons[i].SpecialWeapon.FileName));

                vh.MainWeaponImageView.Click += delegate
                {
                    WeaponDetailActivity.Start(this.Context, MainWeapons[i]);
                };
            }

            /* クリック処理
             * viewHolder.ItemView.SetOnClickListener(new View.OnClickListener() {
             *  @Override
             *  public void onClick(View v) {
             *      mListener.onRecyclerClicked(v, i);
             *  }
             * });
             */
        }
Exemplo n.º 2
0
        private void InitViews()
        {
            Typeface typeFace = Typeface.CreateFromAsset(this.Assets, "ikamodoki1_0.ttf");

            TextViewMain          = FindViewById <TextView>(Resource.Id.text_view_main);
            TextViewMain.Text     = this.MainWeapon.Name;
            TextViewMain.Typeface = typeFace;

            ImageViewMain = FindViewById <ImageView>(Resource.Id.image_view_main);
            ImageViewMain.SetImageResource(
                ResourceConverter.GetDrawableID(this, this.MainWeapon.FileName));

            PlotView = FindViewById <PlotView>(Resource.Id.plotView);
            // TODO Ö±¤¹
            var barSeries = new BarSeries();

            PlotView.Model = new PlotModel();
            PlotView.Model.Series.Add(barSeries);

            TextViewSub          = FindViewById <TextView>(Resource.Id.text_view_sub);
            TextViewSub.Text     = this.MainWeapon.SubWeapon.Name;
            TextViewSub.Typeface = typeFace;

            ImageViewSub = FindViewById <ImageView>(Resource.Id.image_view_sub);
            ImageViewSub.SetImageResource(
                ResourceConverter.GetDrawableID(this, this.MainWeapon.SubWeapon.FileName));

            TextViewSpecial          = FindViewById <TextView>(Resource.Id.text_view_special);
            TextViewSpecial.Text     = this.MainWeapon.SpecialWeapon.Name;
            TextViewSpecial.Typeface = typeFace;

            ImageViewSpecial = FindViewById <ImageView>(Resource.Id.image_view_special);
            ImageViewSpecial.SetImageResource(
                ResourceConverter.GetDrawableID(this, this.MainWeapon.SpecialWeapon.FileName));

            Toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            CollapsingToolbarLayout = FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar);
        }