Пример #1
0
        // Create new views (invoked by the layout manager)
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            // create a new view
            HourlyForecastItem v = new HourlyForecastItem(parent.Context);

#if __ANDROID_WEAR__
            // set the view's size, margins, paddings and layout parameters
            v.LayoutParameters = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            int paddingHoriz = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 16, parent.Context.Resources.DisplayMetrics);
            v.SetPaddingRelative(paddingHoriz, 0, paddingHoriz, 0);
#endif
            return(new ViewHolder(v));
        }
Пример #2
0
 public ViewHolder(HourlyForecastItem v)
     : base(v)
 {
     mForecastItem = v;
 }